Live on testnet. Mainnet coming soon.
Why this is hard on public DEXes
On a public AMM, a TWAP is observable, order size, schedule, and direction leak the moment the first tranche hits the chain. Bots front-run subsequent tranches; market makers widen spreads against the predictable flow. Private TWAP removes the leak. The user signs an order, encrypts it to the TWAP service’s ECIES public key, and submits. The service pulls all funds upfront in a singletransferFrom (on-chain observers see one lump transfer, not a TWAP pattern). It then drips tranches on the user-defined schedule, creating a BridgeIntent on the source-chain bridge contract for each tranche. Solvers fulfill each tranche independently; destination deliveries land on stealth addresses.
How it works (integrator view)
- Fetch the TWAP service’s ECIES public key (one-time setup)
- Build a signed order with total amount, per-period amount, period length, start/end time, recipient(s), and source/dest chain + asset
- Encrypt the order with the TWAP ECIES pubkey
- Sign a personal-sign message proving ownership
- POST to the TWAP service, it decrypts, verifies the signature matches the
userfield, pulls funds, and schedules the first tranche
What’s confidential
- Total order size, not deducible from individual tranche amounts, since observers can’t link tranches to each other
- Schedule beyond the current tranche, remaining tranches aren’t telegraphed
- Per-recipient amounts, split between recipients is stored encrypted in the relayer
- Destination addresses, each tranche settles to a fresh stealth address on the destination chain
transferFrom from user to the TEE wallet on the source chain (a single on-chain transfer). This hides the TWAP pattern but does reveal that the user handed off some amount to the TEE at one point.
Order parameters
The parent order shape (TWAPOrderParams):
totalTranches = totalAmountIn / amountPerPeriod(integer division, minimum 1)- Per-tranche solver reward: 5% of
amountPerPeriod, deducted from the tranche - Per-tranche auction duration:
period / 2(minimum 20 seconds) expectedAmountB(min-output on destination): sum ofamounts[]
Slicing strategy
Today, TWAP is fixed-time / fixed-size: you specifyamountPerPeriod and period. The service divides totalAmountIn into equal tranches and fires one every period seconds until either totalAmountIn is spent or endTime passes, whichever comes first.
Variable-cadence and variable-size strategies are not currently supported.
Integration shape (SDK, planned)
Cancellation
You can cancel an active order at any time. Already-fired tranches continue to their own settlement (they were independent BridgeIntents), but no further tranches are scheduled. Funds not yet dripped remain in the TEE’s custody and can be returned or carried forward per your cancellation flow.Try it
Open the hosted TWAP app
Place a TWAP without writing code.
TWAP integration guide
Step-by-step integration using the raw TWAP service API.