diff --git a/src/docs/resolvedSpec.json b/src/docs/resolvedSpec.json index 0adf19022..4959c0ed1 100644 --- a/src/docs/resolvedSpec.json +++ b/src/docs/resolvedSpec.json @@ -1,1481 +1,1561 @@ { - "openapi": "3.0.0", - "info": { - "description": "Docs for defillama's open API\n\nNeed higher rate limits or priority support? We offer a premium plan for 300$/mo. To get it, go to https://defillama.com/pro-api\n", - "version": "1.0.0-oas3", - "title": "DefiLlama API" - }, - "tags": [ - { - "name": "TVL", - "description": "Retrieve TVL data" - }, - { - "name": "coins", - "description": "General blockchain data used by defillama and open-sourced" - }, - { - "name": "stablecoins", - "description": "Data from our stablecoins dashboard" - }, - { - "name": "yields", - "description": "Data from our yields/APY dashboard" - }, - { - "name": "volumes", - "description": "Data from our volumes dashboards" - }, - { - "name": "fees and revenue", - "description": "Data from our fees and revenue dashboard" - } - ], - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "paths": { - "/protocols": { - "get": { - "tags": [ - "TVL" - ], - "summary": "List all protocols on defillama along with their tvl", - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/protocol/{protocol}": { - "get": { - "tags": [ - "TVL" - ], - "summary": "Get historical TVL of a protocol and breakdowns by token and chain", - "parameters": [ - { - "name": "protocol", - "in": "path", - "description": "protocol slug", - "required": true, - "schema": { - "type": "string", - "example": "aave" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/v2/historicalChainTvl": { - "get": { - "tags": [ - "TVL" - ], - "summary": "Get historical TVL (excludes liquid staking and double counted tvl) of DeFi on all chains", - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/v2/historicalChainTvl/{chain}": { - "get": { - "tags": [ - "TVL" - ], - "summary": "Get historical TVL (excludes liquid staking and double counted tvl) of a chain", - "parameters": [ - { - "name": "chain", - "in": "path", - "required": true, - "description": "chain slug, you can get these from /chains or the chains property on /protocols", - "schema": { - "type": "string", - "example": "Ethereum" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/tvl/{protocol}": { - "get": { - "tags": [ - "TVL" - ], - "summary": "Simplified endpoint to get current TVL of a protocol", - "description": "Simplified endpoint that only returns a number, the current TVL of a protocol", - "parameters": [ - { - "name": "protocol", - "in": "path", - "required": true, - "description": "protocol slug", - "schema": { - "type": "string", - "example": "uniswap" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/v2/chains": { - "get": { - "tags": [ - "TVL" - ], - "summary": "Get current TVL of all chains", - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/prices/current/{coins}": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get current prices of tokens by contract address", - "description": "The goal of this API is to price as many tokens as possible, including exotic ones that never get traded, which makes them impossible to price by looking at markets.\n\nThe base of our data are prices pulled from coingecko, which is then extended through multiple means:\n- We price all bridged tokens by using the price of the token in it's original chain, so we fetch all bridged versions of USDC on arbitrum, fantom, avax... and price all them using the price for the token on Ethereum, which we know. Right now we support 10 different bridging protocols.\n- We have multiple adapters to price specialized sets of tokens by running custom code:\n - We price yearn's yToken LPs by checking how much underlying token can be withdrawn for each LP\n - Aave, compound and euler LP tokens are also priced based on their relationship against underlying tokens\n - Uniswap, curve, balancer and stargate LPs are priced using the underlying tokens in each pair\n - GMX's GLP token is priced based on the value of tokens given on withdrawal (which includes calculations based on trader's PnL)\n \n - Synthetix tokens are priced using forex prices of the coin they are pegged to\n- For tokens that we haven't been able to price in any other way, we find the pool with most liquidity for each on uniswap, curve and serum and then use the prices provided on those exchanges.\n \n Unlike all the other tokens, we can't confirm that these prices are correct, so we only ingest the ones that have sufficient liquidity and, even in that case, we attach a `confidence` value to them that is related to the depth of liquidity and which represents our confidence in the quality of each price. API consumers can choose to filter out prices with low confidence values.\n \n Our API server is fully open source and we are constantly adding more pricing adapters, extending the amount of tokens we support.\n \nTokens are queried using {chain}:{address}, where chain is an identifier such as ethereum, bsc, polygon, avax... You can also get tokens by coingecko id by setting `coingecko` as the chain, eg: coingecko:ethereum, coingecko:bitcoin. Examples:\n - ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1\n - bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878\n - coingecko:ethereum\n - arbitrum:0x4277f8f2c384827b5273592ff7cebd9f2c1ac258\n", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "coins", - "in": "path", - "required": true, - "description": "set of comma-separated tokens defined as {chain}:{address}", - "schema": { - "type": "string", - "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" - } - }, - { - "name": "searchWidth", - "in": "query", - "required": false, - "description": "time range on either side to find price data, defaults to 6 hours", - "schema": { - "type": "string", - "example": "4h" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "coins": { - "type": "object", - "properties": { - "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { - "type": "object", - "properties": { - "decimals": { - "type": "number", - "example": 8 - }, - "price": { - "type": "number", - "example": 0.022053735051098835 - }, - "symbol": { - "type": "string", - "example": "cDAI" - }, - "timestamp": { - "type": "number", - "example": 0.99 - } - } - } - } - } - } - } - } - } - }, - "502": { - "description": "Internal error" - } - } - } - }, - "/prices/historical/{timestamp}/{coins}": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get historical prices of tokens by contract address", - "description": "See /prices/current for explanation on how prices are sourced.", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "coins", - "in": "path", - "required": true, - "description": "set of comma-separated tokens defined as {chain}:{address}", - "schema": { - "type": "string", - "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" - } - }, - { - "name": "timestamp", - "in": "path", - "required": true, - "description": "UNIX timestamp of time when you want historical prices", - "schema": { - "type": "number", - "example": 1648680149 - } - }, - { - "name": "searchWidth", - "in": "query", - "required": false, - "description": "time range on either side to find price data, defaults to 6 hours", - "schema": { - "type": "string", - "example": "4h" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "coins": { - "type": "object", - "properties": { - "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { - "type": "object", - "properties": { - "decimals": { - "type": "number", - "example": 8 - }, - "price": { - "type": "number", - "example": 0.022053735051098835 - }, - "symbol": { - "type": "string", - "example": "cDAI" - }, - "timestamp": { - "type": "number", - "example": 1648680149 - } - } - } - } - } - } - } - } - } - }, - "502": { - "description": "Internal error" - } - } - } - }, - "/batchHistorical": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get historical prices for multiple tokens at multiple different timestamps", - "description": "Strings accepted by period and searchWidth:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "coins", - "in": "query", - "required": true, - "description": "object where keys are coins in the form {chain}:{address}, and values are arrays of requested timestamps", - "schema": { - "type": "string", - "example": "{\"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\": [1666876743, 1666862343], \"coingecko:ethereum\": [1666869543, 1666862343]}\n" - } - }, - { - "name": "searchWidth", - "in": "query", - "required": false, - "description": "time range on either side to find price data, defaults to 6 hours", - "schema": { - "type": "string", - "example": 600 - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "coins": { - "type": "object", - "properties": { - "avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e": { - "type": "object", - "properties": { - "symbol": { - "type": "string", - "example": "USDC" - }, - "prices": { - "type": "array", - "items": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "example": 1666876674 - }, - "price": { - "type": "number", - "example": 0.999436 - }, - "confidence": { - "type": "number", - "example": 0.99 - } - } - } - } - } - } - } - } - } - } - } - } - }, - "502": { - "description": "Internal error" - } - } - } - }, - "/chart/{coins}": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get token prices at regular time intervals", - "description": "Strings accepted by period and searchWidth:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "coins", - "in": "path", - "required": true, - "description": "set of comma-separated tokens defined as {chain}:{address}", - "schema": { - "type": "string", - "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" - } - }, - { - "name": "start", - "in": "query", - "required": false, - "description": "unix timestamp of earliest data point requested", - "schema": { - "type": "number", - "example": 1664364537 - } - }, - { - "name": "end", - "in": "query", - "required": false, - "description": "unix timestamp of latest data point requested", - "schema": { - "type": "number", - "example": null - } - }, - { - "name": "span", - "in": "query", - "required": false, - "description": "number of data points returned, defaults to 0", - "schema": { - "type": "number", - "example": 10 - } - }, - { - "name": "period", - "in": "query", - "required": false, - "description": "duration between data points, defaults to 24 hours", - "schema": { - "type": "string", - "example": "2d" - } - }, - { - "name": "searchWidth", - "in": "query", - "required": false, - "description": "time range on either side to find price data, defaults to 10% of period", - "schema": { - "type": "string", - "example": 600 - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "coins": { - "type": "object", - "properties": { - "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { - "type": "object", - "properties": { - "decimals": { - "type": "number", - "example": 8 - }, - "confidence": { - "type": "number", - "example": 0.99 - }, - "prices": { - "type": "array", - "items": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "example": 1666790570 - }, - "price": { - "type": "number", - "example": 0.984519 - } - } - } - }, - "symbol": { - "type": "string", - "example": "HUSD" - } - } - } - } - } - } - } - } - } - }, - "502": { - "description": "Internal error" - } - } - } - }, - "/percentage/{coins}": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get percentage change in price over time", - "description": "Strings accepted by period:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "coins", - "in": "path", - "required": true, - "description": "set of comma-separated tokens defined as {chain}:{address}", - "schema": { - "type": "string", - "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" - } - }, - { - "name": "timestamp", - "in": "query", - "required": false, - "description": "timestamp of data point requested, defaults to time now", - "schema": { - "type": "number", - "example": 1664364537 - } - }, - { - "name": "lookForward", - "in": "query", - "required": false, - "description": "whether you want the duration after your given timestamp or not, defaults to false (looking back)", - "schema": { - "type": "boolean", - "example": false - } - }, - { - "name": "period", - "in": "query", - "required": false, - "description": "duration between data points, defaults to 24 hours", - "schema": { - "type": "string", - "example": "3w" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "coins": { - "type": "object", - "properties": { - "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { - "type": "number", - "example": -2.3009954568977147 - } - } - } - } - } - } - } - }, - "502": { - "description": "Internal error" - } - } - } - }, - "/prices/first/{coins}": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get earliest timestamp price record for coins", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "coins", - "in": "path", - "required": true, - "description": "set of comma-separated tokens defined as {chain}:{address}", - "schema": { - "type": "string", - "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "coins": { - "type": "object", - "properties": { - "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { - "type": "object", - "properties": { - "price": { - "type": "number", - "example": 0.9992047673109988 - }, - "symbol": { - "type": "string", - "example": "HUSD" - }, - "timestamp": { - "type": "number", - "example": 1568883821 - } - } - } - } - } - } - } - } - } - }, - "502": { - "description": "Internal error" - } - } - } - }, - "/block/{chain}/{timestamp}": { - "get": { - "tags": [ - "coins" - ], - "summary": "Get the closest block to a timestamp", - "description": "Runs binary search over a blockchain's blocks to get the closest one to a timestamp.\nEvery time this is run we add new data to our database, so each query permanently speeds up future queries.\n", - "servers": [ - { - "url": "https://coins.llama.fi" - } - ], - "parameters": [ - { - "name": "chain", - "in": "path", - "description": "Chain which you want to get the block from", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "timestamp", - "in": "path", - "description": "UNIX timestamp of the block you are searching for", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "successful operation", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "height": { - "type": "integer", - "format": "uint", - "example": 11150916 - }, - "timestamp": { - "type": "integer", - "format": "uint", - "example": 1603964988 - } - } - } - } - } - }, - "400": { - "description": "Invalid chain or timestamp provided" - } - } - } - }, - "/stablecoins": { - "get": { - "tags": [ - "stablecoins" - ], - "summary": "List all stablecoins along with their circulating amounts", - "servers": [ - { - "url": "https://stablecoins.llama.fi" - } - ], - "parameters": [ - { - "name": "includePrices", - "in": "query", - "required": false, - "description": "set whether to include current stablecoin prices", - "schema": { - "type": "boolean", - "example": true - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/stablecoincharts/all": { - "get": { - "tags": [ - "stablecoins" - ], - "summary": "Get historical mcap sum of all stablecoins", - "servers": [ - { - "url": "https://stablecoins.llama.fi" - } - ], - "parameters": [ - { - "name": "stablecoin", - "in": "query", - "required": false, - "description": "stablecoin ID, you can get these from /stablecoins", - "schema": { - "type": "integer", - "example": 1 - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/stablecoincharts/{chain}": { - "get": { - "tags": [ - "stablecoins" - ], - "summary": "Get historical mcap sum of all stablecoins in a chain", - "servers": [ - { - "url": "https://stablecoins.llama.fi" - } - ], - "parameters": [ - { - "name": "chain", - "in": "path", - "required": true, - "description": "chain slug, you can get these from /chains or the chains property on /protocols", - "schema": { - "type": "string", - "example": "Ethereum" - } - }, - { - "name": "stablecoin", - "in": "query", - "required": false, - "description": "stablecoin ID, you can get these from /stablecoins", - "schema": { - "type": "integer", - "example": 1 - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/stablecoin/{asset}": { - "get": { - "tags": [ - "stablecoins" - ], - "summary": "Get historical mcap and historical chain distribution of a stablecoin", - "servers": [ - { - "url": "https://stablecoins.llama.fi" - } - ], - "parameters": [ - { - "name": "asset", - "in": "path", - "required": true, - "description": "stablecoin ID, you can get these from /stablecoins", - "schema": { - "type": "integer", - "example": 1 - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/stablecoinchains": { - "get": { - "tags": [ - "stablecoins" - ], - "summary": "Get current mcap sum of all stablecoins on each chain", - "servers": [ - { - "url": "https://stablecoins.llama.fi" - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/stablecoinprices": { - "get": { - "tags": [ - "stablecoins" - ], - "summary": "Get historical prices of all stablecoins", - "servers": [ - { - "url": "https://stablecoins.llama.fi" - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/pools": { - "get": { - "tags": [ - "yields" - ], - "summary": "Retrieve the latest data for all pools, including enriched information such as predictions", - "servers": [ - { - "url": "https://yields.llama.fi" - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/chart/{pool}": { - "get": { - "tags": [ - "yields" - ], - "summary": "Get historical APY and TVL of a pool", - "servers": [ - { - "url": "https://yields.llama.fi" - } - ], - "parameters": [ - { - "name": "pool", - "in": "path", - "required": true, - "description": "pool id, can be retrieved from /pools (property is called pool)", - "schema": { - "type": "string", - "example": "747c1d2a-c668-4682-b9f9-296708a3dd90" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/overview/dexs": { - "get": { - "tags": [ - "volumes" - ], - "summary": "List all dexs along with summaries of their volumes and dataType history data", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyVolume by default.", - "schema": { - "type": "string", - "enum": [ - "dailyVolume", - "totalVolume" - ], - "example": "dailyVolume" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/overview/dexs/{chain}": { - "get": { - "tags": [ - "volumes" - ], - "summary": "List all dexs along with summaries of their volumes and dataType history data filtering by chain", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "chain", - "in": "path", - "required": true, - "description": "chain name, list of all supported chains can be found under allChains attribute in /overview/dexs response", - "schema": { - "type": "string", - "example": "ethereum" - } - }, - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyVolume by default.", - "schema": { - "type": "string", - "enum": [ - "dailyVolume", - "totalVolume" - ], - "example": "dailyVolume" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/summary/dexs/{protocol}": { - "get": { - "tags": [ - "volumes" - ], - "summary": "Get summary of dex volume with historical data", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "protocol", - "in": "path", - "required": true, - "description": "protocol slug", - "schema": { - "type": "string", - "example": "uniswap" - } - }, - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyVolume by default.", - "schema": { - "type": "string", - "enum": [ - "dailyVolume", - "totalVolume" - ], - "example": "dailyVolume" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/overview/options": { - "get": { - "tags": [ - "volumes" - ], - "summary": "List all options dexs along with summaries of their volumes and dataType history data", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyNotionalVolume by default.", - "schema": { - "type": "string", - "enum": [ - "dailyPremiumVolume", - "dailyNotionalVolume", - "totalPremiumVolume", - "totalNotionalVolume" - ], - "example": "dailyPremiumVolume" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/overview/options/{chain}": { - "get": { - "tags": [ - "volumes" - ], - "summary": "List all options dexs along with summaries of their volumes and dataType history data filtering by chain", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "chain", - "in": "path", - "required": true, - "description": "chain name, list of all supported chains can be found under allChains attribute in /overview/options response", - "schema": { - "type": "string", - "example": "ethereum" - } - }, - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyNotionalVolume by default.", - "schema": { - "type": "string", - "enum": [ - "dailyPremiumVolume", - "dailyNotionalVolume", - "totalPremiumVolume", - "totalNotionalVolume" - ], - "example": "dailyPremiumVolume" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/summary/options/{protocol}": { - "get": { - "tags": [ - "volumes" - ], - "summary": "Get summary of options dex volume with historical data", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "protocol", - "in": "path", - "required": true, - "description": "protocol slug", - "schema": { - "type": "string", - "example": "lyra" - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyNotionalVolume by default.", - "schema": { - "type": "string", - "enum": [ - "dailyPremiumVolume", - "dailyNotionalVolume", - "totalPremiumVolume", - "totalNotionalVolume" - ], - "example": "dailyPremiumVolume" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/overview/fees": { - "get": { - "tags": [ - "fees and revenue" - ], - "summary": "List all protocols along with summaries of their fees and revenue and dataType history data", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyFees by default.", - "schema": { - "type": "string", - "enum": [ - "totalFees", - "dailyFees", - "totalRevenue", - "dailyRevenue" - ], - "example": "dailyFees" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/overview/fees/{chain}": { - "get": { - "tags": [ - "fees and revenue" - ], - "summary": "List all protocols along with summaries of their fees and revenue and dataType history data by chain", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "chain", - "in": "path", - "required": true, - "description": "chain name, list of all supported chains can be found under allChains attribute in /overview/fees response", - "schema": { - "type": "string", - "example": "ethereum" - } - }, - { - "name": "excludeTotalDataChart", - "in": "query", - "required": false, - "description": "true to exclude aggregated chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "excludeTotalDataChartBreakdown", - "in": "query", - "required": false, - "description": "true to exclude broken down chart from response", - "schema": { - "type": "boolean", - "example": true - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyFees by default.", - "schema": { - "type": "string", - "enum": [ - "totalFees", - "dailyFees", - "totalRevenue", - "dailyRevenue" - ], - "example": "dailyFees" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - }, - "/summary/fees/{protocol}": { - "get": { - "tags": [ - "fees and revenue" - ], - "summary": "Get summary of protocol fees and revenue with historical data", - "servers": [ - { - "url": "https://api.llama.fi" - } - ], - "parameters": [ - { - "name": "protocol", - "in": "path", - "required": true, - "description": "protocol slug", - "schema": { - "type": "string", - "example": "lyra" - } - }, - { - "name": "dataType", - "in": "query", - "required": false, - "description": "Desired data type, dailyFees by default.", - "schema": { - "type": "string", - "enum": [ - "totalFees", - "dailyFees", - "totalRevenue", - "dailyRevenue" - ], - "example": "dailyFees" - } - } - ], - "responses": { - "200": { - "description": "successful operation" - } - } - } - } - } -} \ No newline at end of file + "openapi": "3.0.0", + "info": { + "description": "Docs for defillama's open API\n\nNeed higher rate limits or priority support? We offer a premium plan for 300$/mo. To get it, go to https://defillama.com/pro-api\n", + "version": "1.0.0-oas3", + "title": "DefiLlama API" + }, + "tags": [ + { + "name": "TVL", + "description": "Retrieve TVL data" + }, + { + "name": "coins", + "description": "General blockchain data used by defillama and open-sourced" + }, + { + "name": "stablecoins", + "description": "Data from our stablecoins dashboard" + }, + { + "name": "yields", + "description": "Data from our yields/APY dashboard" + }, + { + "name": "volumes", + "description": "Data from our volumes dashboards" + }, + { + "name": "fees and revenue", + "description": "Data from our fees and revenue dashboard" + }, + { + "name": "derivatives", + "description": "Data from our derivatives" + } + ], + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "paths": { + "/protocols": { + "get": { + "tags": [ + "TVL" + ], + "summary": "List all protocols on defillama along with their tvl", + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/protocol/{protocol}": { + "get": { + "tags": [ + "TVL" + ], + "summary": "Get historical TVL of a protocol and breakdowns by token and chain", + "parameters": [ + { + "name": "protocol", + "in": "path", + "description": "protocol slug", + "required": true, + "schema": { + "type": "string", + "example": "aave" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/v2/historicalChainTvl": { + "get": { + "tags": [ + "TVL" + ], + "summary": "Get historical TVL (excludes liquid staking and double counted tvl) of DeFi on all chains", + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/v2/historicalChainTvl/{chain}": { + "get": { + "tags": [ + "TVL" + ], + "summary": "Get historical TVL (excludes liquid staking and double counted tvl) of a chain", + "parameters": [ + { + "name": "chain", + "in": "path", + "required": true, + "description": "chain slug, you can get these from /chains or the chains property on /protocols", + "schema": { + "type": "string", + "example": "Ethereum" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/tvl/{protocol}": { + "get": { + "tags": [ + "TVL" + ], + "summary": "Simplified endpoint to get current TVL of a protocol", + "description": "Simplified endpoint that only returns a number, the current TVL of a protocol", + "parameters": [ + { + "name": "protocol", + "in": "path", + "required": true, + "description": "protocol slug", + "schema": { + "type": "string", + "example": "uniswap" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/v2/chains": { + "get": { + "tags": [ + "TVL" + ], + "summary": "Get current TVL of all chains", + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/prices/current/{coins}": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get current prices of tokens by contract address", + "description": "The goal of this API is to price as many tokens as possible, including exotic ones that never get traded, which makes them impossible to price by looking at markets.\n\nThe base of our data are prices pulled from coingecko, which is then extended through multiple means:\n- We price all bridged tokens by using the price of the token in it's original chain, so we fetch all bridged versions of USDC on arbitrum, fantom, avax... and price all them using the price for the token on Ethereum, which we know. Right now we support 10 different bridging protocols.\n- We have multiple adapters to price specialized sets of tokens by running custom code:\n - We price yearn's yToken LPs by checking how much underlying token can be withdrawn for each LP\n - Aave, compound and euler LP tokens are also priced based on their relationship against underlying tokens\n - Uniswap, curve, balancer and stargate LPs are priced using the underlying tokens in each pair\n - GMX's GLP token is priced based on the value of tokens given on withdrawal (which includes calculations based on trader's PnL)\n \n - Synthetix tokens are priced using forex prices of the coin they are pegged to\n- For tokens that we haven't been able to price in any other way, we find the pool with most liquidity for each on uniswap, curve and serum and then use the prices provided on those exchanges.\n \n Unlike all the other tokens, we can't confirm that these prices are correct, so we only ingest the ones that have sufficient liquidity and, even in that case, we attach a `confidence` value to them that is related to the depth of liquidity and which represents our confidence in the quality of each price. API consumers can choose to filter out prices with low confidence values.\n \n Our API server is fully open source and we are constantly adding more pricing adapters, extending the amount of tokens we support.\n \nTokens are queried using {chain}:{address}, where chain is an identifier such as ethereum, bsc, polygon, avax... You can also get tokens by coingecko id by setting `coingecko` as the chain, eg: coingecko:ethereum, coingecko:bitcoin. Examples:\n - ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1\n - bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878\n - coingecko:ethereum\n - arbitrum:0x4277f8f2c384827b5273592ff7cebd9f2c1ac258\n", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "coins", + "in": "path", + "required": true, + "description": "set of comma-separated tokens defined as {chain}:{address}", + "schema": { + "type": "string", + "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" + } + }, + { + "name": "searchWidth", + "in": "query", + "required": false, + "description": "time range on either side to find price data, defaults to 6 hours", + "schema": { + "type": "string", + "example": "4h" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "coins": { + "type": "object", + "properties": { + "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { + "type": "object", + "properties": { + "decimals": { + "type": "number", + "example": 8 + }, + "price": { + "type": "number", + "example": 0.022053735051098835 + }, + "symbol": { + "type": "string", + "example": "cDAI" + }, + "timestamp": { + "type": "number", + "example": 0.99 + } + } + } + } + } + } + } + } + } + }, + "502": { + "description": "Internal error" + } + } + } + }, + "/prices/historical/{timestamp}/{coins}": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get historical prices of tokens by contract address", + "description": "See /prices/current for explanation on how prices are sourced.", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "coins", + "in": "path", + "required": true, + "description": "set of comma-separated tokens defined as {chain}:{address}", + "schema": { + "type": "string", + "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" + } + }, + { + "name": "timestamp", + "in": "path", + "required": true, + "description": "UNIX timestamp of time when you want historical prices", + "schema": { + "type": "number", + "example": 1648680149 + } + }, + { + "name": "searchWidth", + "in": "query", + "required": false, + "description": "time range on either side to find price data, defaults to 6 hours", + "schema": { + "type": "string", + "example": "4h" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "coins": { + "type": "object", + "properties": { + "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { + "type": "object", + "properties": { + "decimals": { + "type": "number", + "example": 8 + }, + "price": { + "type": "number", + "example": 0.022053735051098835 + }, + "symbol": { + "type": "string", + "example": "cDAI" + }, + "timestamp": { + "type": "number", + "example": 1648680149 + } + } + } + } + } + } + } + } + } + }, + "502": { + "description": "Internal error" + } + } + } + }, + "/batchHistorical": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get historical prices for multiple tokens at multiple different timestamps", + "description": "Strings accepted by period and searchWidth:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "coins", + "in": "query", + "required": true, + "description": "object where keys are coins in the form {chain}:{address}, and values are arrays of requested timestamps", + "schema": { + "type": "string", + "example": "{\"avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e\": [1666876743, 1666862343], \"coingecko:ethereum\": [1666869543, 1666862343]}\n" + } + }, + { + "name": "searchWidth", + "in": "query", + "required": false, + "description": "time range on either side to find price data, defaults to 6 hours", + "schema": { + "type": "string", + "example": 600 + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "coins": { + "type": "object", + "properties": { + "avax:0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e": { + "type": "object", + "properties": { + "symbol": { + "type": "string", + "example": "USDC" + }, + "prices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "example": 1666876674 + }, + "price": { + "type": "number", + "example": 0.999436 + }, + "confidence": { + "type": "number", + "example": 0.99 + } + } + } + } + } + } + } + } + } + } + } + } + }, + "502": { + "description": "Internal error" + } + } + } + }, + "/chart/{coins}": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get token prices at regular time intervals", + "description": "Strings accepted by period and searchWidth:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "coins", + "in": "path", + "required": true, + "description": "set of comma-separated tokens defined as {chain}:{address}", + "schema": { + "type": "string", + "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" + } + }, + { + "name": "start", + "in": "query", + "required": false, + "description": "unix timestamp of earliest data point requested", + "schema": { + "type": "number", + "example": 1664364537 + } + }, + { + "name": "end", + "in": "query", + "required": false, + "description": "unix timestamp of latest data point requested", + "schema": { + "type": "number", + "example": null + } + }, + { + "name": "span", + "in": "query", + "required": false, + "description": "number of data points returned, defaults to 0", + "schema": { + "type": "number", + "example": 10 + } + }, + { + "name": "period", + "in": "query", + "required": false, + "description": "duration between data points, defaults to 24 hours", + "schema": { + "type": "string", + "example": "2d" + } + }, + { + "name": "searchWidth", + "in": "query", + "required": false, + "description": "time range on either side to find price data, defaults to 10% of period", + "schema": { + "type": "string", + "example": 600 + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "coins": { + "type": "object", + "properties": { + "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { + "type": "object", + "properties": { + "decimals": { + "type": "number", + "example": 8 + }, + "confidence": { + "type": "number", + "example": 0.99 + }, + "prices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "timestamp": { + "type": "number", + "example": 1666790570 + }, + "price": { + "type": "number", + "example": 0.984519 + } + } + } + }, + "symbol": { + "type": "string", + "example": "HUSD" + } + } + } + } + } + } + } + } + } + }, + "502": { + "description": "Internal error" + } + } + } + }, + "/percentage/{coins}": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get percentage change in price over time", + "description": "Strings accepted by period:\nCan use regular chart candle notion like ‘4h’ etc where:\nW = week, D = day, H = hour, M = minute (not case sensitive)\n", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "coins", + "in": "path", + "required": true, + "description": "set of comma-separated tokens defined as {chain}:{address}", + "schema": { + "type": "string", + "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" + } + }, + { + "name": "timestamp", + "in": "query", + "required": false, + "description": "timestamp of data point requested, defaults to time now", + "schema": { + "type": "number", + "example": 1664364537 + } + }, + { + "name": "lookForward", + "in": "query", + "required": false, + "description": "whether you want the duration after your given timestamp or not, defaults to false (looking back)", + "schema": { + "type": "boolean", + "example": false + } + }, + { + "name": "period", + "in": "query", + "required": false, + "description": "duration between data points, defaults to 24 hours", + "schema": { + "type": "string", + "example": "3w" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "coins": { + "type": "object", + "properties": { + "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { + "type": "number", + "example": -2.3009954568977147 + } + } + } + } + } + } + } + }, + "502": { + "description": "Internal error" + } + } + } + }, + "/prices/first/{coins}": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get earliest timestamp price record for coins", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "coins", + "in": "path", + "required": true, + "description": "set of comma-separated tokens defined as {chain}:{address}", + "schema": { + "type": "string", + "example": "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "coins": { + "type": "object", + "properties": { + "ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1": { + "type": "object", + "properties": { + "price": { + "type": "number", + "example": 0.9992047673109988 + }, + "symbol": { + "type": "string", + "example": "HUSD" + }, + "timestamp": { + "type": "number", + "example": 1568883821 + } + } + } + } + } + } + } + } + } + }, + "502": { + "description": "Internal error" + } + } + } + }, + "/block/{chain}/{timestamp}": { + "get": { + "tags": [ + "coins" + ], + "summary": "Get the closest block to a timestamp", + "description": "Runs binary search over a blockchain's blocks to get the closest one to a timestamp.\nEvery time this is run we add new data to our database, so each query permanently speeds up future queries.\n", + "servers": [ + { + "url": "https://coins.llama.fi" + } + ], + "parameters": [ + { + "name": "chain", + "in": "path", + "description": "Chain which you want to get the block from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "timestamp", + "in": "path", + "description": "UNIX timestamp of the block you are searching for", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "height": { + "type": "integer", + "format": "uint", + "example": 11150916 + }, + "timestamp": { + "type": "integer", + "format": "uint", + "example": 1603964988 + } + } + } + } + } + }, + "400": { + "description": "Invalid chain or timestamp provided" + } + } + } + }, + "/stablecoins": { + "get": { + "tags": [ + "stablecoins" + ], + "summary": "List all stablecoins along with their circulating amounts", + "servers": [ + { + "url": "https://stablecoins.llama.fi" + } + ], + "parameters": [ + { + "name": "includePrices", + "in": "query", + "required": false, + "description": "set whether to include current stablecoin prices", + "schema": { + "type": "boolean", + "example": true + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/stablecoincharts/all": { + "get": { + "tags": [ + "stablecoins" + ], + "summary": "Get historical mcap sum of all stablecoins", + "servers": [ + { + "url": "https://stablecoins.llama.fi" + } + ], + "parameters": [ + { + "name": "stablecoin", + "in": "query", + "required": false, + "description": "stablecoin ID, you can get these from /stablecoins", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/stablecoincharts/{chain}": { + "get": { + "tags": [ + "stablecoins" + ], + "summary": "Get historical mcap sum of all stablecoins in a chain", + "servers": [ + { + "url": "https://stablecoins.llama.fi" + } + ], + "parameters": [ + { + "name": "chain", + "in": "path", + "required": true, + "description": "chain slug, you can get these from /chains or the chains property on /protocols", + "schema": { + "type": "string", + "example": "Ethereum" + } + }, + { + "name": "stablecoin", + "in": "query", + "required": false, + "description": "stablecoin ID, you can get these from /stablecoins", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/stablecoin/{asset}": { + "get": { + "tags": [ + "stablecoins" + ], + "summary": "Get historical mcap and historical chain distribution of a stablecoin", + "servers": [ + { + "url": "https://stablecoins.llama.fi" + } + ], + "parameters": [ + { + "name": "asset", + "in": "path", + "required": true, + "description": "stablecoin ID, you can get these from /stablecoins", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/stablecoinchains": { + "get": { + "tags": [ + "stablecoins" + ], + "summary": "Get current mcap sum of all stablecoins on each chain", + "servers": [ + { + "url": "https://stablecoins.llama.fi" + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/stablecoinprices": { + "get": { + "tags": [ + "stablecoins" + ], + "summary": "Get historical prices of all stablecoins", + "servers": [ + { + "url": "https://stablecoins.llama.fi" + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/pools": { + "get": { + "tags": [ + "yields" + ], + "summary": "Retrieve the latest data for all pools, including enriched information such as predictions", + "servers": [ + { + "url": "https://yields.llama.fi" + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/chart/{pool}": { + "get": { + "tags": [ + "yields" + ], + "summary": "Get historical APY and TVL of a pool", + "servers": [ + { + "url": "https://yields.llama.fi" + } + ], + "parameters": [ + { + "name": "pool", + "in": "path", + "required": true, + "description": "pool id, can be retrieved from /pools (property is called pool)", + "schema": { + "type": "string", + "example": "747c1d2a-c668-4682-b9f9-296708a3dd90" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/dexs": { + "get": { + "tags": [ + "volumes" + ], + "summary": "List all dexs along with summaries of their volumes and dataType history data", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyVolume by default.", + "schema": { + "type": "string", + "enum": [ + "dailyVolume", + "totalVolume" + ], + "example": "dailyVolume" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/dexs/{chain}": { + "get": { + "tags": [ + "volumes" + ], + "summary": "List all dexs along with summaries of their volumes and dataType history data filtering by chain", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "chain", + "in": "path", + "required": true, + "description": "chain name, list of all supported chains can be found under allChains attribute in /overview/dexs response", + "schema": { + "type": "string", + "example": "ethereum" + } + }, + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyVolume by default.", + "schema": { + "type": "string", + "enum": [ + "dailyVolume", + "totalVolume" + ], + "example": "dailyVolume" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/summary/dexs/{protocol}": { + "get": { + "tags": [ + "volumes" + ], + "summary": "Get summary of dex volume with historical data", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "protocol", + "in": "path", + "required": true, + "description": "protocol slug", + "schema": { + "type": "string", + "example": "uniswap" + } + }, + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyVolume by default.", + "schema": { + "type": "string", + "enum": [ + "dailyVolume", + "totalVolume" + ], + "example": "dailyVolume" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/options": { + "get": { + "tags": [ + "volumes" + ], + "summary": "List all options dexs along with summaries of their volumes and dataType history data", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyNotionalVolume by default.", + "schema": { + "type": "string", + "enum": [ + "dailyPremiumVolume", + "dailyNotionalVolume", + "totalPremiumVolume", + "totalNotionalVolume" + ], + "example": "dailyPremiumVolume" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/options/{chain}": { + "get": { + "tags": [ + "volumes" + ], + "summary": "List all options dexs along with summaries of their volumes and dataType history data filtering by chain", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "chain", + "in": "path", + "required": true, + "description": "chain name, list of all supported chains can be found under allChains attribute in /overview/options response", + "schema": { + "type": "string", + "example": "ethereum" + } + }, + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyNotionalVolume by default.", + "schema": { + "type": "string", + "enum": [ + "dailyPremiumVolume", + "dailyNotionalVolume", + "totalPremiumVolume", + "totalNotionalVolume" + ], + "example": "dailyPremiumVolume" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/summary/options/{protocol}": { + "get": { + "tags": [ + "volumes" + ], + "summary": "Get summary of options dex volume with historical data", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "protocol", + "in": "path", + "required": true, + "description": "protocol slug", + "schema": { + "type": "string", + "example": "lyra" + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyNotionalVolume by default.", + "schema": { + "type": "string", + "enum": [ + "dailyPremiumVolume", + "dailyNotionalVolume", + "totalPremiumVolume", + "totalNotionalVolume" + ], + "example": "dailyPremiumVolume" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/fees": { + "get": { + "tags": [ + "fees and revenue" + ], + "summary": "List all protocols along with summaries of their fees and revenue and dataType history data", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyFees by default.", + "schema": { + "type": "string", + "enum": [ + "totalFees", + "dailyFees", + "totalRevenue", + "dailyRevenue" + ], + "example": "dailyFees" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/fees/{chain}": { + "get": { + "tags": [ + "fees and revenue" + ], + "summary": "List all protocols along with summaries of their fees and revenue and dataType history data by chain", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "chain", + "in": "path", + "required": true, + "description": "chain name, list of all supported chains can be found under allChains attribute in /overview/fees response", + "schema": { + "type": "string", + "example": "ethereum" + } + }, + { + "name": "excludeTotalDataChart", + "in": "query", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "query", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean", + "example": true + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyFees by default.", + "schema": { + "type": "string", + "enum": [ + "totalFees", + "dailyFees", + "totalRevenue", + "dailyRevenue" + ], + "example": "dailyFees" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/summary/fees/{protocol}": { + "get": { + "tags": [ + "fees and revenue" + ], + "summary": "Get summary of protocol fees and revenue with historical data", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "protocol", + "in": "path", + "required": true, + "description": "protocol slug", + "schema": { + "type": "string", + "example": "lyra" + } + }, + { + "name": "dataType", + "in": "query", + "required": false, + "description": "Desired data type, dailyFees by default.", + "schema": { + "type": "string", + "enum": [ + "totalFees", + "dailyFees", + "totalRevenue", + "dailyRevenue" + ], + "example": "dailyFees" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/derivatives": { + "get": { + "tags": [ + "derivatives" + ], + "summary": "Lists all derivatives along summaries of their volumes filtering by chain", + "servers": [ + { + "url": "https://api.llama.fi" + } + ], + "parameters": [ + { + "name": "excludeTotalDataChart", + "in": "path", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "path", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + }, + "/overview/derivatives/{protocol}": { + "get": { + "tags": [ + "derivatives" + ], + "summary": "Volume Details about a specific derivative", + "servers": [ + { + "url": "https://api.llama.fi/summary/" + } + ], + "parameters": [ + { + "name": "excludeTotalDataChart", + "in": "path", + "required": false, + "description": "true to exclude aggregated chart from response", + "schema": { + "type": "boolean" + } + }, + { + "name": "excludeTotalDataChartBreakdown", + "in": "path", + "required": false, + "description": "true to exclude broken down chart from response", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "successful operation" + } + } + } + } + } +} diff --git a/src/docs/spec.yaml b/src/docs/spec.yaml index 728cba178..e80881287 100644 --- a/src/docs/spec.yaml +++ b/src/docs/spec.yaml @@ -19,6 +19,8 @@ tags: description: Data from our volumes dashboards - name: fees and revenue description: Data from our fees and revenue dashboard + - name: derivatives + description: Data from our derivatives servers: - url: https://api.llama.fi paths: @@ -951,3 +953,50 @@ paths: responses: '200': description: successful operation + + /overview/derivatives: + get: + tags: + - derivatives + summary: Lists all derivatives along summaries of their volumes filtering by chain + servers: + - url: https://api.llama.fi + parameters: + - name: excludeTotalDataChart + in: path + required: false + description: true to exclude aggregated chart from response + schema: + type: boolean + - name: excludeTotalDataChartBreakdown + in: path + required: false + description: true to exclude broken down chart from response + schema: + type: boolean + responses: + '200': + description: successful operation + /overview/derivatives/{protocol}: + get: + tags: + - derivatives + summary: Volume Details about a specific derivative + servers: + - url: https://api.llama.fi/summary/ + parameters: + - name: excludeTotalDataChart + in: path + required: false + description: true to exclude aggregated chart from response + schema: + type: boolean + - name: excludeTotalDataChartBreakdown + in: path + required: false + description: true to exclude broken down chart from response + schema: + type: boolean + responses: + '200': + description: successful operation \ No newline at end of file