
Avantis · Reads onchain state
Reads the price at which an open Avantis trade is liquidated, at the block the plug runs. The program reads the trade from TradingStorage and asks PairInfos' getTradeLiquidationPrice for it: the price at which the trade's collateral, less the borrowing fees it has accrued and the funding it owes at the pair's last funding price, falls to Avantis' liquidation threshold. Fees accrue every block, so the price moves toward the market as the trade is held. Reach for it to add margin or close before a keeper liquidates the trade, comparing it with a live price.