frontend-monorepo icon indicating copy to clipboard operation
frontend-monorepo copied to clipboard

Add a stream of mark price inputs to the mark price header

Open JonRay15 opened this issue 11 months ago • 1 comments

The Chore

In the header

image

That mark price is now actually being driven by various inputs from the mark price config as per #5809.

Some people might want to see the stream of prices that are driving that.

These can be found here: https://vega-data.nodes.guru:3008/api/v2/market/data/4e9081e20e9e81f3e747d42cb0c9b8826454df01899e6027a22e771e19cc79fc/latest

Under here:

"markPriceType": "COMPOSITE_PRICE_TYPE_MEDIAN"
"markPriceState": {
"priceSources": [
{
"priceSource": "priceFromTrades",
"price": "59293800000",
"lastUpdated": "1709116382757832435"
},
{
"priceSource": "priceFromOrderBook",
"price": "59236121590",
"lastUpdated": "1709117299204118135"
},
{
"priceSource": "priceFromOracle1",
"price": "59188643715",
"lastUpdated": "1709117257770320896"
},
{
"priceSource": "priceFromOracle2",
"price": "59188643715",
"lastUpdated": "1709117257770320896"
},
{
"priceSource": "medianPrice",
"price": "59188643715",
"lastUpdated": "1709117297885735065"
}
]
}

it would need to also pullin the composite price type.

Example 1 - Median

  • Price Type: Median
  • Trade price: A
  • Book price: B
  • External price 1: C

Example 1 - Weighted average

  • Price Type: Weighted average
  • Trade price: A (20%)
  • Book price: B (30%)
  • External price 1: C (50%)

Note those weights are not available on the marketData API so you will need to grab them from the markets API in the same way as we do on #5809

I could imagine these on a tooltip popup similar to what we do for liquidity

image

Tasks

  • [ ]
  • [ ]

Additional details / background info

JonRay15 avatar Feb 28 '24 14:02 JonRay15

Can we look at the configs in mainnet currently and determine if there is something understandable we can show that explains these more clearly?

JonRay15 avatar Jun 26 '24 14:06 JonRay15