Price
These data sources retrieve the price of tokens from different sources.
Price Data Source Return Value
The Data source retrieves the price of a single token (with its nominal decimals), vs the target currency - with its nominal decimals.
E.g.: The price of Ethereum in USD being 256,001,000,000 is:
The price of
10^18 Wei.In units of
10^(-8) USD.
Which means 1 Ethereum costs of 2,560.01 USD.
Target currencies decimals values can be found below.
CoingeckoPrice
Name: CoingeckoPrice
Type: integer
Price of a given token fetched from Coingecko.
Input coin must be the API-ID of tokens from Coingecko.
coin
string
yes
source usdt_price: integer = CoingeckoPrice {
coin: "tether"
};
price == 100750000ChainlinkPrice
Name: ChainlinkPrice
Type: integer
Price of a given token fetched from Chainlink.
Input pair must be one of the pairs supported by Chainlink, separated by a -, e.g. eth-usd . You can find These on Chainlink Available Feeds.
pair
string
yes
Target Currencies Decimals Value
USD
8
BTC
8
ETH
18
Last updated