{"id":18263752,"url":"https://github.com/yearn/yearn-exporter-api","last_synced_at":"2025-04-04T20:31:16.580Z","repository":{"id":44677285,"uuid":"448142404","full_name":"yearn/yearn-exporter-api","owner":"yearn","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-31T10:11:55.000Z","size":74,"stargazers_count":3,"open_issues_count":6,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T19:07:22.592Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yearn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-15T00:17:02.000Z","updated_at":"2023-08-21T16:58:21.000Z","dependencies_parsed_at":"2023-10-31T11:23:29.535Z","dependency_job_id":null,"html_url":"https://github.com/yearn/yearn-exporter-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-exporter-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-exporter-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-exporter-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-exporter-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yearn","download_url":"https://codeload.github.com/yearn/yearn-exporter-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247246352,"owners_count":20907781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:12:30.472Z","updated_at":"2025-04-04T20:31:15.104Z","avatar_url":"https://github.com/yearn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yearn-exporter-api\nLight-weight API in front of [yearn.vision](https://yearn.vision) that makes some data available for external sites.\n\n## Usage\nStart the API with `make build \u0026\u0026 make up`. This will expose it at `http://localhost:5000`.\n\n\n## Make commands\nAll these are prefaced with `make`.\n- `build`, `up`, `down`, `destroy`, `stop`, `restart`, `ps`\n\n## Configuration\nYou can export the following environment variables if you want to override the defaults:\n- `FLASK_RUN_PORT`: the listening port for the api, default: 5000\n- `BASE_URL`: the URL pointing to the grafana instance, default: \"https://yearn.vision\"\n\n## Routes\n\n### `/tvl`\nreturns the summed TVLs grouped by network and a summed total:\n```\n$ curl localhost:5000/tvl\n{\n  \"ts\":1642600346,\n  \"tvl_eth\":5101043121.68,\n  \"tvl_ftm\":533590588.63,\n  \"tvl_total\":533590588.63,\n  \"unit\":\"USD\"\n}\n```\n\n### `/tvl/\u003cnetwork\u003e`\nreturns the tvl for the given network, e.g. for `ETH`:\n```\n$ curl localhost:5000/tvl/eth\n{\n  \"ts\":1642600393,\n  \"tvl_eth\":5101041358.88,\n  \"unit\":\"USD\"\n}\n```\nsupported networks are:\n- `eth`\n- `ftm`\n- `opt`\n- `arb`\n- `base`\n\n### `/tvl/total`\nreturns the sum of the TVLs of all networks:\n```\n$ curl localhost:5000/tvl/total\n{\n  \"ts\":1642600475,\n  \"tvl_total\":534919919.17,\n  \"unit\":\"USD\"\n}\n```\n### `/partners/{query}`\nreturns b2b fee-sharing partners' info\n\n#### `/partners/total`\nreturns the total fees to be paid out to date, measured in USD value from all chains:\n```\n$ curl localhost:5000/partners/total\n{\n  \"partners_total\": 2601705.85,\n  \"ts\": 1665017101,\n  \"unit\": \"USD\"\n}\n```\n#### `/partners/count`\nreturns the number of partners to-date from all chains:\n```\n$ curl localhost:5000/partners/count\n{\n  \"partners_count\": 22,\n  \"ts\": 1665017986,\n  \"unit\": \"\"\n}\n```\n#### `/partners/\u003cpartner\u003e/\u003cparam\u003e`\nreturns for a specific partner the parameter you specify:\n  - parameters are: allowed_params: `balance`, `payout_daily`, `payout_weekly`, `payout_monthly`, `payout_total`\n  - partners are the names of the b2b partners\n \n ```\n $ curl localhost:5000/partners/sturdy/payout_total\n  \"partners_indiv_sturdy_payout_total\": {\n    \"FTM\": {\n      \"0x0DEC85e74A92c52b7F708c4B10207D9560CEFaf0\": {\n        \"balance\": 2238.09,\n        \"bucket\": \"Other short term assets\",\n        \"token\": \"yvWFTM\",\n        \"tvl\": 1732.48\n      },\n      \"0x0fBbf9848D969776a5Eb842EdAfAf29ef4467698\": {\n        \"balance\": 15.17,\n        \"bucket\": \"Other short term assets\",\n        \"token\": \"yvBOO\",\n        \"tvl\": 123.41\n      },\n      \"0x1e2fe8074a5ce1Bb7394856B0C618E75D823B93b\": {\n        \"balance\": 1714.68,\n        \"bucket\": \"Other short term assets\",\n        \"token\": \"yvfBEETS\",\n        \"tvl\": 389.16\n      },\n      \"0xf2d323621785A066E64282d2B407eAc79cC04966\": {\n        \"balance\": 5.92,\n        \"bucket\": \"Other short term assets\",\n        \"token\": \"yvLINK\",\n        \"tvl\": 66.84\n      }\n    }\n  },\n  \"ts\": 1671244960,\n  \"unit\": \"USD\"\n}\n```\n \n\n## Optional Query Params\n- `ts`\n```\ncurl localhost:5000/tvl?ts=1642664109\n{\n  \"ts\":1642664109,\n  \"tvl_eth\":5081490281.98,\n  \"tvl_ftm\":574308185.62,\n  \"tvl_total\":5655798467.6,\n  \"unit\":\"USD\"\n}\n```\nset a ts (millis) for retrieving the data at that specific timestamp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-exporter-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyearn%2Fyearn-exporter-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-exporter-api/lists"}