Increase position size
Increase position size

gTrade · Acts onchain

Adds to an open gTrade trade at the market, on the trade's own side: collateral at the leverage stated for it, or, with no collateral, that much more leverage on the trade's own collateral. The diamond's increasePositionSize pulls the collateral and records a pending increase, refusing one whose blended leverage falls outside the pair's bounds or a trade opened before gTrade's tenth version. The oracle network answers in a later block, folding the addition into the trade at a blended open price if the price falls within the slippage of the one stated, and returning the collateral otherwise. gTrade keys every book on its trader. A program on a Plug account apart from its wallet acts on the wallet's own book: the Plug account calls the diamond's delegatedTradingAction naming the wallet, which runs the call as the wallet, so collateral is pulled from and proceeds are paid to the wallet and every trade stays the wallet's. The wallet's one standing grant is setTradingDelegate naming its Plug account, sent with its approvals before the first program that needs it; a wallet that is its own socket trades as 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