open_short_position

Documentation for eth_defi.one_delta.position.open_short_position function.

open_short_position(one_delta_deployment, *, collateral_token, borrow_token, pool_fee, collateral_amount, borrow_amount, wallet_address, min_collateral_amount_out=0, exchange=Exchange.UNISWAP_V3, interest_mode=AaveV3InterestRateMode.VARIABLE, do_supply=True)[source]

Supply collateral to Aave and open a short position using flash swap. This function can also be used to increase existing short position of the same pair.

NOTE: only single-hop swap is supported at the moment

Parameters
  • one_delta_deployment (eth_defi.one_delta.deployment.OneDeltaDeployment) – 1delta deployment

  • collateral_token (web3.contract.contract.Contract) – collateral token contract proxy

  • borrow_token (web3.contract.contract.Contract) – borrow token contract proxy

  • pool_fee (int) – raw fee of the pool which is used for the swap

  • collateral_amount (int) – amount of collateral to be supplied

  • borrow_amount (int) – amount of borrow token to be borrowed

  • wallet_address (str) – wallet address of the user

  • min_collateral_amount_out (int) – minimum amount of collateral to be received

  • exchange (eth_defi.one_delta.constants.Exchange) – exchange to be used for the swap

  • interest_mode (eth_defi.aave_v3.constants.AaveV3InterestRateMode) – interest mode, variable or stable

  • do_supply (bool) – default to True, if False, only flash swap will be executed

Returns

multicall contract function to supply collateral and open the short position

Return type

web3.contract.contract.ContractFunction