AaveV3

You can import the AaveV3 environment by running:

from dojo.environments import AAVEv3Env

It is recommended to read the AaveV3 whitepaper first.


Supported Tokens

At the moment, we suport the following tokens:


Observations

An observation refers to the information that the agent receives from the environment at every block.
With AAVE, the most interesting observation is probably a users health factor.

The methods within AaveV3Obs can be found here.


Actions

Actions are the means through which the agent interacts with the environment to achieve goals.

In general, there are 4 actions you can perform on the Uniswap V3 environment:

  • SUPPLY: Supplying collateral.
  • BORROW: Borrowing a token from the pool.
  • WITHDRAW: Withdrawing collateral.
  • REPAY: Repay borrowed token.
  • LIQUIDATION: Execute a liquidation on a poistion that slipped below a health factor of 1.0.

At the moment, we don't yet support Flash Loans.


Example

example.py
agent = AAVEv3Agent(initial_portfolio={"USDC": Decimal(11_000)})
env = AAVEv3Env(
  date_range=(start_time, end_time),
  agents=[agent],
  backend_type="forked",
  market_impact="default",
)
env.reset()
 
actions = [
  AAVEv3Supply(
      agent=agent,
      token_name="USDC",
      amount=Decimal(10_000),
  ),
  AAVEv3WithdrawAll(agent=agent, token_name="USDC"),
]
 
for action in actions:
  env.step(actions=[action])