AspisPool

AspisPool.sol

The main contract of the vault and the entry point for users. This is where they can deposit funds so that vault managers could trade.

Roles

Functions

Deposit

The entry point for users, where they deposit their funds. The funds will get transferred from sender to the pool in exchange for the pool’s LP tokens. The price of LP shares is determined on-chain, using an internal conversion via AspisLiquidityCalculatorV3.

function deposit(
    address _token,
    uint256 _amount,
    bytes calldata _oraclesPayload,
    bytes calldata _depositTokenOraclesPayload
) external payable override nonReentrant notEmergencyMode

_token - the token that is being deposited. It must be a part of the “deposit” tokens, stored in AspisConfiguration, otherwise the transaction will be reverted.

_amount - token amount scaled by its decimals.

_oraclesPayload - the manual calldata oracle payload that contains the encoded prices.

_depositTokenOraclesPayload - the manual calldata oracle payload for _token.

Withdraw

Users can burn their LP shares when the funds are unlocked. They get their share of the pool assets in exchange.

function withdraw(
    address _to,
    bytes calldata _oraclesPayload
) external override nonReentrant

_to - the recepient of pool assets.

_oraclesPayload: Refer to the “deposit” section for details.

Execute (for trading)