Giter Club home page Giter Club logo

market-cap's Introduction

Market Cap

Transparent, accurate and open-sourced circulating supply and market cap calculation for Cardano's native tokens.

Overview

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.

Install

  • NPM: npm install @minswap/market-cap
  • Yarn: yarn add @minswap/market-cap

Usage

import { supplyFetchers } from "@minswap/market-cap";

const minInfo = await supplyFetchers[
  "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e"
]();
console.log(minInfo);
// { circulating: '240813714.66121483', total: '5000000000' }

How to add my token

  1. Create a file in src/tokens with your token's name and export default a function of type SupplyFetcher.
  2. Import the function into src/index.ts 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:
# only if you use Blockfrost
export BLOCKFROST_PROJECT_ID=<your_blockfrost_key>
ONLY_TEST=<your_policy_id_concat_with_asset_name> npm test
  1. Run format: npm run format

Example

  1. MIN token fetcher: src/tokens/min.ts
  2. Add entry to index.ts:
import minFetcher from "./tokens/min";

export const supplyFetchers: Record<string, SupplyFetcher> = {
  "29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e": minFetcher,
  ...
};
  1. Run test:
export BLOCKFROST_PROJECT_ID=<your_blockfrost_key>
ONLY_TEST=29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c64d494e npm test

market-cap's People

Contributors

adakondacoin avatar alesfatalis avatar b00kdev avatar benelferink avatar drmaldy avatar elraulito avatar fractionestate avatar hieupnh avatar joacohoyos avatar legionaaa avatar lloydswale avatar longngn avatar luadja avatar mercurial avatar mezuny avatar muesliswapteam avatar neo00411 avatar nexuscrypt avatar nftkri avatar nmelentjevs avatar patricktobler avatar poolstakes avatar rausi avatar shadowkora avatar similiken avatar synthluvr avatar thetaphouse avatar twilightduck avatar workingdeadnft avatar yhsj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

market-cap's Issues

COPI on markets is $0.03 and minswap has conversion at 1 COPI = 0.18 ADA which doesn't equal market price of $.54 for ADA

The current price of COPI token is $0.03 and I went to purchase this token, and on minswap it says that the price is .18ADA for 1 copi token. I purchased the ADA at $0.5416 per coin. If 1 copi token is 0.18 ADA, then that is $0.09 for a copi token
I appreciate your time and responses to help here. :-)
I looked up other tokens on Minswap and did the calculations and they come out to what the market prices are. I think something is incorrect with COPI in Minswap.
Screen Shot 2022-05-23 at 12 20 48 AM
Screen Shot 2022-05-23 at 12 19 50 AM

Add $BUKELE token market cap

Hello
I would like to ask for help to get my token display market cap, token information below.

Token has a pool on minswap verified.

Name: BUKELE
Policy id: 0c002b51df1a54194819c0990f52d14682bbb3e93a58052e7c81f71c

Twiter has policy id on bio
https://twitter.com/BukeleTokensv/

Thanks in advance!

CI hits Blockfrost rate-limit

✕ test fetcher for token 1ddcb9c9de95361565392c5bdff64767492d61a96166cb16094e54be4f5054 (1579 ms)
✕ test fetcher for token b316f8f668aca7359ecc6073475c0c8106239bf87e05a3a1bd5697647856594649 (36 ms)
✕ test fetcher for token 2d92af60ee429bce238d3fd9f2531b45457301d74dad1bcf3f9d1dca564e4d (1027 ms)
✕ test fetcher for token 21abdf54f427b378fe9ba07419eff6e8e8fe0c5932e1fee2d3853b9350455045424c5545 (4 ms)
✓ test fetcher for token 7914fae20eb2903ed6fd5021a415c1bd2626b64a2d86a304cb40ff5e4c494649
✓ test fetcher for token 0d90046ad35546156aaf790525133f7fc713ca2790e397784b85f5c85554494c
✕ test fetcher for token a3931691f5c4e65d01c429e473d0dd24c51afdb6daf88e632a6c1e516f7263666178746f6b656e (1120 ms)

● supply fetchers › test fetcher for token 8daefa391220bd0d8d007f3748d870f7f3c106040314c8515ccc35a5464c4143

BlockfrostServerError: 429: Too Many Requests

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.