vegaprotocol / data-node

A rich API server for Vega Protocol
https://vega.xyz
Other
3 stars 1 forks source link

Incorrect Prices returned from Depth endpoint in datanode #705

Closed TomMcL closed 2 years ago

TomMcL commented 2 years ago

Problem encountered

The depth value in data-node API appears to occasionally become desynced from the 'true' prices

Observed behaviour

Observed on AAPL market on fairground, the prices in the 'bids' values are much higher than those in 'ask' and do not tally with values from best bid/ask. Market is not in an auction, and contracts are trading at values consistent with best bid/ask which implies it is this order book display which is not correct

Expected behaviour

Prices displayed correctly for current state of the market

Evidence

Screenshots

image

image

Definition of Done

ℹ️ Not every issue will need every item checked, however, every item on this list should be properly considered and actioned to meet the DoD.

Before Merging

After Merging

ettec commented 2 years ago

@TomMcL are you able to reproduce this on any environment and capture the event stream from block 0?

TomMcL commented 2 years ago

Event file: core.evt.zip

GraphQL for querying:

{
    markets {
    depth {
      sell {
        price
        volume
      }
    }
    orders {
      side
      size
      status
      price

      party {
        id
      }
    }
  } 
}
ettec commented 2 years ago

Awesome thanks. I can reproduce locally using v1 datanode, v2 seems OK. Looking into v1.

TomMcL commented 2 years ago

Reproducing is good, not just me! Thanks