Staple Simulation
Home Vtp-Fees Apr Incentives
Vtp Param
ℹ️
  • n: The larger the value of 'n,' the more sensitive 'ralr' is to deviations of oracle price and market price.
  • p: Threshold for heavy punishments (or rewards).

  • ralr: Relative Asset-Liability Ratio
  • Po: Price by Oracle, the quotient of the oracle's price.
  • Pa: Price Adjusted by ralr from Po.
  • n = 30
    p = 0.1
    =====
    ralr = 1
    Po = 1
    Pa = 1

    Page Param
    ℹ️
    The 'decimals' parameter here applies to the entire page and is used to determine the decimal precision of the output numerical values.
    decimal = 6

    ℹ️
    Reset all input parameters to their default values.

    ℹ️
    Output the parameters on the page as a string for the purpose of reproducing them on other pages or devices.


    ℹ️
    Paste the correct structure in the input box below to reproduce the conditions of other vtps.

    Data to Import:

    Exported Data:
    ℹ️
    Click the text three times to select it all.
    Token 0
    ℹ️
  • wallet balance: User token balance in the wallet.(metamask etc.)
  • lp balance: User lp balance in the wallet.

  • asset: The amount of asset of this token within this vtp.
  • allocated: The amount allocated by the liquidity providers.
  • feeCollected: Unclaimed fee, collected for the users.
  • liability: = allocated + feeCollected. The vtp's liability of all users.
  • alr: = asset / liability. Asset-Liability Ratio.

  • oracle price: Token price read from the oracle.
  • historyFee: All the fees collected for the users in history.
  • protocolFee: Fee collected for the protocol.

  • swapInFee: Fee ratio during the swapIn process.
  • swapOutFee: Fee ratio during the swapOut process.
  • protocolFeeRate: The ratio that the protocol will take from all the swap fees.
  • alrLowerBound: The alr should never be lower than this param. A swap that will lead the alr to be lower than alrLowerBound will be reverted.

  • user allocation: User's allocation in this vtpToken.
  • user shares: The shares of this user within this vtpToken. (user shares)/(all shares) ≈ (user allocation)/(liability).
  • all shares: All the shares within this vtpToken.

  • The calculated results, representing the token's status.
  • ralr0: Relative Asset-Liability Ratio of this token. = alr0 / alr1.
  • Po0: Price by Oracle. = op0 / op1.
  • Pa0: Price Adjusted by ralr0 from Po0.
  • wallet balance = 50000
    lp balance = 10000
    =====
    asset = 10000
    allocated = 10000
    feeCollected = 0
    liability = 10000
    alr = 1
    oracle price = 1
    historyFee = 0
    protocolFee = 0
    =====
    swapInFee = 0
    swapOutFee = 0.0001
    protocolFeeRate = 0.1
    alrLowerBound = 0.88
    =====
    uncharged fee = 0
    user allocation = 4000
    userShares = 4000
    totalShares = 10000
    =====
    ralr0 = 1
    Po0 = 1
    Pa0 = 1
    mas0 = 0
    Token 1
    wallet balance = 50000
    lp balance = 10000
    =====
    asset = 10000
    allocated = 10000
    feeCollected = 0
    liability = 10000
    alr = 1
    oracle price = 1
    historyFee = 0
    protocolFee = 0
    =====
    swapInFee = 0
    swapOutFee = 0.0001
    protocolFeeRate = 0.1
    alrLowerBound = 0.88
    =====
    uncharged fee = 0
    user allocation = 4000
    userShares = 4000
    totalShares = 10000
    =====
    ralr1 = 1
    Po1 = 1
    Pa1 = 1
    mas1 = 0
    Swap
    ℹ️
    discount: The swap fee discount of this user.
    MUST be within 0~1. Use 0.1 for 10%.
    amount = 10
    direction =
    discount = 0

    Result
    ℹ️
  • feeIn: Fee to be collected for "swapIn".
  • feeOut: Fee to be collected for "swapOut".
  • realOut: The amount user will actually get.
  • impact: = (value of tokenOut) / (value of tokenIn) - 1
  • feeIn = -
    feeOut = -
    punishments = -
    rewards = -
    realOut = -
    impact = -
    =====
    alr0 after swap = -
    alr1 after swap = -
    ralr0 after swap = -

    Compare with Frontend
    front result =
    deviation = -

    ℹ️
    CLICK on this button to execute the operation, and the status of the params will be updated.
    Allocate
    amount =
    token =
    =

    Result
    fee = -
    fee rate = -
    =====
    alr after allocate = -

    Compare with Frontend
    front result =
    deviation = -

    ℹ️
    CLICK on this button to execute the operation, and the status of the params will be updated.
    Deallocate
    ℹ️
    Will claim the fees collected along with deallocation.
    Deallocate 0 to claim the fee.
    amount = 4000
    token =
    =

    Result
    rewards to claim = -
    fee = -
    fee rate = -
    =====
    alr after deallocate = -

    Compare with Frontend
    front result =
    deviation = -

    ℹ️
    CLICK on this button to execute the operation, and the status of the params will be updated.
    Error
    ℹ️
    Show the result.
    failed

    Executions
    ℹ️
    Record operations.
    .