Get open trades count

Get open trades count on Avantis

Base
Base

Reads onchain state

Reads how many trades a trader holds open on an Avantis pair. TradingStorage's openTradesCount counts the trader's open trades on the pair; Avantis holds at most its per-pair maximum of trades, pending opens and limit orders together. Reach for it to tell whether a market order a keeper has filled opened its trade, comparing the count with its value before the order, or to cap how many trades a strategy keeps open.

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