Definitive Logo
APIDocsEDGE TokenTeamBlog
Launch App
← Back to blogguide

How to Execute a TWAP Order Onchain (Step-by-Step)

Apr 2026 · 7 min read

A TWAP (Time-Weighted Average Price) order splits a large trade into smaller slices executed at regular intervals, reducing market impact and averaging your entry price over time. On Definitive's onchain trading terminal, you can configure and run TWAP orders fully onchain — without paying gas — across 100+ DEXs.

What You Need Before Placing a TWAP Order

Before you execute a TWAP order, make sure the following are in place:

1. A connected wallet Definitive supports any EOA wallet, plus institutional custody solutions including Fireblocks, Fordefi, Safe (multisig), and Squads. Connect whichever wallet holds your funds.

2. Sufficient token balance Your source token needs to be available in your connected wallet. Definitive sponsors gas on all supported chains, so you do not need native tokens (ETH, MATIC, etc.) to cover transaction costs — but you do need the asset you intend to sell.

3. Chain selection Definitive supports Base, Arbitrum, Ethereum, Optimism, Polygon, Avalanche, BNB, HyperEVM, and Solana. Confirm which chain holds your assets before you begin.

4. A clear trade rationale TWAP works best for large orders where a single market swap would move the price against you. Know your target token, your total size, your intended duration, and your acceptable slippage range before you configure anything.

5. Understanding of TWAP mechanics Each slice is executed as an independent market order at the best available price at that moment. Your average fill price will reflect market conditions across the entire execution window. Read What is a TWAP Order in Crypto if you want a deeper grounding before proceeding.

Step-by-Step: Executing a TWAP Order on Definitive

Follow these steps to place a TWAP order on Definitive's onchain trading terminal.

Step 1: Navigate to the TWAP order type Log in to definitive.fi and connect your wallet. From the trading interface, select "TWAP" from the order type menu. You'll see fields for input token, output token, total size, duration, and number of slices.

Step 2: Select your trading pair Choose the token you want to sell and the token you want to buy. Definitive routes through 100+ DEXs and 15+ offchain PMMs (private market makers) to find the best available price for each slice.

Step 3: Enter your total order size Input the full amount you want to trade. This is the aggregate size — Definitive will divide it into equal slices based on your configuration.

Step 4: Set your total duration Choose how long the TWAP should run. Options typically range from minutes to several hours. A longer duration means more slices at lower individual size, providing smoother price averaging but more exposure to directional drift.

Step 5: Set your number of slices Determine how many individual trades the TWAP will execute. More slices means smaller individual orders and less market impact per execution. Fewer slices means faster execution but more price concentration.

Step 6: Configure price limits (optional) You can set a minimum acceptable price per slice to prevent execution during unfavorable spikes. This is an optional guardrail — leaving it blank means each slice executes at market best available.

Step 7: Review and confirm Definitive shows you a summary: total size, slice size, estimated duration, number of executions, and any applicable fees. For major assets on Ethereum, Base, Arbitrum, and Solana, trading is free. For other assets, fees range from 85 bps (T5) down to 25 bps (T1) with staked EDGE.

Step 8: Sign and submit Sign the transaction with your wallet. Definitive handles gas sponsorship — no ETH or native token balance required. The TWAP begins executing immediately.

Choosing Your Time Interval and Slice Size

Interval and slice size are the two primary levers that determine your TWAP's effectiveness. Getting them right depends on liquidity depth, your total order size relative to daily volume, and how much time-exposure you're comfortable with.

For liquid, high-volume pairs (ETH, BTC, large-cap alts): Shorter durations (15–60 minutes) with 10–20 slices are usually sufficient. Liquidity is deep enough that impact is minimal, and a shorter window reduces drift risk.

For mid-cap tokens: Use 1–4 hour windows with 20–40 slices. On-chain liquidity can be thinner and more volatile, so spreading execution reduces your average slippage.

For low-liquidity or long-tail tokens: Be cautious with TWAP. Large orders relative to available liquidity can move the price with each slice, especially if your interval is short. Consider longer windows of 4–12 hours with smaller individual slices, and set price limit guardrails.

General rules of thumb:

  • Keep individual slice size below 1–2% of available liquidity depth when possible
  • Longer durations reduce impact but increase directional risk — if the asset moves hard against you, you're still executing into it
  • Shorter durations reduce time-risk but concentrate slippage

Definitive routes each slice through its smart order routing engine across all integrated DEXs and PMMs. This means each slice benefits from optimal routing, not just the single deepest pool.

Monitoring Your TWAP Execution

Once your TWAP is live, Definitive provides real-time tracking directly in the trading interface.

What you can monitor:

  • Slices completed vs. remaining
  • Average fill price so far
  • Per-slice execution price
  • Estimated completion time
  • Total fees incurred

How to interpret execution quality: Compare your average fill price to the spot price at the time you initiated the order. If markets have moved favorably during execution, your average price will be better than the initial spot. If markets have moved against you, the TWAP still protected you relative to what a single market order would have done at the start.

Cancelling a TWAP mid-execution: If market conditions change, you can cancel a running TWAP at any time. Slices already executed are final — only pending slices are cancelled. Definitive confirms the cancellation onchain.

Post-trade reporting: After your TWAP completes, the full execution is recorded in Definitive's post-trade reporting module. You get a complete breakdown of each slice: timestamp, fill price, size, DEX routed through, and fees. This feeds directly into Definitive's onchain PnL tracking, which is useful for portfolio accounting and tax reporting.

Frequently Asked Questions

What is a TWAP order in crypto?

A TWAP (Time-Weighted Average Price) order breaks a large trade into smaller, equally-sized slices executed at regular time intervals. The goal is to approximate the average market price over the execution window, reducing market impact compared to a single large order.

Can I run a TWAP order without paying gas?

Yes, on Definitive. Definitive sponsors gas on all supported chains, so you can execute TWAP orders — including all individual slices — without holding native tokens for gas. See What is Gasless Crypto Trading for how this works.

How does TWAP differ from a limit order?

A limit order executes only when the price reaches your specified level — it's price-conditional. A TWAP executes on a time schedule regardless of price, spreading execution across intervals. You can combine them by adding price guardrails to a TWAP.

What happens if one of my TWAP slices fails?

If a slice fails due to slippage exceeding your configured tolerance or a routing issue, Definitive will typically retry or skip that slice depending on configuration. Your total order size is unaffected by failed slices — only executed slices count toward your fill.

Is TWAP better than a single market swap for large orders?

For orders above roughly 0.5–1% of available liquidity, TWAP typically produces better average prices than a single market swap. The exact threshold depends on the asset and chain. Definitive's smart order routing helps reduce impact on each slice, compounding the benefit.

Ready to trade onchain with institutional-grade execution? Try Definitive — gasless, multichain, and built for serious traders.




Definitive Logo

©2025 All Rights Reserved