AaveV3

You can import the AaveV3 environment by running:

run.py
404: Not Found

It is recommended to read the AaveV3 whitepaper first.


Supported Tokens

At the moment, we suport the following tokens:

ChainsBackend TypesAssetStart Date
Ethereum Mainnet - ethereumforkedWBTC - Wrapped Bitcoin 2023-02-17 17:50:00 UTC
USDC - USD Coin 2023-02-17 17:50:00 UTC
WETH - Wrapped Ethereum 2023-02-17 17:50:00 UTC
USDT - Tether 2023-02-17 17:50:00 UTC
DAI - Dai Stablecoin 2023-02-17 17:50:00 UTC
UNI - Uniswap Token 2023-07-01 15:10:00 UTC
BAL - Balancer Token 2023-05-06 07:15:00 UTC

We start indexing Aave's Pool smart contract from 2023-01-14 12:45:00 UTC onwards. So in order to perform actions on AaveV3 environment, the start date must be greater than this.

We start indexing the price of assets from the given start dates. So from those dates onwards, you can retrieve the price of that asset.


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 = DummyAgent(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])