vToken APIs
Last updated
Last updated
There are three ways to query vToken exchange price:
Use the Bifrost Runtime API, which is the most up-to-date and accurate method.
Call EVM contract on Moonbeam.
API for Frontend (with more vToken related storages)
https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fbifrost-polkadot-rpc.dwellir.com#/runtime
vtokenMintingRuntimeApi
getCurrencyAmountByVCurrencyAmount
getVCurrencyAmountByCurrencyAmount
As the showcase above, token2:0
is DOT and vtoken2:0
is vDOT on Bifrost Polkadot, getCurrencyAmountByVCurrencyAmount is to input vDOT amount (with decimals) to query the exchange price in DOT.
Check the Token indexs via here.
Query the exchange rate from SLPx contract on Moonbeam:
https://github.com/bifrost-io/slpx-contracts?tab=readme-ov-file#xcmoracle
Check more details at here.
exchangeRatio
is to get Token by vToken
Api 1: Includes the following queryable interfaces
Api 2: Includes the following queryable interfaces