dojo.actions
This module contains all actions that can be executed by environments.
Supply funds to AAVEv3 pool. You can earn interest for supplying funds.
Parameters
- token: Symbol of the token you want to supply.
- amount: Amount of tokens being supplied, in human-readable format. (e.g. Decimal('1.5') ETH).
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Witdraw funds from AAVEv3 pool.
Parameters
- token: Symbol of the token you want to withdraw.
- amount: Amount to withdraw, in human-readable format. (e.g. Decimal('1.5') ETH).
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Witdraw all funds from AAVEv3 pool.
Parameters
- token: Symbol of the token you want to withdraw.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Borrow tokens from AAVEv3 pool.
Parameters
- token: Symbol of the token you want to borrow.
- amount: Amount to borrow, in human-readable format. (e.g. Decimal('1.5') ETH).
- mode: Type of borrow debt - stable or variable.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Borrow tokens from AAVEv3 pool to a specific health factor.
Parameters
- token: Symbol of the token you want to borrow.
- factor: Health factor to borrow to.
- mode: Type of borrow debt - stable or variable.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Repay borrowed tokens.
Parameters
- token: Symbol of the token you want to repay.
- amount: Amount to repay, in human-readable format. (e.g. Decimal('1.5') ETH).
- mode: Type of borrow debt - stable or variable.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Repay all borrowed tokens.
Parameters
- token: Symbol of the token you want to repay.
- mode: Type of borrow debt - stable or variable.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Repay tokens to a specific health factor.
Parameters
- token: Symbol of the token you want to repay.
- factor: Health factor to repay to.
- mode: Type of borrow debt - stable or variable.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Liquidate a users collateral, if their health factor has dropped below 1.0.
Parameters
- collateral: Symbol of the token used as collateral.
- debt: Symbol of the token used as debt.
- user: Address of the borrower.
- debtToCover: Amount of asset debt that the liquidator will repay in human- readable format.
- receiveAToken: Whether to receive the liquidated asset as aTokens. Default is False.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Liquidate the maximum amount of a user's collateral.
Parameters
- collateral: Symbol of the token used as collateral.
- debt: Symbol of the token used as debt.
- user: Address of the borrower.
- receiveAToken: Whether to receive the liquidated asset as aTokens. Default is False.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Take a simple flash loan - access the liquidity of one reserve.
Parameters
- token: Symbol of the token you want to flash borrow.
- amount: Amount to flash borrow, in human-readable format. (e.g. Decimal('1.5') ETH).
- receiver: Address of the contract receiving the flash loan.
- params: Arbitrary bytes-encoded params that will be passed to executeOperation() method of the receiver contract.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Take a flash loan - access the liquidity of multiple reserves.
Parameters
- tokens: List of symbols of the token you want to flash borrow.
- amounts: List of amounts to flash borrow, in human-readable format. (e.g. Decimal('1.5') ETH).
- modes: List of borrow debt types - none, stable, or variable.
- receiver: Address of the contract receiving the flash loan.
- params: Arbitrary bytes-encoded params that will be passed to executeOperation() method of the receiver contract.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Trade action for UniswapV3.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- quantities: The quantities to trade.
- price_limit: The price limit for the trade (slippage).
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Trade tokens for perfect ration to then provide in a tick range.
At the moment, it just trades to 50/50 in value, if the active tick is covered.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- quantities: The quantities to trade.
- tick_range: The tick range to provide in.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Quote action for UniswapV3.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- quantities: The quantities to trade.
- tick_range: The tick range to quote.
- liquidity: Optional liquidity to use for the quote, needed for
MarketAgent
burns. - owner: Optional owner to use for the quote, needed for
MarketAgent
burns. - gas: Optional gas units.
- gas_price: Optional gas price in wei.
Quote action for UniswapV3.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- tick_range: The tick range to quote.
- liquidity: The amount of liquidity that should be provided.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Provide a specific amount of quantities.
Will throw errors if the quantities are incompatible with the tick range.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- tick_range: The tick range to quote.
- amount0: Amount of token 0.
- amount1: Amount of token 1.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Increase Liquidity of an existing position.
Not yet supported.
Parameters
- agent: Amount of token 0.
- pool: The pool name to trade on.
- position_id: ID of the position to increase.
- liquidity: Amount of liquidity to increase (in wei).
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Withdraw Liquidity from an existing position.
Tokens can then be collected from the position, or re-provided.
Parameters
- agent: The agent executing the action.
- position_id: ID fo the position to withdraw from.
- liquidity: Amount of liquidity to withdraw (in wei).
- owner: The owner of the position to withdraw from.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Liquidating a Position.
This will withdraw all liquidity from the postion, send it to the liquidation agent and destroy the LP token. Not yet supported.
Parameters
- agent: The agent executing the action.
- position_id: ID of the position to liquidate.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Collect action for UniswapV3.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- quantities: The quantities to trade.
- tick_range: The tick range to quote.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
SetFeeProtocol action for UniswapV3.
Parameters
- agent: The agent executing the action.
- pool: The pool name to trade on.
- quantities: The quantities to trade.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Collect all tokesn from a position.
Parameters
- agent: TODO
Burn a position.
The position needs to be empty, or an error will be thrown
Action representing an increase long market order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing an decrease long market order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing an increase short market order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing an decrease short market order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing an increase long limit order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- trigger_price: The trigger price.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing an decrease long limit order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- trigger_price: The trigger price.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing an increase short limit order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- trigger_price: The trigger price.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing a decrease short limit order on GMX v2.
Parameters
- agent: The agent executing the action.
- size_delta_usd: The size delta in USD.
- market_key: The market key.
- token_in_symbol: The token in symbol.
- collateral_token_symbol: The collateral token symbol.
- observations: The observations.
- leverage: The leverage.
- slippage: The slippage.
- trigger_price: The trigger price.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing a swap order on GMX v2.
Parameters
- agent: The agent executing the action.
- in_token: The input token.
- out_token: The output token.
- in_token_amount: The input token amount.
- slippage: The slippage.
- observations: The observations.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Data class for creating a LP deposit on GMX v2.
Parameters
- agent: The agent creating the deposit.
- market_key: The market key for the deposit.
- initial_long_token_symbol: The initial long token symbol.
- initial_short_token_symbol: The initial short token symbol.
- long_token_usd: The amount of long token in USD.
- short_token_usd: The amount of short token in USD.
- observations: The observations object.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.
Action representing a withdrawal on GMX v2.
Parameters
- agent: The agent executing the action.
- market_key: The market key.
- gm_token_amount: The GM token amount.
- gas: Optional gas units.
- gas_price: Optional gas price in wei.