{"id":14989556,"url":"https://github.com/beefyfinance/beefy-api","last_synced_at":"2025-05-14T23:04:55.872Z","repository":{"id":37081773,"uuid":"301177237","full_name":"beefyfinance/beefy-api","owner":"beefyfinance","description":"Simple API for BeefyFinance","archived":false,"fork":false,"pushed_at":"2025-05-12T12:25:03.000Z","size":15146,"stargazers_count":123,"open_issues_count":7,"forks_count":200,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-12T13:34:36.024Z","etag":null,"topics":["api","apy","beefyfinance","binance-smart-chain","defi","koa2","yield-farming"],"latest_commit_sha":null,"homepage":"https://api.beefy.finance","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beefyfinance.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-04T16:43:36.000Z","updated_at":"2025-05-12T12:21:52.000Z","dependencies_parsed_at":"2024-07-05T16:36:16.680Z","dependency_job_id":"4aaa73ef-ca97-4d4f-a48a-8834254b3acd","html_url":"https://github.com/beefyfinance/beefy-api","commit_stats":{"total_commits":5581,"total_committers":89,"mean_commits":62.70786516853933,"dds":0.7842680523203727,"last_synced_commit":"c24fa89d9bbd476babc0a8b49909a982796a942b"},"previous_names":[],"tags_count":1312,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefyfinance%2Fbeefy-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefyfinance%2Fbeefy-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefyfinance%2Fbeefy-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beefyfinance%2Fbeefy-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beefyfinance","download_url":"https://codeload.github.com/beefyfinance/beefy-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253753025,"owners_count":21958829,"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":["api","apy","beefyfinance","binance-smart-chain","defi","koa2","yield-farming"],"created_at":"2024-09-24T14:18:33.837Z","updated_at":"2025-05-14T23:04:50.863Z","avatar_url":"https://github.com/beefyfinance.png","language":"TypeScript","readme":"# Beefy API\n\nAPI that powers [Beefy Finance](https://app.beefy.finance). You can find the repo for the frontend [here](https://github.com/beefyfinance/beefy-app).\n\n---\n\n## To Run.\n\n```\nyarn install-all \nyarn start\n```\n\nNote: After you start the API it can take a minute or two before you can fetch the APYs. We currently log `getApys()` to the console when all the data is available.\n\nOptional environment vars:\n\n`BSC_RPC` - A custom RPC endpoint that you want to use.\n`HECO_RPC` - A custom RPC endpoint for HECO. You can just leave the default one otherwise.\n`FORTUBE_API_TOKEN` - A token from Fortube to use their API. If you don't have a token you will get a console warning and the Fortube APYs will be slightly smaller than in production. Everything works fine otherwise. \n\n---\n\n---\n\n## Endpoints\n\nhttp://localhost:3000/\n\n---\n\n### Consumed by the [app](https://app.beefy.finance)\n\n#### **/apy**\n\nThe main endpoint used by the frontend. It returns the APY of all the vaults in the following format. \n\n```\n{\n\t\"bifi-maxi\": 0.22448469479728606, // 22%\n\t\"cake-cake\": 2.8002377054263174, // 280%\n\t\"cake-smart\": 2.8002377054263174, // 280%\n\t\"cake-swingby-bnb\": 21.85102752680053 // 2185%\n}\n```\n\nNB This is the legacy format. A new endpoint is being created at **/apy/breakdown** with a staggered migration.\n\n#### **/apy/breakdown**\n\nThe new version of the APY endpoint, broken down into component parts when they are available. The endpoint moves to a new format, which is consistent whether or not the breakdown stats are possible to display. It has the following structure:\n\n```json\n{\n  \"bifi-maxi\": {\n    \"totalApy\": 0.07598675804818633\n  },\n  \"cometh-must-eth\": {\n    \"vaultApr\": 1.186973388240745,\n    \"compoundingsPerYear\": 2190,\n    \"beefyPerformanceFee\": 0.045,\n    \"vaultApy\": 2.1057844292858614,\n    \"lpFee\": 0.005,\n    \"tradingApr\": 0.22324214039526927,\n    \"totalApy\": 2.8825691266420788\n  }\n}\n```\n\nNote the endpoint exposes elements needed for the Total APY calculation. Where this is not possible, we just show the legacy Total APY. Note that the legacy Total APY -\u003e totalApy does not include the trading fees.\n\nEach of these fields within the structure are:\n\n- **vaultApr** - Yearly rewards in USD divided by total staked in USD.\n- **compoundingsPerYear** - The estimated compounding events. This is an internal field and references the value used within the calculation for this project.\n- **beefyPerformanceFee** - The flat Beefy performance fee included in the calculation. This is an internal field for reference.\n- **vaultApy** - The vaultApr compounded, using compoundingsPerYear and beefyPerformanceFee in the calculation.\n- **lpFee** - The Liquidity Provider (LP) fee per trade. This is an internal field for reference.\n- **tradingApr** - Annual interest from trading fees, not compounded.\n- **totalApy** - The known Total APY. Where fields are available to calculate the Total APY including trading fees, this is calculated. The final calculation is totalApy = (1 + vaultApy) * (1 + tradingApr) - 1.\n\n\n#### **/prices** All token prices under the same endpoint (crosschain).\n\n#### **/lps**: All liquidity pair prices under a single endpoint (crosschain).\n\n#### **/vaults**: TBD\n\n\n---\n\n### Consumed by the [dashboard](https://dashboard.beefy.finance)\n\n#### **/earnings**: Used to display the total and daily earnings of the platform\n\n#### **/holders**: Used to display the total number of holders. This calc takes into account users with 0 BIFI in their wallet, but BIFI staked in the reward pool\n\n---\n\n### Consumed by third party platforms\n\n#### **/cmc**: Custom endpoint required by [CoinMarketCap](https://coinmarketcap.com/) to display our vaults in their yield farming section\n\n#### **/supply**: Used by [Coingecko](https://coingecko.com) to display BIFI's total supply and circulating supply\n\n---\n\n---\n\n## Further Information\n\nFor further information on the range of endpoints currently supported by the Beefy API, check out the latest version of our [API documentation](https://docs.beefy.finance/developer-documentation/beefy-api).\n\n---\n\n---\n\n## Contribute\n\nBeefy.Finance exists thanks to its contributors. There are many ways you can participate and help build high quality software. Check out the [contribution guide](CONTRIBUTING.md)!\n\n---\n\n---\n\n## License\n\n[MIT](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeefyfinance%2Fbeefy-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeefyfinance%2Fbeefy-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeefyfinance%2Fbeefy-api/lists"}