vToken is Bifrost parachain-token that can be only issued by the Bifrost vtokenMinting pallet, the total issuance of a vToken is minted by the ratio between Token and vToken amount stored in the token_pool, e.g. each vDOT reserved by 1 staked DOT and its staking reward. The token_pool storage comes from the amount of DOT staked + staking reward on the Polkadot relay chain.

Query RPCs on Bifrost chain: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fbifrost-polkadot.api.onfinality.io%2Fpublic-ws#/chainstate

Check all vToken and Token indexes: https://www.notion.so/bifrost-finance/485987dfe60d4af9a57d560c8b7f492e?v=20f29c9b48db448dadb63e24358a19c4

For Querying Exchange Rate

Get a LST exchangeRate on Bifrost as following:

1. Query vDOT totalIssuance

await api.query.assets.totalIssuance({vToken2:'0'}) :12,413,325,406,047,960 (10 decimals)

Untitled

2. Query Total DOT staked behind vDOT

await api.query.vtokenMinting.tokenPool({Token2:'0'}) :14,927,444,061,768,887 (10 decimals)

Untitled

3. Calculate vDOT exchangeRate:

Total DOT staked amount/ vDOT totalIssuance = 14,927,444,061,768,887 / 12,413,325,406,047,960

Hence, vDOT:DOT exchangeRate = 1.2025


For Querying DEX Swaping Price

vKSM swap rate (Swap vKSM and KSM in DEX):