Definition

This section provides unweighted prices for every pair and asset across every decentralized exchange we support. You can view the data from the latest or historical endpoints. Our pricing data goes as far back as needed due to the fact that we run our own nodes and have all data since genesis (the first) block.


Details

Similar to the VWAP and TWAP sections, the Price endpoints break up the data into two types; asset and pair. The benefit of this is that it allows you to see what the prices are for an individual asset or a particular pair. For example, if you wanted to see what the WBTC_WETH pair price was on a certain day, the Pairs Historical endpoint can do this.

The big difference between the Asset and Pair endpoints is that the Asset price uses the VWAP price with a lookback period of 1 to give an overall price for the asset itself. However, this lookback period is configurable. Using this method as opposed to an aggregate of all pairs eliminates the potential for erroneous prices due to an outlier. The Asset price has been referred to as a global or reference price.

Price is calculated across all exchanges that support the asset or pair specified with a 1 minute frequency. It is derived from the OHLCV data with the following calculation: (O+H+L+C) / 4 and the prices are denominated in ETH.


API Endpoints

/market/defi/prices/asset/information
/market/defi/prices/asset/{asset}/latest
/market/defi/prices/asset/{asset}/historical
/defi/prices/pairs/information
/market/defi/prices/pairs/bases/{base}/quotes/{quote}/latest
/market/defi/prices/pairs/bases/{base}/quotes/{quote}/historical


Availability

Our Price endpoints are available via REST API for historical (time series) data as well as WebSockets for real-time data. These are updated each time a new block is mined. Price data is available for every asset and trading pair on every DEX we support.


Frequently Asked Questions

How is this different from the TWAP and VWAP price data?

  • Unlike the TWAP and VWAP weighted prices, the Prices endpoints show the unweighted prices of an asset or pair.

What is the latency of the Prices endpoints?

  • The average latency for the Prices endpoints is 100-300 ms.

If I want to see just the price data for a particular exchange, can I?

  • In this case, we would recommend using the OHLCV data where a particular exchange can be specified. Our Price endpoints calculate the price globally across all DEX's that support the specified asset or pair.

How do you get the price for a specific asset, for example if I want the price of WETH only?

  • Using our Asset Latest & Historical endpoints, we first get all WETH pair prices across the exchanges using (O+H+L+C) / 4. Then, to get the asset prices, we average several pair prices using the pairs that have been traded in the last minute.