Tempest Finance Docs
  • Introduction
    • Welcome to Tempest
    • Official Links
    • FAQ
    • Audits
    • Tokenomics
  • Concepts
    • Rebalancing Symmetric Strategy
    • LST/LRT Arbitrage Recapture
  • USERS
    • Vaults and Positions
    • Deposit
    • Withdraw
  • DEVELOPERS
    • Deployed Contracts
    • Vault Contract Interface
      • Rebalancing Symmetric Strategy
        • Deposit
        • Withdraw
        • Queries
      • LST/LRT Arbitrage Recapture
        • Deposit
        • Withdraw
        • Queries
Powered by GitBook
On this page
  • getTokenAddresses
  • getLpParams
  • getPosition
  • getPositions
  • totalAssets
  • currentTick
  • previewDeposit
  • previewWithdraw
  • convertToShares
  • convertToAssets
  • calculateAmount1ForAmount0
  • calculateAmount0ForAmount1
  1. DEVELOPERS
  2. Vault Contract Interface
  3. Rebalancing Symmetric Strategy

Queries

There are some functions can be used to query the Vault information and state.

getTokenAddresses

/// @notice Return token addresses of the Vault
function getTokenAddresses() external view returns (address[2] memory)

getLpParams

Function interface:

/// @notice Gets the current params of the Vault
function getLpParams() external view returns (LpParam[] memory)

getLpParams returns the current parameters of the Vault as an array of LpParam. The below is the structure of the LpParam:

struct LpParam {
  /// The upper tick of the position in Ambient's underlying pool
  int24 upperTick;
  /// The upper tick of the position in Ambient's underlying pool
  int24 lowerTick;
}

getPosition

/// @notice Gets the current Vault's position in the Ambient's underlyingpool for the specified tick ranges
/// @param _upperTick The upper tick range
/// @param _lowerTick The lower tick range
/// @return The current liquidity, amount of token0, and amount of token1
function getPosition(int24 _upperTick, int24 _lowerTick) external view returns (uint128, uint128, uint128)

getPositions

/// @notice Gets the current token amounts of the Vault
/// @return amount0Invested Amount of token 0 was invested to the Ambient's underlying pool
/// @return amount1Invested Amount of token 1 was invested to the Ambient's underlying pool
/// @return amount0Idle Amount of token 0 was not invested to the Ambient's underlying pool (the dust after providing liquidity or swapping))
/// @return amount1Idle Amount of token 1 was not invested to the Ambient's underlying pool (the dust after providing liquidity or swapping)
function getPositions()
  external
  view
  returns (uint256 amount0Invested, uint256 amount1Invested, uint256 amount0Idle, uint256 amount1Idle)

totalAssets

/// @notice Returns the approximate total assets held by the Vault
/// @return The total assets
function totalAssets() public view returns (uint256)

currentTick

/// @notice Returns the current tick of the Ambient's underlying pool
/// @return The current tick
function currentTick() public view returns (int24)

previewDeposit

/// @notice Calculates the number of shares for the given amount of assets
/// @param assets The amount of assets
/// @return The number of shares
function previewDeposit(uint256 assets) external view returns (uint256)

previewWithdraw

/// @notice Calculates the number of shares for the given amount of assets to withdraw
/// @param assets The amount of assets
/// @return The number of shares
function previewWithdraw(uint256 assets) external view returns (uint256)

convertToShares

/// @notice Converts a given amount to shares
/// @param amount The amount to convert
/// @return The number of shares corresponding to the amount
function convertToShares(uint256 amount) external view returns (uint256)

convertToAssets

/// @notice Converts a given number of shares to assets
/// @param shares The number of shares
/// @return The amount of assets corresponding to the shares
function convertToAssets(uint256 shares) external view returns (uint256)

calculateAmount1ForAmount0

/// @notice Calculates the amount of token1 needed for a given amount of token0 in dual-side depositing
/// @param amountToken0 The amount of token0
/// @return The calculated amount of token1
function calculateAmount1ForAmount0(uint256 amountToken0) external view returns (uint256)

calculateAmount0ForAmount1

/// @notice Calculates the amount of token0 needed for a given amount of token1 in dual-side depositing
/// @param amountToken1 The amount of token1
/// @return The calculated amount of token0
function calculateAmount0ForAmount1(uint256 amountToken1) external view returns (uint256)
}
PreviousWithdrawNextLST/LRT Arbitrage Recapture

Last updated 6 months ago