From 4d5e5c95fb9a80d08c31d9bf16b96455a4d2f422 Mon Sep 17 00:00:00 2001 From: wwestgarth Date: Mon, 17 Jun 2024 16:35:44 +0100 Subject: [PATCH] fix: use asset-scaled AMM fair-price for rebase check on submission --- core/execution/future/market.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/execution/future/market.go b/core/execution/future/market.go index 5972da1f0de..5c8ecfaa1e2 100644 --- a/core/execution/future/market.go +++ b/core/execution/future/market.go @@ -5438,7 +5438,7 @@ func (m *Market) SubmitAMM(ctx context.Context, submit *types.SubmitAMM, determi } // create a rebasing order if the AMM needs it i.e its base if not within best-bid/best-ask - if ok, side, quote := m.needsRebase(submit.Parameters.Base); ok { + if ok, side, quote := m.needsRebase(pool.BestPrice(nil)); ok { order, err = m.getRebasingOrder(quote, side, submit.SlippageTolerance, pool) if err != nil { m.broker.Send(