Prices API
List prices of tokens in USD. Prices are updated every minute and are based on 3 data sources:
- The Lens Oracle Contract via the
getPriceUsdcRecommended
method - The Curve API to get the price of both the LPs and the Underlying tokens
- The Yearn Vaults PricePerShare to be able to get the price of the yTokens based on the price of the underlying token
[GET - `prices/all`]: List all the prices for all chains.
[GET - `{chainID}/prices/all`]: List all the prices for a specific chain.
[GET - `{chainID}/prices/{address}`]: Get a specific price for a specific chain.
[GET - `{chainID}/prices/some/{addresses}`]: List the prices for a list of addresses for a specific chain.
GETprice/all Get All Prices
Get All Prices: REST API endpoint to get all the Prices in the system for all the chains.
Request
Params
N/A
Query arguments
humanized: If this property is set to `true`, the prices will be humanized, aka returned as a standard USD value (e.g. 1.001203). Otherwise, the prices will be returned as a BigNumber (e.g. 1001203).
?humanized=false # default
Response
Valid request
map[chainID]map[common.Address]string // is humanized is false
map[chainID]map[common.Address]float64 // is humanized is true
// https://ydaemon.yearn.finance/prices/all?humanized=true
{
"1": {
"0x3408324dbb537886cadc180f6ffcf674ee215f67": 19177.775729,
"0x341bb10d8f5947f3066502dc8125d9b8949fd3d6": 1.37813,
"0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0": 4.311862,
"0xff8f8a38c80b9899a928152d58f219fdccd4306c": 1309.000715
},
"10": {
"0x061b87122ed14b9526a813209c8a59a633257bab": 1.013707,
"0x0a2f234ad2e5e9047067904a9d37d0cd02b80d12": 19197.69964,
"0x0fbea11f39be912096cec5ce22f46908b5375c19": 1.011286,
"0x1337bedc9d22ecbe766df105c9623922a27963ec": 1.013718
},
"250": {
"0x03fa4c23ba3a7bc0bec18789ce29c7857324bd22": 0.998672,
"0x0446acab3e0242fcf33aa526f1c95a88068d5042": 0.934997,
"0x049d68029688eabf473097a2fc38ef61633a3c7a": 1.000256,
"0x075c1d1d7e9e1af077b0b6117c6ea06cd0a260b5": 1.002875
},
"42161": {
"0x0a824b5d4c96ea0ec46306efbd34bf88fe1277e0": 1327.728015,
"0x115d8bf0a53e751f8a472f88d587944ec1c8ca6d": 19142.31,
"0x116172b2482c5dc3e6f445c16ac13367ac3fcd35": 0.949749,
"0x1c5ffa4fb4907b681c61b8c82b28c4672ceb1974": 0.542506
}
}
// https://ydaemon.yearn.finance/prices/all
{
"1": {
"0x3408324dbb537886cadc180f6ffcf674ee215f67": "19177775729",
"0x341bb10d8f5947f3066502dc8125d9b8949fd3d6": "137813",
"0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0": "4311862",
"0xff8f8a38c80b9899a928152d58f219fdccd4306c": "1309000715"
},
"10": {
"0x061b87122ed14b9526a813209c8a59a633257bab": "1013707",
"0x0a2f234ad2e5e9047067904a9d37d0cd02b80d12": "1919769964",
"0x0fbea11f39be912096cec5ce22f46908b5375c19": "1011286",
"0x1337bedc9d22ecbe766df105c9623922a27963ec": "1013718",
},
"250": {
"0x03fa4c23ba3a7bc0bec18789ce29c7857324bd22": "0998672",
"0x0446acab3e0242fcf33aa526f1c95a88068d5042": "0934997",
"0x049d68029688eabf473097a2fc38ef61633a3c7a": "1000256",
"0x075c1d1d7e9e1af077b0b6117c6ea06cd0a260b5": "1002875",
},
"42161": {
"0x0a824b5d4c96ea0ec46306efbd34bf88fe1277e0": "1327728015",
"0x115d8bf0a53e751f8a472f88d587944ec1c8ca6d": "1914231",
"0x116172b2482c5dc3e6f445c16ac13367ac3fcd35": "0949749",
"0x1c5ffa4fb4907b681c61b8c82b28c4672ceb1974": "0542506",
}
}
Invalid request
N/A
GET:chainID/price/all Get All Prices For ChainID
Get All Prices For ChainID: REST API endpoint to get all the Prices in the system for one specific chainID. You can check the getSupportedChains endpoint to get the list of supported chains.
Request
Params
- chainID: The chainID of the chain you want to get the Prices for. Must be provided in the URL, and must be one of the supported chains.
Query arguments
humanized: If this property is set to `true`, the prices will be humanized, aka returned as a standard USD value (e.g. 1.001203). Otherwise, the prices will be returned as a BigNumber (e.g. 1001203).
?humanized=false # default
Response
Valid request
map[common.Address]string // is humanized is false
map[common.Address]float64 // is humanized is true
// https://ydaemon.yearn.finance/1/prices/all?humanized=true
{
"0x3408324dbb537886cadc180f6ffcf674ee215f67": 19177.775729,
"0x341bb10d8f5947f3066502dc8125d9b8949fd3d6": 1.37813,
"0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0": 4.311862,
"0xff8f8a38c80b9899a928152d58f219fdccd4306c": 1309.000715
}
// https://ydaemon.yearn.finance/1/prices/all
{
"0x3408324dbb537886cadc180f6ffcf674ee215f67": "19177775729",
"0x341bb10d8f5947f3066502dc8125d9b8949fd3d6": "137813",
"0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0": "4311862",
"0xff8f8a38c80b9899a928152d58f219fdccd4306c": "1309000715"
}
Invalid request
400 - invalid chainID
: The provided chainID is not supported.
GET:chainID/price/:address Get Price For Token
Get Price For Token: REST API endpoint to get all the Price of one specific token for one specific chainID. You can check the getSupportedChains endpoint to get the list of supported chains.
Request
Params
- chainID: The chainID of the chain you want to get the Price for. Must be provided in the URL, and must be one of the supported chains.
- address: The address of the token you want to get the information for.
Query arguments
humanized: If this property is set to `true`, the prices will be humanized, aka returned as a standard USD value (e.g. 1.001203). Otherwise, the prices will be returned as a BigNumber (e.g. 1001203).
?humanized=false # default
Response
Valid request
string // is humanized is false
float64 // is humanized is true
// https://ydaemon.yearn.finance/10/prices/0x3fc986cc3b44bad5baf1e47031055cf69466ad57?humanized=true
1.011286
// https://ydaemon.yearn.finance/10/prices/0x3fc986cc3b44bad5baf1e47031055cf69466ad57?humanized=false
"1011286"
Invalid request
400 - invalid chainID
: The provided chainID is not supported.400 - invalid address
: The provided token address is not a valid Ethereum address or is blacklisted for this network.404 - token not found
: The provided token address is not supported.
GET:chainID/price/some/:addresses Get Prices For Some Tokens
Get Price For Token: REST API endpoint to get all the Price of some specific tokens for one specific chainID. You can check the getSupportedChains endpoint to get the list of supported chains.
Request
Params
- chainID: The chainID of the chain you want to get the Price for. Must be provided in the URL, and must be one of the supported chains.
- addresses: A list of addresses, separated by a comma, of the tokens you want to get the information for.
Query arguments
humanized: If this property is set to `true`, the prices will be humanized, aka returned as a standard USD value (e.g. 1.001203). Otherwise, the prices will be returned as a BigNumber (e.g. 1001203).
?humanized=false # default
Response
Valid request
map[common.Address]string // is humanized is false
map[common.Address]float64 // is humanized is true
// https://ydaemon.yearn.finance/1/prices/some/0x3408324dbb537886cadc180f6ffcf674ee215f67,,0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0,0xff8f8a38c80b9899a928152d58f219fdccd4306c?humanized=true
{
"0x3408324dbb537886cadc180f6ffcf674ee215f67": 19177.775729,
"0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0": 4.311862,
"0xff8f8a38c80b9899a928152d58f219fdccd4306c": 1309.000715
}
// https://ydaemon.yearn.finance/1/prices/some/0x3408324dbb537886cadc180f6ffcf674ee215f67,,0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0,0xff8f8a38c80b9899a928152d58f219fdccd4306c
{
"0x3408324dbb537886cadc180f6ffcf674ee215f67": "19177775729",
"0x3432b6a60d23ca0dfca7761b7ab56459d9c964d0": "4311862",
"0xff8f8a38c80b9899a928152d58f219fdccd4306c": "1309000715"
}
Invalid request
400 - invalid chainID
: The provided chainID is not supported.