Update limit order

Update limit order on Avantis

Base
Base

Acts onchain

Moves an open Avantis limit or stop limit order to a new trigger price, slippage, take profit and stop loss. The Trading router's updateOpenLimitOrder rewrites the order in the trader's book in the same block; its collateral, side and leverage stay as placed. The take profit must sit beyond the new trigger on the order's winning side and the stop loss on its losing side, zero for none, and a pair in close-only mode refuses the update. Avantis keys every book on its trader, the address that sent the order, so an entry is acted on only by its own trader: an entry of the Plug account's book runs in the Plug account's program, and an entry of the wallet's own book is a call the wallet sends itself. Reach for it to trail an entry behind a moving price, or to tighten an order's exits as a condition changes.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

More on Avantis · 37