vegaprotocol / vega

A Go implementation of the Vega Protocol, a protocol for creating and trading derivatives on a fully decentralised network.
https://vega.xyz
GNU Affero General Public License v3.0
38 stars 22 forks source link

fix: an AMM waiting for a data source cannot be set to reduce only #11749

Closed wwestgarth closed 1 month ago

wwestgarth commented 1 month ago

Fix for a panic on the overnight market-sims. If someone amends their AMM to use a data-source, and the old base is out of range of the new lower/upper bounds, the AMM gets kicked into a pending state. If that person then wants to cancel the AMM into a reduce only mode, we can't, because there are no AMM curves yet until a data source price comes in.

We previously set the AMM status to reduce only and then would panic when an order come in to trade against empty curves.