Giter Site home page Giter Site logo

dfx-circ-supply's People

Contributors

adrianmcli avatar

Watchers

 avatar  avatar

dfx-circ-supply's Issues

CoinGecko Pairs

The /pairs endpoint provides a summary on cryptoasset trading pairs available on the exchange. For example, for Bitcoin (BTC):

  {
    "ticker_id": "BTC_ETH",
    "base": "BTC",
    "target": "ETH",
  }

/pairs endpoint response description:

Name Data Type Category Description
ticker_id string Mandatory Identifier of a ticker with delimiter to separate base/target, eg. BTC_ETH
base string Mandatory Symbol/currency code of a the base cryptoasset, eg. BTC
target string Mandatory Symbol/currency code of the target cryptoasset, eg. ETH
pool_id string Recommended/Mandatory pool/pair address or unique ID (Mandatory for DEX)

For reference, a good example would be

  1. https://api.binance.com/api/v1/exchangeInfo

CoinGecko Tickers

The /tickers endpoint provides 24-hour pricing and volume information on each market pair available on an exchange.

{
      "ticker_id": "BTC_ETH",
      "base_currency": "BTC",
      "target_currency": "ETH",
      "last_price":"50.0",
      "base_volume":"10",
      "target_volume":"500",
      "bid":"49.9",
      "ask":"50.1",
      "high":"51.3",
      "low":"49.2",
}

/tickers endpoint response description:

Name Data Type Category Description
ticker_id string Mandatory Identifier of a ticker with delimiter to separate base/target, eg. BTC_ETH
base_currency string Mandatory Symbol/currency code of base pair, eg. BTC
target_currency string Mandatory Symbol/currency code of target pair, eg. ETH
last_price decimal Mandatory Last transacted price of base currency based on given target currency (unit in base or target)eg.X = ?1 base = X targetX base = 1 target
base_volume decimal Mandatory 24 hour trading volume in base pair volume (unit in base)
target_volume decimal Mandatory 24 hour trading volume in target pair volume (unit in target)
pool_id string Recommended/Mandatory pool/pair address or unique ID (Mandatory for DEX)
bid decimal Recommended Current highest bid price
ask decimal Recommended Current lowest ask price
high decimal Recommended Rolling 24-hours highest transaction price
low decimal Recommended Rolling 24-hours lowest transaction price

For reference, a good example would be
1.https://api.binance.com/api/v1/ticker/24hr

API for CoinGecko

This repo will be transformed into an API for CoinGecko (and maybe other similar actors).

CoinGecko has provided the following 4 endpoint requirements and each will be broken down into their own individual issues:

  • 1. /pairs — Details on cryptoassets traded on an exchange.
    • Issue: #2
  • 2. /tickers — Market related statistics for all markets for the last 24 hours.
    • Issue: #3
  • 3. /orderbook — Order book depth of any given trading pair, split into two different arrays for bid and ask orders.
    • Issue: #4
  • 4. /historical — Historical trade data for any given trading pair.
    • Issue: #5

CoinGecko Orderbook (i.e. depth details)

The /orderbook/ticker_id endpoint is to provide order book information with at least depth = 100 (50 each side) returned for a given market pair/ticker.

Endpoint parameters:

Name Type Status Description
ticker_id string Mandatory A ticker such as "BTC_ETH", with delimiter between different cryptoassets
depth integer Recommended Orders depth quantity: [0, 100, 200, 500...]. 0 returns full depth. Depth = 100 means 50 for each bid/ask side.Note that for more liquid or closely priced pairs, the lack of order depth may result in miscalculation of depth/spread.

Example query:
.../api/orderbook?ticker_id=BTC_ETH&depth=200

{  
   "ticker_id": "BTC_ETH",
   "timestamp":"1700050000",
   "bids":[  
      ["49.8", "0.50000000"],
      ["49.9", "6.40000000"]
   ],
   "asks":[  
      ["50.1", "9.20000000"],
      ["50.2", "7.9000000"]
   ]
}

Order book response descriptions:

Name Data Type Category Description
ticker_id string Mandatory A pair such as "BTC_ETH", with delimiter between different cryptoassets
timestamp timestamp Recommended Unix timestamp in milliseconds for when the last updated time occurred.
bids decimal Mandatory An array containing 2 elements. The offer price and quantity for each bid order
asks decimal Mandatory An array containing 2 elements. The ask price and quantity for each ask order

For reference, a good example would be
1.https://api.binance.com/api/v1/depth?symbol=BTCUSDC&limit=5000

CoinGecko Historical Data

The /historical_trades/ticker_id is used to return data on historical completed trades for a given market pair.

Endpoint parameters:

Name Data Type Category Description
ticker_id string Mandatory A pair such as "BTC_ETH", with delimiter between different cryptoassets
type string Mandatory To indicate nature of trade - buy/sell
limit integer Recommended Number of historical trades to retrieve from time of query. [0, 200, 500...]. 0 returns full history.
start_time date Recommended Start time from which to query historical trades from
end_time date Recommended End time for historical trades query

Example query:
.../api/historical_trades?ticker_id=BTC_ETH&limit=10

"buy": [  
   {        
      "trade_id":1234567,
      "price":"50.1",
      "base_volume":"0.1",
      "target_volume":"1",
      "trade_timestamp":"1700050000",
      "type":"buy"
   }
],
"Sell": [
   {        
      "trade_id":1234567,
      "price":"50.1",
      "base_volume":"0.1",
      "target_volume":"1",
      "trade_timestamp":"1700050000",
      "type":"sell"
   }
]

/historical_trades response descriptions:

Name Data Type Category Description
trade_id integer Mandatory A unique ID associated with the trade for the currency pair transactionNote: Unix timestamp does not qualify as trade_id.
price decimal Mandatory Transaction price in base pair volume.
base_volume decimal Mandatory Transaction amount in base pair volume.
target_volume decimal Mandatory Transaction amount in target pair volume.
trade_timestamp timestamp Mandatory Unix timestamp in milliseconds for when the transaction occurred.
type string Mandatory Used to determine the type of the transaction that was completed.Buy – Identifies an ask that was removed from the order book.Sell – Identifies a bid that was removed from the order book.

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.