Skip to main content

Three ideas

A signed promise. A resolver does not send tokens when it quotes. It signs a message that says: “I will give 15,508.06 USDC to whoever hands me 25,000,000 cNGN, if it happens before 12:00:30 and only if the person executing is wallet 0xTaker.” That message costs nothing to make and is worthless to anyone except that taker. Pull by signature. Permit2 is a contract, deployed by Uniswap at the same address on every EVM chain, that lets a token holder authorize a transfer with a signature instead of a transaction. The resolver approves Permit2 once. From then on Permit2 moves the resolver’s USDC only when shown a valid resolver signature naming the exact amount, the exact spender, a one-time nonce and a deadline. The USDC stays in the resolver’s wallet until the moment it is pulled. One transaction. The settlement transaction checks the resolver’s signature, pulls the resolver’s USDC to the taker, then pulls the taker’s cNGN to the resolver and the fee to the treasury. All of that is one atomic unit. There is no moment where one side has paid and the other has not.

One swap on Base

A taker sells 25,000,000 cNGN. Mid is 1,612. A resolver quotes 1,612.05, which is 15,508.06 USDC. The protocol fee is 5 bps of the USDC, 7.754030 USDC. The keeper’s gas for this fill is quoted at 0.10 USDC. The taker nets 15,500.21 USDC and never touches ETH. If anything in steps 8 to 10 fails, the transaction reverts at that point and everything before it is undone. The keeper paid gas and nothing else. There is nothing to refund.
First-time approvals. Permit2 can only pull a token the taker has approved to it once. USDC implements EIP-2612, so that approval is a signature the executor submits inside the same transaction. cNGN does not, so a first-time cNGN seller sends one small approval transaction. After that every swap is gasless.

On Solana

Solana settles through a vendored copy of Jupiter’s audited order-engine program. The resolver signs the settlement transaction as maker when it answers the request. The taker co-signs. The relay’s keeper signs last as fee payer and submits, so the taker needs no SOL. The taker repays the keeper in the pair’s dollar token inside the same transaction. See Solana settlement.

Why funds are safe

  • Nothing is prefunded. Both sides’ tokens sit in their own wallets until a valid signature pulls them.
  • The taker’s signature is a contract. It names the exact offers, recipient, minimum proceeds, maximum gas fee and deadline. The executor reverts if any of those is not met.
  • An offer is useless to anyone but its taker. Front-running an offer is impossible.
  • An offer dies at its deadline, and a signature can be used once. Permit2 enforces both.
  • Neither the reactor nor the executor keeps tokens. Both end every call with a zero balance, enforced by a fork test on every commit.
  • The fee can never exceed 5 bps. The reactor rejects any fee output above that.
  • The keeper is a convenience, not a gate. Anyone holding the offers and the taker’s authorization can submit. The taker can submit it themselves with a zero gas fee.
The full list of invariants is under Security model.