PixelBridge Core
  • What is PixelBridge Core?
  • ⚪PRODUCT
    • How does PixelBridge Core work?
      • Fees
      • Messaging protocols
      • PixelBridge Core contracts
      • Token value
      • Liquidity provision
    • PixelBridge Core guide
    • How to provide liquidity?
    • How to bridge with PixelBridge Core via mobile TronLink
    • Security audit
  • ⚪PixelBridge CORE SDK
    • Get started
    • Guides
      • General
        • Token info
        • Send
        • Swap
        • Paying fees with stables
      • EVM
        • Transfer
        • Allowance and approve
      • Solana
        • Transfer
        • Swap
      • Stellar
        • Transfer
      • Utilities
        • Amount and fee calculations
        • Transfer time
        • Extra gas limits
  • ⚪SOCIAL LINKS
    • Twtter
    • Telegram
    • Medium
  • ⚪PixelBridge ECOSYSTEM
    • PixelBridge Classic
    • PixelBridge BaaS
Powered by GitBook
On this page
  1. ⚪PRODUCT
  2. How does PixelBridge Core work?

Token value

PreviousPixelBridge Core contractsNextLiquidity provision

Last updated 12 months ago

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.