Increase position size
Increase position size

Avantis · Acts onchain

Adds collateral and size to an open Avantis trade at the market, on the trade's own side. The trader approves TradingStorage for the collateral and calls the Trading router's increasePositionSize, which pulls it in and records a pending increase at the leverage stated for the added collateral. The router refuses an addition below the pair's minimum leveraged position or outside its leverage bounds, and a pair in close-only mode. A keeper executes the increase in a later block, folding the addition into the trade at a blended price if the oracle price falls within the slippage of the price stated, and refunding the collateral otherwise. The order id this returns names that pending increase; the trade keeps its size until a keeper has executed it. 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 scale into a position as a condition is met, coiling the collateral from a swap or a claim.

On other protocols · 1