Stork Documentation
Ask or search…
K

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.
get
OracleProxy
/get_value
Retrieve a single value for an asset

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:
1nmidpriceiliquidityiliquidityi\sum_1^n\frac{midprice_i*liquidity_i}{liquidity_i}
​where liquidity is defined as
midprice1%midpricebidPriceibidVolumei+midpricemidprice+1%askPriceiaskVolumei2\frac{\sum_{midprice-1\%}^{midprice}bidPrice_i*bidVolume_i+\sum_{midprice}^{midprice+1\%}askPrice_i*askVolume_i}{2}
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.
get
OracleProxy
/get_price_bundle
Retrieves a bundle of statistics about the asset

Get Multiple Values

This method is not yet implemented; coming Sep 2022.
get
OracleProxy
/get_values
Retrieves all applicable prices