Skip to content
Docs
API Routes
Vaults

Vaults API

List vaults that are currently active on the Yearn's ecosystem.

[GET - `vaults/tvl`]:                              Get the total value locked in the Yearn ecosystem across all vaults for all chains.
[GET - `{chainID}/vaults/tvl`]:                    Get the total value locked in the Yearn ecosystem across all vaults for a specific chain.
[GET - `{chainID}/vaults/all`]:                    List the vaults for a specific chain.
[GET - `{chainID}/vaults/{address}`]:              Get a specific vault for a specific chain.
[GET - `{chainID}/vault/{address}`]:               Get a specific vault for a specific chain. Alias for `{chainID}/vaults/{address}`.
[GET - `info/vaults/blacklisted`]:                 List the blacklisted vaults (aka ignored vaults).
[GET - `{chainID}/vaults/harvests/{addresses}`]:   List the harvests for a group of vault addresses.

GET
:chainID/vaults/all

Get All Vaults

Get All Vaults: REST API endpoint to get all the Vaults in the system for a given chainID.

You can check getSupportedChains to get a list of supported chains.

When performing a GET request to this endpoint, a GraphQL query is executed to retrieve the basic information about all the Vaults from the official Yearn's subgraph.

The blacklisted vaults are ignored from the query and a comprehensive list of all the Vaults is returned.

Request

Params
  • chainID: The chainID of the chain you want to get the Vaults for. Must be provided in the URL, and must be one of the supported chains.
Query arguments
  • hideAlways: If this property is set to `true`, all vaults with the meta property `hideAlways` will be ignored.

    ?hideAlways=false # default
  • orderBy: The vaults are ordered by the `Dropdown.order` property by default, but you can change this by setting this argument to another property of the vaults. Any property of the vaults can be used, separated by a `.` if it's a nested property.

    ?orderBy=Dropdown.order # default
  • orderDirection: The vaults are ordered in ascending order by default, but you can change this by setting this argument to `desc` to get the vaults in descending order.

    ?orderDirection=asc # default
  • strategiesCondition: This property is used to defined which strategies should be returned. We are looking for the "active" strategies but multiple definitions of "active" exist. The possible arguments are:

    • debtLimit: The strategy is active if the debtLimit is greater than 0.
    • debtRatio: The strategy is active if the debtRatio is greater than 0.
    • inQueue: The strategy is active if it is in the vault's withdrawalQueue.
    • absolute: The strategy is active if the debtLimit is greater than 0 and if it is in the vault's withdrawalQueue and if the totalDebt is greater than 0.
    ?strategiesCondition=debtLimit # default
  • strategiesDetails: The Dropdown of the strategies are not returned by default, but you can change this by setting this argument to `withDetails` to get the Dropdown of the strategies.

    ?strategiesDetails=none # default
  • strategiesRisk: The risk of the strategies are not returned by default, but you can change this by setting this argument to `withRisk` to get the risk of the strategies.

    ?strategiesRisk=none # default

Response

Valid request
	type TVault struct {
		Address               string             `json:"address"` // Address of the vault on the chain.
		Symbol                string             `json:"symbol"` // Symbol representing the vault.
		DisplaySymbol         string             `json:"display_symbol"` // Human set alias for the symbol.
		FormatedSymbol        string             `json:"formated_symbol"` // Following format: `yv{underlyingTokenSymbol}`
		Name                  string             `json:"name"` // Name of the vault.
		DisplayName           string             `json:"display_name"` // Human set alias for the name of the vault.
		FormatedName          string             `json:"formated_name"` // Following format: `{underlyingTokenName} yVault`.
		Icon                  string             `json:"icon"` // URI of the 128x128 png icon of the vault.
		Version               string             `json:"version"` // Version of the vault.
		Type                  string             `json:"type"` // Type of the vault (only V2 for now).
		Inception             uint64             `json:"inception"` // Date when the vault was created.
		Decimals              uint64             `json:"decimals"` // Number of decimals of the vault token.
		Updated               uint64             `json:"updated"` //When the vault was last updated.
		Endorsed              bool               `json:"endorsed"` //Indicates if the vault is endorsed by Yearn or not
		Emergency_shutdown    bool               `json:"emergency_shutdown"` //Indicates if the vault is currently in emergency shutdown mode.

		//Token contains the relevant information about the underlying token.
		Token struct {
			Address           string             `json:"address"` // Address of the underlying token.
			Name              string             `json:"name"` // Name of the underlying token.
			DisplayName       string             `json:"display_name"` // Human set alias for the name of the underlying token.
			Symbol            string             `json:"symbol"` // Symbol of the underlying token.
			Description       string             `json:"description"` // Meta-description for this token, based on Yearn-Meta.
			Decimals          uint64             `json:"decimals"` // Number of decimals of the underlying token.
			Icon              string             `json:"icon"` // URI of the 128x128 png icon of the underlying token.
		} `json:"token"`

		//TVL holds the info about the value locked in a vault
		TVL struct {
			TotalAssets          *bigNumber.Int `json:"total_assets"` // Total amount of assets in the vault
			TotalDelegatedAssets *bigNumber.Int `json:"total_delegated_assets"` // Total amount of assets delegated to the strategies
			TVLDeposited         float64        `json:"tvl_deposited"` // Total value locked in the vault
			TVLDelegated         float64        `json:"tvl_delegated"` // Total value delegated to other vaults
			TVL                  float64        `json:"tvl"` // Total value locked minus the delegated value
			Price                float64        `json:"price"` // Price of the underlying token
		} `json:"tvl"`

		//APY contains all the information useful about the APY, APR, fees and breakdown.
		APY struct {
			Type              string            `json:"type"`
			GrossAPR          float64           `json:"gross_apr"`
			NetAPY            float64           `json:"net_apy"`
			Fees struct {
				Performance   float64           `json:"performance"`
				Withdrawal    float64           `json:"withdrawal"`
				Management    float64           `json:"management"`
				KeepCRV       float64           `json:"keep_crv"`
				CvxKeepCRV    float64           `json:"cvx_keep_crv"`
			}                                   `json:"fees"`
			Points struct {
				WeekAgo       float64           `json:"week_ago"`
				MonthAgo      float64           `json:"month_ago"`
				Inception     float64           `json:"inception"`
			}                                   `json:"points"`
			Composite struct {
				Boost         float64            `json:"boost"`
				PoolAPY       float64            `json:"pool_apy"`
				BoostedAPR    float64            `json:"boosted_apr"`
				BaseAPR       float64            `json:"base_apr"`
				CvxAPR        float64            `json:"cvx_apr"`
				RewardsAPR    float64            `json:"rewards_apr"`
			}                                    `json:"composite"`
		} `json:"apy"`

		//Strategies contains all the information useful about the strategies currently active in this vault.
		Strategies []struct {
			Address             string           `json:"address"` // Address of the strategy.
			Name                string           `json:"name"` // Name of the strategy.
			Description         string           `json:"description"` // Meta-description for this strategy, based on Yearn-Meta.
			Details struct {
				Version         string           `json:"version"`
				Keeper          string           `json:"keeper"`
				Strategist      string           `json:"strategist"`
				Rewards         string           `json:"rewards"`
				HealthCheck     string           `json:"healthCheck"`
				TotalDebt       string           `json:"totalDebt"`
				TotalLoss       string           `json:"totalLoss"`
				TotalGain       string           `json:"totalGain"`
				LastReport      string           `json:"lastReport"`
				APR             float64          `json:"apr"`
				DebtLimit       uint64           `json:"debtLimit"`
				DoHealthCheck   bool             `json:"doHealthCheck"`
				InQueue         bool             `json:"inQueue"`
				EmergencyExit   bool             `json:"emergencyExit"`
			}                                    `json:"Dropdown"`
		} `json:"strategies"`

		//Details holds some extra information about the vault.
		Details struct {
			Management            common.Address `json:"management"` // Address of the management contract.
			Governance            common.Address `json:"governance"` // Address of the governance contract.
			Guardian              common.Address `json:"guardian"` // Address of the guardian contract.
			Rewards               common.Address `json:"rewards"` // Address of the rewards contract.
			DepositLimit          *bigNumber.Int `json:"depositLimit"` // Maximum amount of underlying tokens that can be deposited in the vault.
			AvailableDepositLimit *bigNumber.Int `json:"availableDepositLimit,omitempty"` // Maximum amount of underlying tokens that can be currently deposited in the vault.
			Comment               string         `json:"comment"` // Comment set by the governance.
			APYTypeOverride       string         `json:"apyTypeOverride"` // Override for the APY type.
			APYOverride           float64        `json:"apyOverride"` // Override for the APY.
			PerformanceFee        uint64         `json:"performanceFee"` // Performance fee.
			ManagementFee         uint64         `json:"managementFee"` // Management fee.
			DepositsDisabled      bool           `json:"depositsDisabled"` // Indicates if deposits are disabled.
			WithdrawalsDisabled   bool           `json:"withdrawalsDisabled"` // Indicates if withdrawals are disabled.
			AllowZapIn            bool           `json:"allowZapIn"` // Indicates if zap-in is allowed.
			AllowZapOut           bool           `json:"allowZapOut"` // Indicates if zap-out is allowed.
			Retired               bool           `json:"retired"` // Indicates if the vault is retired.
		} `json:"Dropdown"`
		
		//Migration helps us to know if a vault is in the process of being migrated.
		Migration struct {
			Available             bool           `json:"available"` // Indicates if the vault has an available migration.
			Address               string         `json:"address"` //Address of the new version of this vault.
		} `json:"migration"`
	}[]
Invalid request
  • 400 - invalid chainID: The provided chainID is not supported.
  • 500 - impossible to fetch subgraph: yDaemon was unable to connect to the subgraph.
  • 500 - invalid graphQL response: yDaemon was unable to parse the response from the subgraph.

GET
:chainID/vaults/:address

Get One Vault

Get One Vault: REST API endpoint to get one specific vault for a given chainID.

You can check getSupportedChains to get a list of supported chains.

When performing a GET request to this endpoint, a GraphQL query is executed to retrieve the basic information about this specific vault from the official Yearn's subgraph.

If the address is invalid or the vault does not exist, the 400 error code is returned.

Request

Params
  • chainID: The chainID of the chain you want to get the Vaults for. Must be provided in the URL, and must be one of the supported chains.
  • address: The address of the vault you want to get the information for.
Query arguments
  • strategiesCondition: This property is used to defined which strategies should be returned. We are looking for the "active" strategies but multiple definitions of "active" exist. The possible arguments are:

    • debtLimit: The strategy is active if the debtLimit is greater than 0.
    • inQueue: The strategy is active if it is in the vault's withdrawalQueue.
    • absolute: The strategy is active if the debtLimit is greater than 0 and if it is in the vault's withdrawalQueue and if the totalDebt is greater than 0.
    ?strategiesCondition=debtLimit # default
  • strategiesDetails: The Dropdown of the strategies are not returned by default, but you can change this by setting this argument to `withDetails` to get the Dropdown of the strategies.

    ?strategiesDetails=none # default
  • strategiesRisk: The risk of the strategies are not returned by default, but you can change this by setting this argument to `withRisk` to get the risk of the strategies.

    ?strategiesRisk=none # default

Response

Valid request
type TVault struct {
	Address               string             `json:"address"` // Address of the vault on the chain.
	Symbol                string             `json:"symbol"` // Symbol representing the vault.
	DisplaySymbol         string             `json:"display_symbol"` // Human set alias for the symbol.
	FormatedSymbol        string             `json:"formated_symbol"` // Following format: `yv{underlyingTokenSymbol}`
	Name                  string             `json:"name"` // Name of the vault.
	DisplayName           string             `json:"display_name"` // Human set alias for the name of the vault.
	FormatedName          string             `json:"formated_name"` // Following format: `{underlyingTokenName} yVault`.
	Icon                  string             `json:"icon"` // URI of the 128x128 png icon of the vault.
	Version               string             `json:"version"` // Version of the vault.
	Type                  string             `json:"type"` // Type of the vault (only V2 for now).
	Inception             uint64             `json:"inception"` // Date when the vault was created.
	Decimals              uint64             `json:"decimals"` // Number of decimals of the vault token.
	Updated               uint64             `json:"updated"` //When the vault was last updated.
	Endorsed              bool               `json:"endorsed"` //Indicates if the vault is endorsed by Yearn or not
	Emergency_shutdown    bool               `json:"emergency_shutdown"` //Indicates if the vault is currently in emergency shutdown mode.

	//Token contains the relevant information about the underlying token.
	Token struct {
		Address           string             `json:"address"` // Address of the underlying token.
		Name              string             `json:"name"` // Name of the underlying token.
		DisplayName       string             `json:"display_name"` // Human set alias for the name of the underlying token.
		Symbol            string             `json:"symbol"` // Symbol of the underlying token.
		Description       string             `json:"description"` // Meta-description for this token, based on Yearn-Meta.
		Decimals          uint64             `json:"decimals"` // Number of decimals of the underlying token.
		Icon              string             `json:"icon"` // URI of the 128x128 png icon of the underlying token.
	} `json:"token"`

	//TVL holds the info about the value locked in a vault
	TVL struct {
		TotalAssets          *bigNumber.Int `json:"total_assets"` // Total amount of assets in the vault
		TotalDelegatedAssets *bigNumber.Int `json:"total_delegated_assets"` // Total amount of assets delegated to the strategies
		TVLDeposited         float64        `json:"tvl_deposited"` // Total value locked in the vault
		TVLDelegated         float64        `json:"tvl_delegated"` // Total value delegated to other vaults
		TVL                  float64        `json:"tvl"` // Total value locked minus the delegated value
		Price                float64        `json:"price"` // Price of the underlying token
	} `json:"tvl"`

	//APY contains all the information useful about the APY, APR, fees and breakdown.
	APY struct {
		Type              string            `json:"type"`
		GrossAPR          float64           `json:"gross_apr"`
		NetAPY            float64           `json:"net_apy"`
		Fees struct {
			Performance   float64           `json:"performance"`
			Withdrawal    float64           `json:"withdrawal"`
			Management    float64           `json:"management"`
			KeepCRV       float64           `json:"keep_crv"`
			CvxKeepCRV    float64           `json:"cvx_keep_crv"`
		}                                   `json:"fees"`
		Points struct {
			WeekAgo       float64           `json:"week_ago"`
			MonthAgo      float64           `json:"month_ago"`
			Inception     float64           `json:"inception"`
		}                                   `json:"points"`
		Composite struct {
			Boost         float64            `json:"boost"`
			PoolAPY       float64            `json:"pool_apy"`
			BoostedAPR    float64            `json:"boosted_apr"`
			BaseAPR       float64            `json:"base_apr"`
			CvxAPR        float64            `json:"cvx_apr"`
			RewardsAPR    float64            `json:"rewards_apr"`
		}                                    `json:"composite"`
	} `json:"apy"`

	//Strategies contains all the information useful about the strategies currently active in this vault.
	Strategies []struct {
		Address             string           `json:"address"` // Address of the strategy.
		Name                string           `json:"name"` // Name of the strategy.
		Description         string           `json:"description"` // Meta-description for this strategy, based on Yearn-Meta.
		Details struct {
			Version         string           `json:"version"`
			Keeper          string           `json:"keeper"`
			Strategist      string           `json:"strategist"`
			Rewards         string           `json:"rewards"`
			HealthCheck     string           `json:"healthCheck"`
			TotalDebt       string           `json:"totalDebt"`
			TotalLoss       string           `json:"totalLoss"`
			TotalGain       string           `json:"totalGain"`
			LastReport      string           `json:"lastReport"`
			APR             float64          `json:"apr"`
			DebtLimit       uint64           `json:"debtLimit"`
			DoHealthCheck   bool             `json:"doHealthCheck"`
			InQueue         bool             `json:"inQueue"`
			EmergencyExit   bool             `json:"emergencyExit"`
		}                                    `json:"Dropdown"`
	} `json:"strategies"`

	//Details holds some extra information about the vault.
	Details struct {
		Management            common.Address `json:"management"` // Address of the management contract.
		Governance            common.Address `json:"governance"` // Address of the governance contract.
		Guardian              common.Address `json:"guardian"` // Address of the guardian contract.
		Rewards               common.Address `json:"rewards"` // Address of the rewards contract.
		DepositLimit          *bigNumber.Int `json:"depositLimit"` // Maximum amount of underlying tokens that can be deposited in the vault.
		AvailableDepositLimit *bigNumber.Int `json:"availableDepositLimit,omitempty"` // Maximum amount of underlying tokens that can be currently deposited in the vault.
		Comment               string         `json:"comment"` // Comment set by the governance.
		APYTypeOverride       string         `json:"apyTypeOverride"` // Override for the APY type.
		APYOverride           float64        `json:"apyOverride"` // Override for the APY.
		PerformanceFee        uint64         `json:"performanceFee"` // Performance fee.
		ManagementFee         uint64         `json:"managementFee"` // Management fee.
		DepositsDisabled      bool           `json:"depositsDisabled"` // Indicates if deposits are disabled.
		WithdrawalsDisabled   bool           `json:"withdrawalsDisabled"` // Indicates if withdrawals are disabled.
		AllowZapIn            bool           `json:"allowZapIn"` // Indicates if zap-in is allowed.
		AllowZapOut           bool           `json:"allowZapOut"` // Indicates if zap-out is allowed.
		Retired               bool           `json:"retired"` // Indicates if the vault is retired.
	} `json:"Dropdown"`
	
	//Migration helps us to know if a vault is in the process of being migrated.
	Migration struct {
		Available             bool           `json:"available"` // Indicates if the vault has an available migration.
		Address               string         `json:"address"` //Address of the new version of this vault.
	} `json:"migration"`
}
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.
  • 500 - impossible to fetch subgraph: yDaemon was unable to connect to the subgraph.
  • 500 - invalid graphQL response: yDaemon was unable to parse the response from the subgraph.

GET
vaults/tvl

Get TVL

Get TVL: REST API endpoint to get the Total Value Locked (TVL) of all the vaults across all the supported chains.
The returned TVL is in USD and does not include the delegated value (they are removed from accounting).

Request

Params

N/A

Query arguments

N/A

Response

Valid request
type TVL struct {
	Chains map[string]float64 `json:"chains"`
	Total  float64            `json:"total"`
}
{
	"chains": {
		"1": 343378329.0446586,
		"10": 31712.242023212246,
		"250": 29225791.020335883,
		"42161": 319507.42996021686
	},
	"total": 372955339.73697793
}
Invalid request

N/A


GET
:chainID/vaults/tvl

Get Chain TVL

Get Chain TVL: REST API endpoint to get the Total Value Locked (TVL) of all the vaults for a specific chainID.
The returned TVL is in USD and does not include the delegated value (they are removed from accounting).

Request

Params
  • chainID: The chainID of the chain you want to get the TVL for. Must be provided in the URL, and must be one of the supported chains.
Query arguments

N/A

Response

Valid request
float64
343378329.0446586
Invalid request
  • 400 - invalid chainID: The provided chainID is not supported.

GET
info/vaults/blacklisted

Get Blacklisted Vaults

Get Blacklisted Vaults: REST API endpoint to get the list of blacklisted vaults.
Blacklisted vaults are vaults that are ignored by the API.

Request

Params

N/A

Query arguments
  • chainID: The chainID of the chain you want to get the blacklisted vaults for. If provided, must be one of the supported chains. If not provided, all chains will be returned.

    ?chainID=0 # default

Response

Valid request
map[string][]common.Address
{
	"1": [
		"0x662fBF2c1E4b04342EeBA6371ec1C7420042B86F",
		"0x9C13e225AE007731caA49Fd17A41379ab1a489F4",
		"0xBF7AA989192b020a8d3e1C65a558e123834325cA",
		"0x4Fdd1B06eF986238446be0F3EA163C1b6Fe28cC1",
		"0x8a0889d47f9Aa0Fac1cC718ba34E26b867437880",
		"0x61f46C65E403429266e8b569F23f70dD75d9BeE7"
	],
	"10": [
		"0x6884bd538Db61A626Da0a05E10807BFC5Aea2b32",
		"0xDB8bBF2b0e28721F9BAc603e687E39bcF52201f8",
		"0xed5D83bB6Af23bcb05C144DC816f45A389d622a0"
	],
	"250": [
		"0x03B82e4070cA32FF63A03F2EcfC16c0165689a9d"
	],
	"42161": [
		"0x5796698A29F3626c9FE13C4d3d3dEE987c84EBB3",
		"0x976a1C749cd8153909e0B04EebE931eF8957b15b",
		"0xFa247d0D55a324ca19985577a2cDcFC383D87953"
	]
}
Invalid request

N/A


GET
:chainID/vaults/harvests/:addresses

Get All Harvests

Get All Harvests: REST API endpoint to the harvests for a list of selected vaults for a specific chainID.

Request

Params
  • chainID: The chainID of the chain you want to get the Harvests 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 vaults you want to get the information for.
Query arguments
  • orderBy: The vaults are ordered by the `timestamp` property by default, but you can change this by setting this argument to another property of the harvests. Any property of the harvests can be used, separated by a `.` if it's a nested property.

    ?orderBy=timestamp # default
  • orderDirection: The harvests are ordered in descending order by default, but you can change this by setting this argument to `asc` to get the vaults in ascending order.

    ?orderDirection=desc # default

Response

Valid request
type TVaultHarvest struct {
	VaultAddress    string  `json:"vaultAddress,omitempty"`
	StrategyAddress string  `json:"strategyAddress"`
	TxHash          string  `json:"txHash"`
	Timestamp       string  `json:"timestamp"`
	Profit          string  `json:"profit"`
	ProfitValue     float64 `json:"profitValue"`
	Loss            string  `json:"loss"`
	LossValue       float64 `json:"lossValue"`
}[]
// https://ydaemon.yearn.finance/1/vaults/harvests/0xc97232527B62eFb0D8ed38CF3EA103A6CcA4037e
[
	{
		"vaultAddress": "0xc97232527b62efb0d8ed38cf3ea103a6cca4037e",
		"strategyAddress": "0xbec29b45033fc6e98abf3dd7ad20b8255978e1f1",
		"txHash": "0xc3907925e4258489c584f304c787e4d90e6ebed585b474e9886c32ac4e7be9d0",
		"timestamp": "1666189115",
		"profit": "397421930127572576655",
		"profitValue": 342.1357705836657,
		"loss": "0",
		"lossValue": 0
	},
	{
		"vaultAddress": "0xc97232527b62efb0d8ed38cf3ea103a6cca4037e",
		"strategyAddress": "0xf81ad33a29c7a85cd9fbe4f3e96dfde50c7565ff",
		"txHash": "0x7bdde6580cc769a5ce6830e9456f2c9241ce13dcf2a1f881eab8df394da66e93",
		"timestamp": "1666182035",
		"profit": "520978848627387975930",
		"profitValue": 448.5044390371348,
		"loss": "0",
		"lossValue": 0
	}
]
Invalid request
  • 400 - invalid chainID: The provided chainID is not supported.
  • 500 - impossible to fetch subgraph: yDaemon was unable to connect to the subgraph.
  • 500 - invalid graphQL response: yDaemon was unable to parse the response from the subgraph.