How it works
Conditional orders on Uniswap v4 pools, settled by a contract that proves its own profitability.
The idea
You hold a token on Arc and want to sell it if the price crosses a line. Today the only tool is a market swap you have to send yourself, at the moment you happen to be awake.
This is the missing half: you describe the order once — a pool, a price threshold, a direction, an amount — and it sits on-chain until the condition is true. Your tokens never leave your wallet until the moment of the fill. There is no deposit, no vault and no custodian.
The life of an order
You approve the exact amount (not an unlimited allowance) and call createOrder with the pool, the trigger tick, the direction, and the minimum you are willing to receive. Nothing moves. The order is a row in a mapping.
A keeper watching the pool sees your trigger is met and calls armOrder. The contract re-reads the pool’s own tick — it does not take the keeper’s word — and records the block. Still nothing moves.
The order cannot fill for 5042002’s configured dwell period after arming. This is the anti-manipulation window, explained below.
The keeper calls execute. The contract re-derives the trigger from the pool a second time, pulls your tokens, routes the swap it builds itself, measures what actually arrived, and pays you — but only if the fee it collected exceeds the gas that call burned.
Why the fee has to cover the gas
On most chains, an executor’s profitability can only be estimated off-chain: gas is paid in the chain’s native asset, proceeds arrive in the traded one, and comparing them needs a price feed and carries basis risk.
On Arc, gas is USDC and proceeds are USDC. So the comparison is arithmetic on two numbers the EVM already exposes, and the contract can refuse a fill that would not pay for itself:
cost = (gasConsumed + 21000 + calldataBytes*16 + settlementOverhead) * tx.gasprice revert unless fee >= cost + margin
Intrinsic gas and calldata come from the EVM’s own rules rather than a hand-tuned constant, so you can check the floor by reading the contract instead of trusting whoever runs the keeper. The practical consequence: orders below roughly two USDC of proceeds are not fillable, because the fee cannot cover the gas.
Why a price spike cannot trigger your order
The trigger is a Uniswap v4 tick, and a tick can be pushed anywhere inside a single transaction by someone willing to trade against the pool. If the contract checked the price once, an attacker could shove it through your stop, fill your order at a price that never really existed, and put the pool back — all atomically, with no risk.
So observation and execution are split across blocks. Arming records the trigger in one block; filling re-derives it in a later one. A spike that is reverted inside one transaction cannot satisfy both, because they cannot land in the same block.
Honest limit: this proves the trigger was true at two separate instants, not that it held continuously between them. It removes the free, risk-free version of the attack; it does not make manipulation impossible for someone willing to hold a position across blocks.
Fees, caps and limits
The protocol fee is taken from the proceeds and is capped in the contract — the owner cannot raise it past the ceiling, and your minimum-received bound is checked against what you actually receive, after the fee.
Two exposure caps are enforced on-chain: a maximum per fill, and a maximum cumulative across all fills ever. They bind on realised USDC proceeds, which is exact and needs no price oracle. Live values are on the status page.
Networks
Testnet is the sandbox. It has a faucet token and a pool whose price is driven by a script, so you can set a real order and watch a real keeper fill it without risking anything. The token is worthless on purpose.
Mainnet is the real deployment against real Uniswap v4 pools, with the exposure caps set deliberately low. There is no faucet there because there is nothing to hand out.
What can go wrong
- The keeper can stop. Nothing fills if nobody is watching. That is why liveness is shown rather than assumed — check the status page before relying on an order.
- Small orders will not fill. If the fee cannot cover the gas, the contract refuses. This is the design working, but it means a stop-loss on a tiny position is not protection.
- The cumulative cap does not reset. Once lifetime fills reach it, further fills stop until the owner raises it.
- Thin pools move. The fill trades against a real pool, so a large order moves the price against itself. Your minimum-received bound is the protection, and you choose it.
- It has not been audited by a firm. It went through an adversarial review that found and fixed two fund-loss issues, and it is covered by 71 tests against a mainnet fork — but that is not the same thing, which is why the caps exist.