
gTrade · Reads onchain state
Reads one of a trader's gTrade counters at the block the plug runs. The diamond's getCounters returns, for the trader's trades and open orders or for their pending market orders, the next index it will hand out and how many are open now. An open count that rises after an order was placed means it filled; one that falls means a trade closed. Reach for it to wait for a market order to fill before acting on the trade, or to act once a trader holds no open trade.