Fraxswap Virtual Order Execution and Unexpected Gas
Virtual order execution is a pair’s catch-up processing of long-term sells, and it can make an ordinary Fraxswap action use more gas when several expiry intervals have passed since the last settlement. The extra work is computation for pending trades, not an additional fee paid to the protocol.
What Virtual Order Execution Means
A virtual order is the portion of a running long-term sell that is due to have happened but has not yet been applied to the pair’s reserves. The order is virtual because its progress is accounted for over time, while the pair processes that progress on a later interaction.
Swaps, liquidity changes and order actions settle pending virtual orders before carrying out the new action. If you are placing a long-term order, knowing that Fraxswap uses this mechanism matters because it explains why a later, unrelated swap can trigger work created by orders already running in the pool.
Settlement brings the pair’s reserves up to date with the eligible portions of those sells. Your instant swap then prices against the reserves after that update, so its quote can differ from one based on the reserves before settlement. The swap is not simply charged extra gas while trading against an unchanged pool.
Why The Next Action Can Cost More
The gas increase depends on how many order expiry intervals have passed since the pair last settled its virtual orders. Each interval crossed adds processing work. A pool touched soon after its previous settlement may have little catch-up to do; after a long idle period, the next interaction may need to process several intervals.
The first user action that reaches the pair triggers that catch-up. That user’s transaction pays the gas for the additional computation, even though the pending orders belong to other traders. The gas is part of executing the transaction on the network; it is not an extra protocol fee charged to the person whose long-term order is selling.
For example, suppose an active pool has had no interaction for a while. The next swap can cost more because it settles the missed intervals before swapping. If the pool had instead been touched more recently, fewer intervals would be pending, so this catch-up portion would be smaller. The core point remains the same: pending virtual orders are settled on interaction, and whoever interacts first bears the gas for that work.
This cost only applies where active long-term orders have pending virtual execution. A pool without active long-term orders has no such order catch-up to add to an ordinary action. So an unusually high gas estimate can be consistent with the pool’s state, rather than evidence of an extra fee or a problem with your order.
Three Details That Clarify The Catch-Up
The key distinction is between an order’s elapsed time and the pair’s last settlement: elapsed time creates pending work, while an interaction causes the pair to process it.
How can I see how much of my long-term order has sold so far?
Look at the order’s recorded progress or remaining amount in the interface you used to place it. That tells you what the order reports as sold or still available; the pair may still need a later interaction to apply pending virtual execution to its reserves.
Does a long-term order keep selling past its end time if nobody touches the pool?
No. The order is eligible to sell only through its configured end time. If no one interacts while it is active, a later interaction can settle the eligible pending intervals up to the end; it does not extend the order beyond that time.
Does virtual order execution behave the same on every network Fraxswap runs on?
The general catch-up idea is the same where pairs use virtual orders, but interval settings and transaction gas conditions can vary by network and pool. The number of intervals determines the order-processing work; the network determines the gas cost of that work.
Comments
Post a Comment