getProtocolPoolDetails
This method obtains the details (APY and TVL) of a pool from a protocol on a chain.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
input | [ProtocolPoolInput!]! | Yes | List of queries with chain ID, protocol and pool. |
ProtocolPoolInput Fields
| Name | Type | Required | Description |
|---|---|---|---|
chain | Chain! | Yes | Chain ID. |
protocol | Protocol! | Yes | The protocol name. |
pool | String | Yes | The pool address or name on the protocol. |
chain
Type: Chain!
Allowed Values: A chain ID from the list of supported pools.
protocol
Type: Protocol!
Allowed Values: A protocol from the list of supported pools for the given chain.
pool
Type: String
Allowed Values: A pool from the list of supported pools for the given protocol and chain.
Response
| Field | Type | Description |
|---|---|---|
chain | Chain | The chain ID. |
protocol | Protocol | The protocol. |
pool | String | The pool. |
apy | APYResult | The current APY. |
tvl | TVLResult | The current TVL. |
error | String | Error message if query failed. |
APYResult Fields
| Name | Type | Description |
|---|---|---|
baseApy | String | The base APY. |
extraApy | String | An extra APY. |
totalApy | String | Total + extra APY. |
TVLResult Fields
| Name | Type | Description |
|---|---|---|
underlying | JSON | An object with underlying tokens and amounts in that token. |
totals | JSON | An object with totals from the underlying assets. |
Query Example
Query
query GetProtocolPoolDetails($input: [ProtocolPoolChainInput!]!) {
getProtocolPoolDetails(input: $input) {
chain
protocol
pool
apy {
baseApy
extraApy
totalApy
}
tvl {
underlying
totals
}
error
}
}Variables
{
"input": [
{ "chain": "CHAIN_0X1", "pool": "USDC", "protocol": "AAVE" },
{ "chain": "CHAIN_0XA", "pool": "USDC", "protocol": "AAVE" },
{ "chain": "CHAIN_0X2105", "pool": "USDC", "protocol": "AAVE" },
{ "chain": "CHAIN_0X1", "pool": "0xc3d688B66703497DAA19211EEdff47f25384cdc3", "protocol": "COMPOUNDV3" },
{ "chain": "CHAIN_0X38", "pool": "pancake-cow-bsc-usdc-wbnb-vault", "protocol": "BEEFY" },
{ "chain": "CHAIN_0X1", "pool": "0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204", "protocol": "YEARN" },
{ "chain": "CHAIN_HYPERLIQUID_MAINNET", "pool": "0xdfc24b077bc1425ad1dea75bcb6f8158e10df303", "protocol": "HYPERLIQUID" }
]
}Curl
curl -X POST https://your-graphql-endpoint.com/graphql \
-H "Content-Type: application/json" \
-d '{
"query": "query getProtocolPoolDetails($input: [ProtocolPoolChainInput!]!) { getProtocolPoolDetails(input: $input) { chain protocol pool apy { baseApy extraApy totalApy } tvl { underlying totals } error } }",
"variables": {
"input": [
{ "chain": "CHAIN_0X1", "pool": "USDC", "protocol": "AAVE" },
{ "chain": "CHAIN_0X1", "pool": "0xc3d688B66703497DAA19211EEdff47f25384cdc3", "protocol": "COMPOUNDV3" },
{ "chain": "CHAIN_0X1", "pool": "0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204", "protocol": "YEARN" }
]
}
}'Response Example
{
"data": {
"getProtocolPoolDetails": [
{
"chain": "CHAIN_0X1",
"protocol": "AAVE",
"pool": "USDC",
"apy": {
"baseApy": "3.8303938852289443",
"extraApy": "0",
"totalApy": "3.8303938852289443"
},
"tvl": {
"underlying": { "USDC": 1357781103.438384 },
"totals": { "USD": 1357523803.9192824 }
},
"error": null
},
{
"chain": "CHAIN_0X1",
"protocol": "COMPOUNDV3",
"pool": "0xc3d688B66703497DAA19211EEdff47f25384cdc3",
"apy": {
"baseApy": "5.21",
"extraApy": "0.21051430171037105",
"totalApy": "5.420514301710371"
},
"tvl": {
"underlying": {
"USDC": 527019612.332527,
"COMP": 99999.98947746227,
"WBTC": 5555.20800645,
"WETH": 58237.826810963634
},
"totals": { "USD": 1698509470.7874575 }
},
"error": null
},
{
"chain": "CHAIN_0X1",
"protocol": "YEARN",
"pool": "0xBe53A109B494E5c9f97b9Cd39Fe969BE68BF6204",
"apy": {
"baseApy": "6.110545906558906",
"extraApy": "0",
"totalApy": "6.110545906558906"
},
"tvl": {
"underlying": { "USDC": 23241848.993009 },
"totals": { "USD": 23235015.889405057 }
},
"error": null
}
]
}
}