Fraxfinance

Fraxfinance uses Fraxswap TWAMM orders to spread token sales over time at changing prices

Fraxfinance uses Fraxswap’s time-weighted average market maker (TWAMM) to schedule token sales without fixing their exchange price. An order specifies its input amount and execution period, while changing pool conditions determine its proceeds. The recorded expiry and collected balance of the buying token describe separate parts of settlement.

· last updated

Even Sales and Changing Pool Prices

Fraxswap combines a constant-product automated market maker (AMM) with long-term orders whose input sells at a scheduled rate. The AMM holds reserves of both tokens and uses their relationship to calculate swap output. Selling into those reserves changes the pool price. Spreading a sale across time gives other trading activity opportunities to alter the reserves between portions of that sale. Arbitrage trades can bring the pool price closer to prices elsewhere, provided profitable opportunities attract execution.

The order controls how much input enters that process over its effective lifetime. It does not control how much output each portion purchases. Changes in liquidity, opposing orders and wider market prices influence the eventual exchange rate. A longer schedule lowers the input sold per unit of time for the same deposit. That can soften immediate price impact, while extending exposure to market movements. More time alone cannot establish which schedule produces the most output.

When Does a Price Floor Rule Out Core TWAMM Orders?

A price floor rules out an unprotected core TWAMM order when every sale must satisfy a minimum exchange rate. Its long-term swap functions take an input amount and interval count, without an order-wide minimum-output parameter. A starting estimate therefore describes an expectation, not an enforceable future fill. Cancelling an active order can stop further selling, but cannot reverse completed sales. A displayed tolerance establishes a price floor only if the relevant execution logic enforces it across the schedule.

Fraxfinance - When Does a Price Floor Rule Out Core TWAMM Orders?

Open full-size image

Order Duration and Hourly Expiry

The recorded expiry determines the effective sale period, which can differ from a simple count of requested hours. The constant-product Fraxswap pair uses a 3,600-second order-expiry interval. Its calculation adds one more interval than requested to the boundary at or before order creation. The remaining portion of the current interval therefore contributes to the duration. The selling rate uses the funded input and the actual time remaining until expiry, with fixed-point rounding.

The stored creation and expiry timestamps identify the schedule precisely. An interface label may summarize that schedule more loosely.

Virtual orders represent accumulated trading calculations, without a separate wallet transaction for every tiny sale. During normal operation, the pair updates those calculations before relevant AMM interactions. An inactive pool can consequently have stored accounting behind the elapsed clock. The next qualifying interaction brings execution forward through intervening expiries. A live order’s displayed progress needs to distinguish that stored state from an estimate accounting for elapsed virtual trading.


A Time-Spread Conversion With a Required Output Balance

A conversion intended to supply a particular buying-token balance needs that requirement defined before choosing scheduled execution. If the fixed input must purchase that balance, the core order cannot enforce the necessary output bound. Where variable proceeds are acceptable, the order can spread the conversion across time. Its collected output still determines whether the intended balance requirement is met.

  • Confirm the pair contains the selling and buying tokens, has usable reserves and accepts new TWAMM orders.
  • Establish sufficient input balance and authorization for the deposit. Then create the order with the chosen input amount and interval count; token approval alone does not create it.
  • Match the created order’s owner, token direction and recorded expiry to the intended sale schedule.
  • Distinguish an active, expired or cancelled order before interpreting the amount available for collection.
  • Compare the buying tokens actually received from all withdrawals and any cancellation with the required output balance, keeping returned selling tokens separate.

The deposit becomes scheduled input, and executed sales accrue proceeds in the buying token. Collection transfers those proceeds out of the pair. An order can close with less output than the intended use requires. Returned input retains its original denomination and cannot count toward the buying-token balance.

How Do Cancellation and Withdrawal Change an Order?

Cancellation ends an active sale and returns unsold input together with uncollected proceeds in the buying token; withdrawal collects proceeds without necessarily ending execution. The cancellation calculation requires an order still active in the pair’s virtual-order accounting. Once normal execution reaches expiry, proceeds withdrawal handles the completed order. Amounts collected earlier remain separate from what either operation transfers later.

The order owner can withdraw accrued proceeds without changing an active order’s remaining sale schedule.

The constant-product pair also has a factory-controlled TWAMM pause path. Once activated on a pair, that irreversible pause rejects new long-term orders and skips virtual execution. Both operations require the recorded owner. Proceeds withdrawal reverts if no uncollected proceeds remain; cancellation requires unsold input or uncollected proceeds. An expected end time consequently cannot establish settlement during a pause. The pair’s accounting state determines the available amounts, and an unchanged clock-based estimate can misrepresent them.

The pair marks an order complete after cancellation or an expired-order proceeds withdrawal. That closure flag can describe either a partly executed, cancelled sale or a finished schedule. It does not certify a particular exchange rate or output target. The received token balance establishes how many tokens the owner collected.

Proceeds calculations need virtual-order accounting aligned with the relevant timestamp. A raw stored-state read can show stale proceeds after inactivity. The getTwammOrderProceeds function updates execution before calculating proceeds during normal operation. Its read-only counterpart, getTwammOrderProceedsView, relies on existing accounting. A displayed claimable amount describes a claim against the pair. It becomes a received balance only through the token transfer.


Pool Fees and Transaction Costs

The pool’s trading fee affects swap proceeds, while contract transactions carry separate network costs. Authorized fee settings can change, so a fee quoted when creating an order need not describe its entire lifetime. Virtual execution avoids a transaction for every conceptual sub-order. Creating an order, collecting proceeds or cancelling still involves contract execution and can incur gas costs. Duration alone cannot establish the cheapest conversion, because the market price path and settlement actions also affect the overall cost.

TWAMM Execution, Spot Swaps and TWAP Measurements

A spot swap executes against the pool during a transaction, while a TWAMM order distributes its input across time. Fraxswap’s regular spot router supports minimum output for an exact-input swap. That bound lets the transaction reject output below the specified amount. The core long-term order has a different purpose: committing input to a schedule with variable proceeds. Neither mechanism removes pool price impact. Their execution boundaries differ, which matters when a required exchange rate outweighs the benefit of spreading input.

A time-weighted average price (TWAP) measures prices across an interval. TWAMM names the market-making mechanism used to execute scheduled orders. Similar terminology does not make an order’s realized exchange rate equal to an external TWAP. Pool depth, fees and arbitrage conditions affect that relationship. A stablecoin target also does not fix every pool execution at its peg. The spot router’s amountOutMin bounds transaction output; a TWAMM expiry timestamp bounds its sale schedule.

Practical questions about Fraxfinance

Does a Fraxswap TWAMM Deposit Earn liquidity-provider Fees?

A TWAMM deposit creates a trading order, not a liquidity-provider position. Liquidity providers receive pool-share tokens through the separate liquidity process. The buying tokens an order accrues are sale proceeds. They do not represent interest or a share of trading fees merely because the accounting code uses reward terminology.

Can Someone Else Collect My TWAMM Proceeds?

The core pair restricts withdrawal and cancellation to the recorded order owner. For a direct order, that owner is the calling wallet; if another contract creates the order, that contract owns it. A frontend connection does not override this permission check. Integrations must provide their own authorized collection path.

Are Fraxswap long-term Orders Private?

The pair exposes long-term order details publicly, including the owner, token direction, sale rate and expiry. A TWAMM schedule therefore reveals planned trading activity to other market participants. Spreading execution over time does not conceal the order, and other traders can respond to visible buying or selling pressure.

Is an Existing Fraxswap TWAMM Order Editable?

The core long-term-order record fixes its token direction, sale rate and expiry at creation. Its cancellation and withdrawal functions do not edit those terms. A changed trading plan can require a replacement order, with its own execution history. Cancellation cannot reverse sales the earlier order already completed.

How Does a transfer-tax Token Affect the TWAMM Input Amount?

The pair sizes a new long-term order from the increase in its token balance after transfer. A token with transfer deductions can therefore fund an order with less than the amount sent by the wallet. The creation event reports the funded input. Token-specific transfer rules can also affect amounts received when proceeds leave the pair.

Which Amounts Belong in an Average TWAMM exchange-rate Calculation?

Calculate the order’s average exchange rate by dividing its recorded buying-token proceeds by the selling tokens actually exchanged. Include prior payouts recorded by the pair and any uncollected proceeds. Exclude returned unsold input and normalize both token amounts for their decimals. Transfer deductions can reduce wallet receipts below recorded payouts; network gas remains a separate cost.

Will a Fraxswap TWAMM Order Keep Selling While My Wallet Is Offline?

An active long-term order does not require the wallet to remain online for scheduled virtual trading. The pair accounts for elapsed execution through its contract interactions, subject to its pause state. Closing the browser neither cancels the order nor collects proceeds. Withdrawal still requires authorization from the recorded owner.