Skip to main content
Blockchain Today

Crypto markets, protocols and policy

Fraxswap long-term orders: how the TWAMM fills them

How long does a Fraxswap long-term order take to execute? It runs for your chosen intervals, with the end set on an interval boundary and proceeds available to withdraw.

By Blockchain Today Editorial4 min read

Fraxswap long-term orders: how the TWAMM fills them

A Fraxswap long-term order runs for the number of time intervals you choose, selling at a steady rate until its end interval; its total elapsed time can include the remainder of the interval in which you place it.

How does a Fraxswap long-term order start and fill?

A Fraxswap TWAMM order starts when you submit tokens to a Fraxswap pair contract with an interval count. The contract sets a sell rate by dividing your amount by the order’s duration, then treats the order as a stream of virtual trades against the pool.

The order direction determines which token you sell: longTermSwapFrom0To1 or longTermSwapFrom1To0. The TWAMM’s continuous virtual trades are a way to model many tiny trades over time without submitting each one separately. The pair calculates their cumulative effect when someone interacts with it.

  • Input: tokens and a number of time intervals.
  • Process: a constant sell rate, represented as virtual trades against the pool.
  • Output: proceeds held for withdrawal after expiry or cancellation.

Those pieces connect through the pair’s clock: it sets when the sale stops, while interactions update the pool to account for virtual trades since the previous interaction. Fraxswap’s technical specifications say long-term orders are processed before other pair interactions, once per block. The underlying idea follows Paradigm’s 2021 TWAMM paper, which describes calculating the cumulative effect of virtual orders when needed.

How long does the order take in real time?

The chosen interval count sets the planned duration, but interval boundaries determine the exact elapsed run time. Multiply the number of intervals by the pair’s interval length, then account for the remainder of the current interval when the order is placed.

For instance, take an order for N intervals submitted partway through the current interval. Its end is aligned to an interval boundary, so the order runs for N full intervals plus that leftover portion. Depending on when during the current interval you place it, elapsed time falls between N and N+1 intervals. This is the timing detail that helps you estimate when to return to withdraw.

The pair’s interval length is the clock to use for that calculation. The Fraxswap TWAMM documentation describes aligned expiries, including hourly alignment; the relevant interval length is set by the pair. The interval count alone therefore does not tell you the exact number of minutes or hours from submission to expiry.

How does the fill rate affect price impact?

A longer run divides the same order amount into smaller slices, which means each slice exerts less price impact than a single trade of the full amount, all else equal. The total result still depends on the pool and market conditions while the order runs.

That difference matters most when you are weighing a fast, single swap against a paced order. A single swap sends the full amount into the pool at once; a TWAMM spreads selling over time. Smaller slices can soften the impact of each piece, while the longer wait leaves the order exposed to changing pool prices and other trades.

Fraxswap’s long-term orders change a large sale from one pool interaction into a stream of virtual trades; fraxswap.co is the venue context behind that pacing choice. The trade-off is time: smaller slices can reduce the impact of each individual execution, but the order remains active until its end boundary unless you cancel it.

What happens when you cancel or the order expires?

When a Fraxswap long-term order expires or you cancel it, use withdrawProceedsFromLongTermSwap to collect proceeds attributed to the order. Expiry marks the scheduled end; cancellation stops the remaining sale early, so you can withdraw rather than wait for the original endpoint.

The execution model is different from manually placing a series of ordinary swaps: the TWAMM handles the pacing, and pair interactions account for the virtual trades in aggregate. That is useful when a large trade can run over time, but it also means the displayed interval count should be read alongside the pair’s interval length and the current position within that interval.

For a repeatable estimate, note the pair’s interval length, count the requested intervals, then add the remainder of the current interval. That calculation gives you a practical withdrawal window and saves a return trip based on the interval count alone.