Transparent and accurate market cap for Cardano native tokens
npm install @minswap/market-capTransparent, accurate and open-sourced circulating supply and market cap calculation for Cardano's native tokens.
This package doesn't expose market cap by itself, but only circulating supply and total supply.
Market cap = Circulating supply \* Market price
Fully-diluted market cap = Total supply \* Market price
You can use Blockfrost Adapter to query market price from Minswap.
- NPM: npm install @minswap/market-cap
- Yarn: yarn add @minswap/market-cap
``ts
import { supplyFetchers } from "@minswap/market-cap";
const minInfo = await supplyFetchers[
"29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e"
]();
console.log(minInfo);
// { circulating: '240813714.66121483', total: '5000000000' }
`
1. Create a file in src/tokens with your token's name and export default a function of type SupplyFetcher.src/index.ts
2. Import the function into and add the corresponding entry in supplyFetchers map with the key being the concatenation of your token's policyID and assetName
3. Test your function:
`bash`only if you use Blockfrost
export BLOCKFROST_PROJECT_ID=
ONLY_TEST=
4. Run format: npm run format
1. MIN token fetcher: src/tokens/min.ts
2. Add entry to index.ts:
`ts
import minFetcher from "./tokens/min";
export const supplyFetchers: Record
"29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e": minFetcher,
...
};
`
3. Run test:
`bash``
export BLOCKFROST_PROJECT_ID=
ONLY_TEST=29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e npm test