{"id":27618025,"url":"https://github.com/bisonai/curve-api-historical-data","last_synced_at":"2026-03-03T20:07:33.513Z","repository":{"id":40491631,"uuid":"474561626","full_name":"Bisonai/curve-api-historical-data","owner":"Bisonai","description":"REST API server to access historical data from Curve Finance","archived":false,"fork":false,"pushed_at":"2022-05-05T03:26:34.000Z","size":640,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-23T04:59:20.759Z","etag":null,"topics":["blockchain","cryptocurrency","curve","decentralized-exchange","decentralized-finance","defi","dex","ethereum","pool","rest-api","tvl"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Bisonai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-27T07:05:53.000Z","updated_at":"2024-12-02T08:20:14.000Z","dependencies_parsed_at":"2022-08-09T22:00:47.417Z","dependency_job_id":null,"html_url":"https://github.com/Bisonai/curve-api-historical-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Bisonai/curve-api-historical-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bisonai%2Fcurve-api-historical-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bisonai%2Fcurve-api-historical-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bisonai%2Fcurve-api-historical-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bisonai%2Fcurve-api-historical-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bisonai","download_url":"https://codeload.github.com/Bisonai/curve-api-historical-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bisonai%2Fcurve-api-historical-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30057850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blockchain","cryptocurrency","curve","decentralized-exchange","decentralized-finance","defi","dex","ethereum","pool","rest-api","tvl"],"created_at":"2025-04-23T04:59:16.822Z","updated_at":"2026-03-03T20:07:33.496Z","avatar_url":"https://github.com/Bisonai.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Curve API Historical Data\n\nThis repository is an updated version of [curve-api](https://github.com/curvefi/curve-api) that enables access to the latest data from Curve Finance DEX.\nWe can additionally provide historical data by simply specifying the block number as an additional parameter.\n\n## Prerequisites\n\n* Docker\n* Docker Compose\n\n## Settings\n\nCreate `dev.env` or `prod.env` file with corresponding environment variables required by Docker Compose.\nThe list of required environment variables is included under the `environment` section.\n\n## Development setup\n\n```shell\ndocker-compose -f docker-compose.dev.yaml build\ndocker-compose -f docker-compose.dev.yaml --env-file dev.env up\n```\n\n## Production setup\n\n```shell\ndocker-compose -f docker-compose.prod.yaml build\ndocker-compose -f docker-compose.prod.yaml --env-file prod.env up -d\n```\n\n## Historical Data Endpoints\n\nThe endpoints listed below enable access to historical data.\n\n### `/api/getFactoryAPYs?block={block_number}`\n\nExample output\n```\n\"poolDetails\": [\n  {\n    \"index\": 0,\n    \"poolAddress\": \"0x9547429C0e2c3A8B88C6833B58FCE962734C0E8C\",\n    \"poolSymbol\": \"DOLA\",\n    \"apyFormatted\": \"0.12%\",\n    \"apy\": 0.11813988038860135,\n    \"apyWeekly\": 0.12632708044177932,\n    \"virtualPrice\": \"1014802666754888345\",\n    \"volume\": 0\n  },\n...\n],\n\"totalVolume\": 20572200.081073303\n```\n\n### `/api/getTVL?block={block_number}`\n\nExample output\n```\ntvl\": 12376315054.757349,\n\"usdTVL\": 6831486622.154737,\n\"ethTVL\": {\n  \"native\": 1652987.7054902713,\n  \"usd\": 4898215818.294046,\n  \"asset\": \"ethereum\"\n},\n\"btcTVL\": {\n  \"native\": 15254.736434638018,\n  \"usd\": 603401099.6721067,\n  \"asset\": \"bitcoin\"\n},\n\"eurTVL\": {\n  \"native\": 31648893.302398853,\n  \"usd\": 33769369.153659575,\n  \"asset\": \"euro\"\n},\n\"otherTVL\": {\n  \"usd\": 9442145.482802702\n},\n\"allPools\": [\n  {\n    \"lptoken\": \"0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490\",\n    \"pool_address\": \"0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7\",\n    \"balance\": 3342439876.110956,\n    \"asset_price\": 1\n  },\n  ...\n],\n\n\"sideTVLs\": [\n  {\n    \"chain\": \"Polygon\",\n    \"tvl\": 392428028.38835347\n  },\n  ...\n],\n\"sideChainTVL\": 2782688533.573472,\n```\n\n## TODO\n\n* Historical data extraction for `sideTVLs`, currently returns the latest data.\n* Historical data extraction for `sidechainTVLs`, currently returns the latest data.\n\n## FAQ\n\n#### Why do I get following error? `Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.`\n\nThis problem most likely occurs because the pool has been created sometime after the generation of the requested block.\nAlso, it could be caused by the lack of a specific smart contract.\nTo solve this problem, request a block number when the pool exists.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbisonai%2Fcurve-api-historical-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbisonai%2Fcurve-api-historical-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbisonai%2Fcurve-api-historical-data/lists"}