BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Mark Price Calculation Component 2: Volatility Metric #481

Closed patrickdugan closed 2 years ago

patrickdugan commented 2 years ago

We're going to look at a series of volatility samples for the mark price of some spot pair. We'll take a contract id, which if native, will reference the historical VWAP of the pair, and return the % change between high and low prices on a period of 1000 blocks, 500 blocks, 100 blocks, 50 blocks and 10 blocks. Make this transparent with an RPC and return some JSON of these values with the labels of the intervals.

These will be used in a formula to adjust the coefficients of weightings for different kinds of spot price data.

patrickdugan commented 2 years ago

Done well and fast

https://github.com/skuzminsky/BlockPo-to-Tradelayer/blob/master/src/tradelayer/rpc.cpp#L3888