Skip to content

Commit 9746b21

Browse files
committed
fix income statement api
1 parent 1ae1341 commit 9746b21

2 files changed

Lines changed: 166 additions & 66 deletions

File tree

defillama-openapi-pro.json

Lines changed: 161 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8275,16 +8275,16 @@
82758275
"x-api-plan-only": true,
82768276
"x-api-beta": true,
82778277
"summary": "Get protocol income statement report",
8278-
"description": "Returns protocol metadata, child protocol methodology details, and aggregated financial statement data (yearly, quarterly, monthly). Each period contains line items such as Gross Protocol Revenue, Cost Of Revenue, Gross Profit, Token Holder Net Income, Incentives, and Earnings, with values and optional label breakdowns.",
8278+
"description": "Returns protocol metadata, methodology details, and aggregated financial statement data (yearly, quarterly, monthly). Each period contains line items such as Gross Protocol Revenue, Cost Of Revenue, Gross Profit, Token Holder Net Income, Incentives, and Earnings, with values and optional label breakdowns.\n\nWhen querying a parent protocol (e.g. `aave`), the response includes a `childProtocols` array with per-version methodology. When querying a child protocol (e.g. `aave-v3`), methodology and breakdownMethodology are at the top level.",
82798279
"parameters": [
82808280
{
82818281
"name": "protocol",
82828282
"in": "path",
82838283
"required": true,
8284-
"description": "protocol slug (e.g. aave, hyperliquid)",
8284+
"description": "protocol slug (e.g. aave-v3, hyperliquid)",
82858285
"schema": {
82868286
"type": "string",
8287-
"example": "aave"
8287+
"example": "aave-v3"
82888288
}
82898289
}
82908290
],
@@ -8298,115 +8298,205 @@
82988298
"properties": {
82998299
"id": {
83008300
"type": "string",
8301-
"example": "parent#aave"
8301+
"description": "Protocol ID. Parent protocols use 'parent#slug' format.",
8302+
"example": "1599"
83028303
},
83038304
"name": {
83048305
"type": "string",
8305-
"example": "Aave"
8306+
"example": "Aave V3"
8307+
},
8308+
"address": {
8309+
"type": "string",
8310+
"nullable": true,
8311+
"example": "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"
8312+
},
8313+
"symbol": {
8314+
"type": "string",
8315+
"nullable": true,
8316+
"example": "AAVE"
83068317
},
83078318
"url": {
83088319
"type": "string",
83098320
"example": "https://aave.com"
83108321
},
83118322
"description": {
8312-
"type": "string"
8323+
"type": "string",
8324+
"example": "Earn interest, borrow assets, and build applications"
8325+
},
8326+
"chain": {
8327+
"type": "string",
8328+
"nullable": true,
8329+
"description": "Primary chain (present for child protocols)",
8330+
"example": "Optimism"
83138331
},
83148332
"logo": {
83158333
"type": "string",
8316-
"example": "https://icons.llama.fi/aave.png"
8334+
"example": "https://icons.llamao.fi/icons/protocols/aave-v3.png"
8335+
},
8336+
"audits": {
8337+
"type": "string",
8338+
"nullable": true,
8339+
"example": "2"
8340+
},
8341+
"audit_links": {
8342+
"type": "array",
8343+
"nullable": true,
8344+
"items": { "type": "string" },
8345+
"example": ["https://aave.com/security"]
8346+
},
8347+
"category": {
8348+
"type": "string",
8349+
"nullable": true,
8350+
"description": "Protocol category (present for child protocols)",
8351+
"example": "Lending"
83178352
},
83188353
"chains": {
83198354
"type": "array",
8355+
"items": { "type": "string" },
8356+
"example": ["Polygon", "Arbitrum", "Avalanche", "OP Mainnet", "Ethereum", "Base"]
8357+
},
8358+
"oraclesBreakdown": {
8359+
"type": "array",
8360+
"nullable": true,
8361+
"description": "Oracles used by the protocol",
83208362
"items": {
8321-
"type": "string"
8322-
},
8323-
"example": ["Ethereum", "Polygon", "Avalanche"]
8363+
"type": "object",
8364+
"properties": {
8365+
"name": { "type": "string", "example": "Chainlink" },
8366+
"type": { "type": "string", "example": "Primary" },
8367+
"proof": { "type": "array", "items": { "type": "string" } }
8368+
}
8369+
}
83248370
},
8325-
"gecko_id": {
8371+
"module": {
83268372
"type": "string",
83278373
"nullable": true,
8328-
"example": "aave"
8374+
"example": "aave-v3"
83298375
},
8330-
"cmcId": {
8376+
"twitter": {
83318377
"type": "string",
83328378
"nullable": true,
8333-
"example": "7278"
8379+
"example": "aave"
83348380
},
8335-
"symbol": {
8381+
"github": {
8382+
"type": "array",
8383+
"nullable": true,
8384+
"items": { "type": "string" }
8385+
},
8386+
"listedAt": {
8387+
"type": "integer",
8388+
"nullable": true,
8389+
"description": "Unix timestamp when protocol was listed",
8390+
"example": 1648776877
8391+
},
8392+
"parentProtocol": {
83368393
"type": "string",
83378394
"nullable": true,
8338-
"example": "AAVE"
8395+
"description": "Parent protocol ID (present for child protocols)",
8396+
"example": "parent#aave"
83398397
},
8340-
"address": {
8398+
"dimensions": {
8399+
"type": "object",
8400+
"nullable": true,
8401+
"description": "Available dimension adapters for this protocol",
8402+
"additionalProperties": {
8403+
"type": "object",
8404+
"properties": {
8405+
"adapter": { "type": "string" },
8406+
"genuineSpikes": { "type": "array" }
8407+
}
8408+
},
8409+
"example": {
8410+
"fees": { "genuineSpikes": [["2024-08-05", "-"]], "adapter": "aave-v3" }
8411+
}
8412+
},
8413+
"methodology": {
8414+
"type": "object",
8415+
"nullable": true,
8416+
"description": "Maps line item names to descriptions. Present at top level for child protocols, inside childProtocols for parent protocols.",
8417+
"additionalProperties": { "type": "string" },
8418+
"example": {
8419+
"Gross Protocol Revenue": "Include borrow interest, flashloan fee, liquidation fee, penalty paid by borrowers and swap fees from Paraswap.",
8420+
"Cost Of Revenue": "Amount of fees distributed to suppliers.",
8421+
"Gross Profit": "Amount of fees go to Aave treasury.",
8422+
"Token Holder Net Income": "Aave starts buy back AAVE tokens using Aave Treasury after 9th April 2025."
8423+
}
8424+
},
8425+
"breakdownMethodology": {
8426+
"type": "object",
8427+
"nullable": true,
8428+
"description": "Maps line item names to objects mapping label names to descriptions. Present at top level for child protocols, inside childProtocols for parent protocols.",
8429+
"additionalProperties": {
8430+
"type": "object",
8431+
"additionalProperties": { "type": "string" }
8432+
},
8433+
"example": {
8434+
"Gross Protocol Revenue": {
8435+
"Borrow Interest": "All interest paid by borrowers from all markets (excluding GHO).",
8436+
"Borrow Interest GHO": "All interest paid by borrowers from GHO only.",
8437+
"Liquidation Fees": "Fees from liquidation penalty and bonuses.",
8438+
"Flashloan Fees": "Flashloan fees paid by flashloan borrowers and executors.",
8439+
"Paraswap Partner Fees": "Swap fees share from Paraswap from users by using Aave frontend."
8440+
},
8441+
"Cost Of Revenue": {
8442+
"Borrow Interest": "Amount of interest distributed to lenders from all markets (excluding GHO).",
8443+
"Liquidation Fees": "Fees from liquidation penalty and bonuses are distributed to lenders."
8444+
},
8445+
"Gross Profit": {
8446+
"Borrow Interest": "A portion of interest paid by borrowers from all markets (excluding GHO).",
8447+
"Borrow Interest GHO": "All 100% interest paid by GHO borrowers.",
8448+
"Liquidation Fees": "A portion of fees from liquidation penalty and bonuses."
8449+
},
8450+
"Token Holder Net Income": {
8451+
"Token Buy Back": "Aave starts buy back AAVE tokens using Aave Treasury after 9th April 2025."
8452+
}
8453+
}
8454+
},
8455+
"methodologyURL": {
83418456
"type": "string",
8342-
"nullable": true
8457+
"nullable": true,
8458+
"example": "https://github.com/DefiLlama/dimension-adapters/blob/master/fees/aave-v3.ts"
83438459
},
8344-
"twitter": {
8460+
"tvlCodePath": {
83458461
"type": "string",
8346-
"nullable": true
8462+
"nullable": true,
8463+
"example": "https://github.com/DefiLlama/DefiLlama-Adapters/blob/main/projects/aave-v3/index.js"
83478464
},
8348-
"github": {
8465+
"hallmarks": {
83498466
"type": "array",
83508467
"nullable": true,
8468+
"description": "Notable events as [timestamp, description] pairs",
83518469
"items": {
8352-
"type": "string"
8353-
}
8470+
"type": "array",
8471+
"items": {}
8472+
},
8473+
"example": [[1650412800, "Start AVAX Rewards"], [1659571200, "Start OP Rewards"]]
83548474
},
83558475
"linkedProtocols": {
83568476
"type": "array",
8357-
"items": {
8358-
"type": "string"
8359-
},
8477+
"items": { "type": "string" },
83608478
"example": ["Aave", "Aave V2", "Aave V3"]
83618479
},
83628480
"childProtocols": {
83638481
"type": "array",
8364-
"description": "Child protocol versions with their methodology details",
8482+
"nullable": true,
8483+
"description": "Child protocol versions with their methodology details. Only present for parent protocols.",
83658484
"items": {
83668485
"type": "object",
83678486
"properties": {
8368-
"name": {
8369-
"type": "string",
8370-
"example": "Aave V3"
8371-
},
8372-
"defillamaId": {
8373-
"type": "string",
8374-
"example": "1599"
8375-
},
8376-
"displayName": {
8377-
"type": "string"
8378-
},
8379-
"methodologyURL": {
8380-
"type": "string",
8381-
"nullable": true
8382-
},
8487+
"name": { "type": "string", "example": "Aave V3" },
8488+
"defillamaId": { "type": "string", "example": "1599" },
8489+
"displayName": { "type": "string" },
8490+
"methodologyURL": { "type": "string", "nullable": true },
83838491
"methodology": {
83848492
"type": "object",
8385-
"description": "Maps line item names to descriptions of what they measure",
8386-
"additionalProperties": {
8387-
"type": "string"
8388-
},
8389-
"example": {
8390-
"Gross Protocol Revenue": "Include borrow interest, flashloan fee, liquidation fee and penalty paid by borrowers.",
8391-
"Cost Of Revenue": "Amount of fees distributed to suppliers.",
8392-
"Gross Profit": "Amount of fees go to Aave treasury."
8393-
}
8493+
"additionalProperties": { "type": "string" }
83948494
},
83958495
"breakdownMethodology": {
83968496
"type": "object",
8397-
"description": "Maps line item names to objects mapping label names to descriptions",
83988497
"additionalProperties": {
83998498
"type": "object",
8400-
"additionalProperties": {
8401-
"type": "string"
8402-
}
8403-
},
8404-
"example": {
8405-
"Gross Protocol Revenue": {
8406-
"Borrow Interest": "All interest paid by borrowers from all markets.",
8407-
"Liquidation Fees": "Fees from liquidation penalty and bonuses.",
8408-
"Flashloan Fees": "Flashloan fees paid by borrowers."
8409-
}
8499+
"additionalProperties": { "type": "string" }
84108500
}
84118501
}
84128502
}
@@ -8416,9 +8506,17 @@
84168506
"type": "boolean",
84178507
"example": true
84188508
},
8509+
"defillamaId": {
8510+
"type": "string",
8511+
"example": "1599"
8512+
},
8513+
"displayName": {
8514+
"type": "string",
8515+
"example": "Aave V3"
8516+
},
84198517
"slug": {
84208518
"type": "string",
8421-
"example": "aave"
8519+
"example": "aave-v3"
84228520
},
84238521
"protocolType": {
84248522
"type": "string",

llms-pro.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,9 @@ Returns: array of [timestamp, {Protocol1: value, Protocol2: value, ...}]
658658

659659
### GET /api/v2/metrics/financial-statement/protocol/{protocol}
660660
**Base URL:** `https://pro-api.llama.fi`
661-
Get protocol income statement report. Returns protocol metadata, child protocol methodology details, and aggregated financial data (yearly, quarterly, monthly).
661+
Get protocol income statement report. Returns protocol metadata, methodology details, and aggregated financial data (yearly, quarterly, monthly).
662+
663+
When querying a **parent protocol** (e.g. `aave`), the response includes `childProtocols` with per-version methodology. When querying a **child protocol** (e.g. `aave-v3`), `methodology` and `breakdownMethodology` are at the top level.
662664

663665
Each time period contains line items such as:
664666
- **Gross Protocol Revenue** — total fees collected (with label breakdown e.g. Borrow Interest, Liquidation Fees, Flashloan Fees)
@@ -671,5 +673,5 @@ Each time period contains line items such as:
671673
Each line item has a `value` (total USD) and optional `by-label` object breaking down by revenue source.
672674

673675
**Parameters:**
674-
- `protocol` (path, string, required) — protocol slug Example: `aave`
675-
Returns: {id, name, url, description, logo, chains, gecko_id, cmcId, symbol, address, twitter, github, linkedProtocols, childProtocols, hasLabelBreakdown, slug, protocolType, aggregates: {yearly: {period: {LineItem: {value, by-label?}}}, quarterly: {...}, monthly: {...}}}
676+
- `protocol` (path, string, required) — protocol slug Example: `aave-v3`
677+
Returns: {id, name, address, symbol, url, description, chain?, logo, audits?, audit_links?, category?, chains, oraclesBreakdown?, module?, twitter, github?, listedAt?, parentProtocol?, dimensions?, methodology?, breakdownMethodology?, methodologyURL?, tvlCodePath?, hallmarks?, linkedProtocols, childProtocols?, hasLabelBreakdown, defillamaId, displayName, slug, protocolType, aggregates: {yearly: {period: {LineItem: {value, by-label?}}}, quarterly: {...}, monthly: {...}}}

0 commit comments

Comments
 (0)