Oracle Proxy

Oracle is the primary endpoint for reading and writing asset information. As a user, you can use the various read endpoints.

Get One Value

Returns a single PriceTick object with a median price. The type field in the response object will indicate the median. The median is returned either as an on-chain (on L2) computed median, or during testing, may be a median calculation done off-chain.

Retrieve a single value for an asset

GET OracleProxy/get_value

Retrieve a single value for an asset. Note that the object being returned is of type PriceTick

Query Parameters

// See PriceTick in Structures

Get Stats Bundle

Returns a PriceAggregate object containing more advanced price calculation. For example, the median price calculation is a liquidity weighted price, computed as follows:

​where liquidity is defined as

Why use get_value instead of get_bundle, which contains more data about an asset? Consider the bundle to be reflective of the more detailed financial data, such as liquidity, used by more complex DeFi applications. At present, both endpoints can be used interchangeably, but expect the methods to differentiate in the future.

Retrieves a bundle of statistics about the asset

GET OracleProxy/get_price_bundle

Use this method to get access to variance, liquidity (see above for definition), and a liquidity weighted price.

Query Parameters

{
    // See PriceAggregate in structures
}

Get Multiple Values

This method is not yet implemented; coming Sep 2022.

Retrieves all applicable prices

GET OracleProxy/get_values

Note: This method is not yet implemented

Last updated