DeFi
Product detail
Investment product detail for a known investmentId.
Endpoint
GET/v1/defi/products/:investmentId
Full product detail from upstream: rates, TVL, tokens (underlying / earned / LP), logos, FAQs, action flags, plus security (rating, contract, KYC/IP flags), apyDetail, infoItems (e.g. max LTV tips), and extra for any unmodeled fields. Meter defi_product_detail (2).
Request
curl -sS "https://blockchain.gray3.io/v1/defi/products/9502" \
-H "X-Gray-Project-Id: proj_your_project_id" \
-H "Authorization: Bearer gray_sk_your_secret"Response
HTTP 200 — success envelope wraps the payload in data.
json
{
"data": {
"investmentId": "9502",
"name": "USDC",
"protocolId": "10",
"protocolName": "Aave V3",
"protocolLogoUrl": "https://…",
"chainId": "ethereum",
"category": "earn",
"investKind": "save",
"apy": "0.02140",
"tvlUsd": "3423591587.48",
"isInvestable": true,
"isRedeemable": true,
"isClaimable": false,
"supportedActions": ["enter", "exit"],
"security": {
"ratingId": "1",
"ratingName": "Leading",
"contract": "0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2",
"needsIdentityVerify": false,
"protocolIpRestrict": false
},
"underlyingTokens": [
{
"symbol": "USDC",
"tokenAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"logoUrl": "https://…"
}
],
"earnedTokens": [],
"lpTokens": [],
"apyDetail": {
"title": "APY 4.08%",
"calculationDescription": "…"
},
"logos": { "network": "https://…" },
"infoItems": [],
"faqs": [],
"extra": {},
"source": "live"
}
}Errors
Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.
Every authenticated route may also return unauthorized (401), revoked_secret (401), forbidden (403), credits_exhausted (402), plan_feature_denied (403), rate_limit_exceeded (429, retryable), and invalid_argument (413) for request bodies over 256 KiB.
| Code | HTTP | When |
|---|---|---|
| unsupported_capability | 400 | Testnet chain id or feature disabled on testnets (prices, NFTs, DeFi, swap) |
| invalid_argument | 400 | Missing or malformed chainId, address, or body fields |
| plan_chain_denied | 403 | chainId is not on the project plan |
| chain_disabled | 403 | Chain turned off in Console › Networks |
| unsupported_capability | 400 | Capability not offered for this chain (e.g. testnet prices) |
| plan_feature_denied | 403 | The project plan does not include DeFi |
| credits_exhausted | 402 | Not enough Gray Credits for this meter |
| not_found | 404 | Unknown protocolId on GET /v1/defi/protocols/:protocolId |
| invalid_argument | 400 | Missing q / investmentId, bad category, or kind not one of enter / exit / claim / borrow / repay |
| defi_unavailable | 503 | The DeFi data service is temporarily unavailable (retryable) |
json
{
"error": {
"code": "unsupported_capability",
"message": "Human-readable detail (may be sanitized).",
"retryable": false
}
}