Allbridge Core
LAUNCH APP
  • What is Allbridge Core?
  • ⚪Product
    • How does Allbridge Core work?
      • Fees
      • Messaging protocols
      • Allbridge Core contracts
      • Token value
      • Liquidity provision
    • FAQ
      • How to bridge with Allbridge Core via mobile TronLink
      • Allbridge Core guide
      • How to provide liquidity?
      • What is an Approve Transaction?
    • Security audits
    • Ecosystem reports
    • Leaderboard
  • ⚪Allbridge Core SDK
    • Get started
    • Guides
      • General
        • Token info
        • Send
        • Swap
        • Paying fees with stables
      • EVM
        • Transfer
        • Allowance and approve
      • Solana
        • Transfer
        • Swap
      • Tron
      • Stellar
        • Transfer
      • Utilities
        • Amount and fee calculations
        • Transfer time
        • Extra gas limits
    • Technical reference
    • Referral program
    • Allbridge Core REST API
  • ⚪official support
    • Telegram
    • Discord
  • ⚪Social links
    • Twitter
    • Discord
    • Telegram announcements
    • Telegram group
    • Medium
    • Reddit
  • ⚪Allbridge ecosystem
    • Allbridge Classic
    • Allbridge BaaS
Powered by GitBook
On this page

Was this helpful?

  1. Product
  2. How does Allbridge Core work?

Token value

PreviousAllbridge Core contractsNextLiquidity provision

Last updated 3 months ago

Was this helpful?

When transferring tokens between blockchains, the amount needs to be converted into their internal dollar value. This value depends on the pool condition and the amount being evaluated.

For the sending side (converting tokens into their value):

Where:

  • xorig is the token balance in the pool before swap (tokenBalance view function in the Pool contract)

  • xtokens is the amount of tokens you plan to swap

  • yorig is the value balance in the pool (vUsdBalance view function in the Pool contract)

  • a is a swap curve shape constant (a view function in the Pool contract, does not change)

  • d is a measure of the total liquidity in the pool (d view function in the Pool contract, does not change unless liquidity is added or removed)

  • yvalue is the resulting dollar value of the xtokens tokens

For the receiving side (converting value into tokens, the formula is very similar but reversed):

The meaning of the variables is the same as before, but for the token pool on the receiving side.

⚪