
Avantis · Reads onchain state
Reads the fee rate an Avantis pair charges to close a position of a given size on a given side, as a fraction of the position. PairStorage's pairCloseFeeP charges the pair's maker rate when the close moves the pair's open interest toward balance between longs and shorts, and its taker rate when it moves it away. The size is in the pair's base asset. Reach for it to time a close for the cheaper rate.