dfx-finance / dfx-circ-supply Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://dfx-circ-supply.vercel.app
Home Page: https://dfx-circ-supply.vercel.app
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
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
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:
/pairs
— Details on cryptoassets traded on an exchange.
/tickers
— Market related statistics for all markets for the last 24 hours.
/orderbook
— Order book depth of any given trading pair, split into two different arrays for bid and ask orders.
/historical
— Historical trade data for any given trading pair.
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
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. |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.