Get liquidation price

Get liquidation price on Avantis

Base
Base

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.

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