RestAPI Endpoints

The page includes a list of all available Token data endpoints on DIA network. To review the data sources and methodologies used for pricing, visit the following page:

Data sources

Digital Assets Market Data

Token Price Quotation (by address)

GET https://api.diadata.org/v1/assetQuotation/:blockchain/:asset

Returns the quotation for a fully qualified asset (i.e. distinguished by blockchain and address). Quotations are obtained by filtering trades data with a Moving Average filter and Interquartile Range outlier detection (MAIR).

Example: https://api.diadata.org/v1/assetQuotation/Bitcoin/0x0000000000000000000000000000000000000000

Path Parameters

NameTypeDescription

blockchain*

String

Name of the blockchain for requested asset

asset*

String

Address of the requested asset

{
    "Symbol": "BTC",
    "Name": "Bitcoin",
    "Address": "0x0000000000000000000000000000000000000000",
    "Blockchain": "Bitcoin",
    "Price": 25703.376586196053,
    "PriceYesterday": 25815.29054321003,
    "VolumeYesterdayUSD": 1317774231.5192668,
    "Time": "2023-09-11T10:07:59.944Z",
    "Source": "diadata.org",
    "Signature": "0x8e0ffd0f2aac9306a6605e82f87856859b0666f1e600c9247b2935bfe52ded71061aa0c04e83dde4b6272a3057b5b93d9395ed5d8e1f033d1b25b04e73e1680101"
}

Token Price Quotation (by symbol)

GET https://api.diadata.org/v1/quotation/:symbol

Get most recent information on the currency corresponding to symbol. Quotations are obtained by filtering trades data with a Moving Average filter and Interquartile Range outlier detection (MAIR).

Note: this endpoint is intended for testing purposes only; if multiple assets with the same symbol exists, data for the highest volume generating asset will be returned

Example: https://api.diadata.org/v1/quotation/BTC

Path Parameters

NameTypeDescription

Symbol*

String

Which symbol to get a quotation for, e.g., BTC.

{
    "Symbol": "BTC",
    "Name": "Bitcoin",
    "Address": "0x0000000000000000000000000000000000000000",
    "Blockchain": "Bitcoin",
    "Price": 25692.061459484863,
    "PriceYesterday": 25825.253617593764,
    "VolumeYesterdayUSD": 1323023983.1804218,
    "Time": "2023-09-11T10:15:59.299Z",
    "Source": "diadata.org"
}

Quotable Assets

GET https://api.diadata.org/v1/quotedAssets

Returns a list of assets available for quotations.

Example: https://api.diadata.org/v1/quotedAssets

Use the query parameter blockchain in order to obtain exclusively assets on the selected blockchain.

Example: https://api.diadata.org/v1/quotedAssets?blockchain=Polygon

Query Parameters

NameTypeDescription

blockchain

String

Name of the blockchain for the requested assets.

[{"Asset":{"Symbol":"WETH","Name":"Wrapped Ether","Address":"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619","Decimals":18,"Blockchain":"Polygon"},"Volume":35305550.57803},{"Asset":{"Symbol":"WMATIC","Name":"Wrapped Matic","Address":"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270","Decimals":18,"Blockchain":"Polygon"},"Volume":24233330.345671}]

DeFi Data

DeFi Protocols Collateral Information

GET https://api.diadata.org/v1/synthasset/:blockchain/:protocol

The endpoint provides information on the health factor of DeFi protocols.

It takes into consideration outstanding loans, contracts' balance and compares it to synthetic token issuance. This helps to make sure that all assets are fully collateralized.

Exemplary query:

https://api.diadata.org/v1/synthasset/Ethereum/Aave-V2

Currently only Aave V2 and Aave V3 are supported on Ethereum and Avalanche blockchains.

It is possible to receive collateral information for a single token by using token filter as in example below:

https://api.diadata.org/v1/synthasset/Avalanche/Aave-V3?address=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7

To receive all asset updates data during the selected period use starttime and endtime filter parameters with timestamps as inputs. Here is an example:

https://api.diadata.org/v1/synthasset/Avalanche/Aave-V3?address=0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7&starttime=1664502770&endtime=1664531570

Path Parameters

NameTypeDescription

blockchain*

String

Ethereum or Avalanche

protocol*

String

Aave

address

String

Token contract address. You can use either underlying token address or synthetic token to receive the data

starttime

Integer

Unix timestamp setting the start of the return array

endtime

Integer

Unix timestamp setting the end of the return array

{
    // Response
}

Decentralized Exchanges Pool Liquidity

GET https://api.diadata.org/v1/poolLiquidity/:blockchain/:pool_address

Get the latest state of a DEX pool's liquidity. Example: https://api.diadata.org/v1/poolLiquidity/Ethereum/0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc

Path Parameters

NameTypeDescription

blockchain*

String

Name of the blockchain of the requested pool.

address*

String

Address of the requested pool.

{Exchange: "Uniswap", Blockchain: "Ethereum", Address: "0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc", Time: "0001-01-01T00:00:00Z", TotalLiquidityUSD: 97124191.13292821,
Liquidity:
{ 0: {Asset: {Symbol: "WETH", Name: "Wrapped Ether", Address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", Decimals: 18, Blockchain: "Ethereum"}, Volume: 34642.164578066426 }}
{1: {Asset: {Symbol: "USDC", Name: "USD Coin", Address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", Decimals: 6, Blockchain: "Ethereum"}, Volume: 50362947.314436}}
}

Slippage calculation (for Uniswap V2 and its forks)

GET https://api.diadata.org/v1/poolSlippage/:blockchain/:pool_address/:token1_address/:pool_type/:desired_slippage

To predict the amount of tokens required to reach a specified slippage, you can use Pool Slippage endpoint. It works for any pool that exists on Uniswap V2 or any fork DEX on supported list of exchanges.

Here is an exemplary API call:https://api.diadata.org/v1/poolSlippage/Ethereum/0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48/UniswapV2/100

The logic is as follows:

Provide the address of the pool, select a token in which you wish to have slippage calculated (e.g. if selected ETH from ETH-USDC, it will show how much is ETH is required to move the price by selected amount) and determine the goal for price movement.

Path Parameters

NameTypeDescription

:blockchain*

String

Name of the blockchain of the requested pool (e.g. Ethereum, Moonbeam, etc.)

:pool_address*

String

Address of the requested pool

:token1_address*

String

Address of either of the tokens in the pool

:pool_type*

String

Type of the pool (e.g. UniswapV2)

:desired_slippage*

Integer

Per mille (e.g. 100 will result in 10% slippage)

{
    // Response
}

Assets Information

Blockchains

GET https://api.diadata.org/v1/blockchains

Get a list of all available blockchains.

{
    // Response
}

Exchanges

GET https://api.diadata.org/v1/exchanges

Get a list of all available crypto exchanges.

["KuCoin","Uniswap","Balancer","Maker","Gnosis","Curvefi","Binance","BitBay","Bitfinex","Bittrex","CoinBase","GateIO","HitBTC","Huobi","Kraken","LBank","OKEx","Quoine","Simex","ZB","Bancor","Loopring","SushiSwap","Dforce","0x","Kyber","Bitmax","PanCakeSwap","CREX24","STEX"]

Centralized Exchange Pairs by Exchange

GET https://api.diadata.org/v1/pairsCex/:exchange

Get all pairs on a given exchange for which DIA is collecting trades data at the moment.

Example: https://api.diadata.org/v1/pairsCex/Kraken

Use the query parameter verified in order to get either verified or unverified pairs.

Example: https://api.diadata.org/v1/pairsCex/Kraken?verified=true

Path Parameters

NameTypeDescription

exchange*

String

Name of the crypto exchange.

Query Parameters

NameTypeDescription

verified

Bool

If set to true, only verified pairs are returned. If set to false, only unverified pairs are returned.

Centralized Exchange Pairs by Asset

GET https://api.diadata.org/v1/pairsAssetCex/:blockchain/:address

Get all pairs on a centralized exchange for which DIA is collecting trades data at the moment. Include pairs across all exchanges involving the requested asset as either base- or quote token.

Example: https://api.diadata.org/v1/pairsAssetCex/Shiden/0x0000000000000000000000000000000000000000

Use the query parameter verified in order to get either verified or unverified pairs.

Example: https://api.diadata.org/v1/pairsAssetCex/Shiden/0x0000000000000000000000000000000000000000?verified=true

Path Parameters

NameTypeDescription

blockchain*

String

Name of the blockchain for the requested asset.

address*

String

Address of the requested asset.

Query Parameters

NameTypeDescription

verified

Bool

If set to true, only verified pairs are returned. If set to false, only unverified pairs are returned.

Asset Last Trades

GET https://api.diadata.org/v1/lastTradesAsset/:blockchain/:address

Get last trade timestamp for an asset.

Example: https://api.diadata.org/v1/lastTradesAsset/Bitcoin/0x0000000000000000000000000000000000000000

Path Parameters

NameTypeDescription

blockchain*

String

A valid blockchain from GET /v1/blockchains, e.g., Bitcoin.

address*

String

A valid asset address from GET /v1/token/:symbol, e.g., 0x000000000000000000000000000000000000000 for BTC.

{
    // Response
}

Chart Points for Graphs

Exchange Chart Points

GET https://api.diadata.org/v1/chartPoints/:filter/:exchange/:symbol

Get chart points for an exchange.

Example: https://api.diadata.org/v1/chartPoints/MEDIR120/Binance/BTC Note: Successful responses can be rather large.

Path Parameters

NameTypeDescription

filter*

string

Which filter should be applied (Available options: MA120, VOL120, MEDIR120 and MAIR120).

exchange*

string

A valid exchange from GET /v1/exchanges, e.g., Binance

symbol*

string

A valid symbol from GET /v1/coins, e.g., BTC.

Query Parameters

NameTypeDescription

scale

string

Which scale the graph points distance should have. Available options: 5m 30m 1h 4h 1d 1w.

{"DataPoints":[{"Series":[{"name":"filters","columns":["time","exchange","filter","symbol","value"],"values":[["2020-05-19T08:02:09Z","GateIO","MEDIR120","EOS",2.6218717017500084]]}],"Messages":null}]}

Asset Chart Points

GET https://api.diadata.org/v1/assetChartPoints/:filter/:blockchain/:address

Get asset details for all exchanges.

Example: https://api.diadata.org/v1/assetChartPoints/MA120/Bitcoin/0x0000000000000000000000000000000000000000

Remark: Careful! Successful responses can be rather large.

Path Parameters

NameTypeDescription

starttime

integer

Unix timestamp setting the start of the return array

endtime

integer

Unix timestamp setting the end of the return array

filter*

string

Which filter should be applied (Available options: MA120, MEDIR120, VOL120 and MAIR120).

blockchain*

string

A valid blockchain from GET /v1/blockchains, e.g., Bitcoin.

address*

String

A valid asset address from GET /v1/token/:symbol, e.g., 0x000000000000000000000000000000000000000 for BTC.

Query Parameters

NameTypeDescription

scale

string

Which scale the graph points distance should have. Available options: 5m 30m 1h 4h 1d 1w

{"DataPoints":[{"Series":[{"name":"filters","columns":["time","exchange","filter","symbol","value"],"values":[["2020-05-19T08:17:59Z",null,"MEDIR120","EOS",2.6236194301032314]]}],"Messages":null}]}

Guest Quotations

Guest Symbols

GET https://api.diadata.org/v1/foreignSymbols/:source

Get the list of available symbols along with their ITIN for guest quotations.

Example: https://api.diadata.org/v1/foreignSymbols/Coingecko

Path Parameters

NameTypeDescription

source*

string

source of the quotation

Guest Quotation

GET https://api.diadata.org/v1/foreignQuotation/:source/:symbol

Get the latest quotation for a token from a guest source.

Example: https://api.diadata.org/v1/foreignQuotation/CoinMarketCap/BTC Use the query parameter time in order to get the latest quotation before the specified timestamp

Example: https://api.diadata.org/v1/foreignQuotation/Coingecko/BTC?time=1647349656

Path Parameters

NameTypeDescription

source*

string

source of the quotation

symbol*

string

Which symbol to get a quotation for, e.g. BTC

Query Parameters

NameTypeDescription

time

number

Unix timestamp.

Last updated