Skip to content
Docs
API Routes
Tokens

Tokens API

Information about the tokens from Yearn's ecosystem.

[GET - `tokens/all`]:                          List all the tokens for all chains.
[GET - `{chainID}/tokens/all`]:                List all the tokens for a specific chain.
[GET - `api/tokens/list`]:                     Access the Yearn's Token List for mainnet.

GET
tokens/all

Get All Tokens

Get All Tokens: REST API endpoint to get all the Tokens in the system for all the chains.

Request

Params

N/A

Query arguments
  • loc: Indicate the localization system to use (aka the language). If a supported language is provided, the values will be returned respecting the language. If the specific `all` key is used, all the localization will be returned.

    ?loc=en # default

Response

Valid request
type TAllTokens struct {
	Address       common.Address        `json:"address"`
	Name          string                `json:"name"`
	Symbol        string                `json:"symbol"`
	Price         float64               `json:"price"`
	Decimals      uint64                `json:"decimals"`
	IsVault       bool                  `json:"isVault"`
	DisplayName   string                `json:"display_name,omitempty"`
	DisplaySymbol string                `json:"display_symbol,omitempty"`
	Description   string                `json:"description,omitempty"`
	Website       string                `json:"website,omitempty"`
	Categories    []string              `json:"categories,omitempty"`
	Localization  *models.TLocalization `json:"localization,omitempty"`
}
map[string]TAllTokens
// https://ydaemon.yearn.finance/tokens/all
{
	"1": {
		"0x03ab458634910aad20ef5f1c8ee96f1d6ac54919": {
			"address": "0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919",
			"name": "Rai Reflex Index",
			"symbol": "RAI",
			"price": 2.584818,
			"decimals": 18,
			"isVault": false,
			"display_symbol": "RAI",
			"description": "RAI is a non pegged, ETH backed stable asset built by Reflexer. It is the first asset of its kind that, instead of being pegged to a specific target such as the USD, it freely floats while it's being influenced by market forces. RAI's mission is to become a crypto native and governance minimized stable asset that is detached from fiat.",
			"website": "http://reflexer.finance/",
			"categories": [
				"Non-pegged Stablecoins"
			]
		},
		"0x03c31f3444357087d5f568d24ae17f9177c8aa84": {
			"address": "0x03c31f3444357087d5f568d24AE17f9177c8AA84",
			"name": "LINK yVault",
			"symbol": "yvLINK",
			"price": 6.982,
			"decimals": 18,
			"isVault": true
		},
	},
	"10": {...},
	...
}
Invalid request

N/A


GET
:chainID/tokens/all

Get All Tokens For ChainID

Get All Tokens For Chain: REST API endpoint to get all the Tokens 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
  • loc: Indicate the localization system to use (aka the language). If a supported language is provided, the values will be returned respecting the language. If the specific `all` key is used, all the localization will be returned.

    ?loc=en # default

Response

Valid request
type TAllTokens struct {
	Address       common.Address        `json:"address"`
	Name          string                `json:"name"`
	Symbol        string                `json:"symbol"`
	Price         float64               `json:"price"`
	Decimals      uint64                `json:"decimals"`
	IsVault       bool                  `json:"isVault"`
	DisplayName   string                `json:"display_name,omitempty"`
	DisplaySymbol string                `json:"display_symbol,omitempty"`
	Description   string                `json:"description,omitempty"`
	Website       string                `json:"website,omitempty"`
	Categories    []string              `json:"categories,omitempty"`
	Localization  *models.TLocalization `json:"localization,omitempty"`
}
// https://ydaemon.yearn.finance/1/tokens/all
{
	"0x03ab458634910aad20ef5f1c8ee96f1d6ac54919": {
		"address": "0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919",
		"name": "Rai Reflex Index",
		"symbol": "RAI",
		"price": 2.584818,
		"decimals": 18,
		"isVault": false,
		"display_symbol": "RAI",
		"description": "RAI is a non pegged, ETH backed stable asset built by Reflexer. It is the first asset of its kind that, instead of being pegged to a specific target such as the USD, it freely floats while it's being influenced by market forces. RAI's mission is to become a crypto native and governance minimized stable asset that is detached from fiat.",
		"website": "http://reflexer.finance/",
		"categories": [
			"Non-pegged Stablecoins"
		]
	},
	"0x03c31f3444357087d5f568d24ae17f9177c8aa84": {
		"address": "0x03c31f3444357087d5f568d24AE17f9177c8AA84",
		"name": "LINK yVault",
		"symbol": "yvLINK",
		"price": 6.982,
		"decimals": 18,
		"isVault": true
	},
}
Invalid request
  • 400 - invalid chainID: The provided chainID is not supported.

GET
api/tokens/list

Get TokenList

Get TokenList: REST API endpoint to get the TokenList for Yearn's Mainnet.

Token Lists aim to solve the problem of the Ethereum community creating, discovering and maintaining lists of reputable tokens in a way that is inclusive, transparent, decentralized and open source. The goal of Token Lists is to enable trust to emerge around reputable tokens in a way that is aligned with the values of decentralization.

Request

Params

N/A

Query arguments

N/A

Response

Valid request

Standardized TokenList JSON object.

{
    "name": "Yearn",
	"timestamp": "2022-05-12T18:15:59+00:00",
	"version": {
		"major": 1,
		"minor": 169,
		"patch": 0
	},
	"tokens": [{
			"chainId": 1,
			"address": "0x16de59092dAE5CcF4A1E6439D611fd0653f0Bd01",
			"name": "iearn DAI",
			"decimals": 18,
			"symbol": "yDAI",
			"logoURI": "https://raw.githubusercontent.com/yearn/yearn-assets/3ec995a8b19cd95e56a1a42b18d394d667e0e2cd/icons/multichain-tokens/1/0x16de59092dAE5CcF4A1E6439D611fd0653f0Bd01/logo.svg",
			"tags": [
				"earn"
			]
		},
		...
	],
	"logoURI": "https://raw.githubusercontent.com/yearn/yearn-assets/3ec995a8b19cd95e56a1a42b18d394d667e0e2cd/icons/multichain-tokens/1/0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e/logo.svg"
}
Invalid request

N/A