How to secure crypto funds
Tips to keep your funds safe using hot & cold storage
Custom token supply API for CoinMarketCap and CoinGecko
So you will be required to provide this information via your own API rather than have CMC/CG automatically calculate this for you. What we found ourselves is current existing options out there are rather cumbersome or lack really any information on getting it set up for yourself. To help with this AnjiLabs have put together a GitHub repository for any token to use that can be used by any EVM chain https://github.com/AnjiLabs/TokenSupplies
This GitHub repository will provide you with the 2 different end-points required for both CG & CMC one /circulating for the current circulating supply to the current block and /total for the current total supply (minus burns) to the current block.
There are a couple of prerequisites to using the project:
Getting Started
You will see the file info.json this is where the basic information of your token will live. As an example we have used the ANJI token information.
You can either update the JSON file directly or you can run our little helper script to enter details by running npm run details. Within your terminal you will be asked a series of questions and will generate the info.json file directly for you.
The balances param within the JSON object should contain all of the wallets that should be omitted from your circulating supply. Removing wallets such as dead wallet, developer wallets and liquidity pool wallets.
The endpoint param within the JSON object should be a https endpoint that provides data for the blockchain.
Such as:
Now one big gotcha for BSC and some data endpoints is they will block some IP's such as CloudFlare for this reason if your token is on the BSC network we suggest using Moralis.io you can sign up for free and use the free tier for this API using their Speedy Nodes option. Once you create your account and get your BSC Speedy Node url simply add this to the value for the endpoint param.
Finally you'll see the token param containing some basic information of your token address, supply & decimals. The address should be the contract address for the token, supply being the full max supply (before burns etc) and decimals be the decimals set for the token.
Now that we have all this information setup we can get going. By installing and running the project.
Install the dependencies of the project using
npm install
Login to your personal Cloudflare
npm run wlogin
Run locally
npm start
Once the command completes you'll see
👂 Listening on http://127.0.0.1:8787
You can now visit your API locally
Once you have verified this is all correct you can simply deploy your API to Cloudflare using.
npm run deploy
This will deploy directly to your CloudFlare account a worker whilst returning a URL in which the API runs from something like
✨ Build completed successfully!
✨ Successfully published your script to
https://tokensupplies.my-worker.workers.dev