
gTrade · Acts onchain
Cancels a gTrade market order the oracle network has not answered within the diamond's market order timeout. The diamond's cancelOrderAfterTimeout closes the pending order once the timeout's blocks have passed since it was placed, refusing it earlier, and pays back the collateral an open, an increase or a leverage increase escrowed. 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 recover collateral stuck behind an order that will never fill.