Repository navigation
Releases
v2.3.0
Dutch auctions with a falling premium.
- An order rests at its floor, the maker's minimum output. Flash fillers pay a premium on top that falls in a straight line to zero.
startAuction(order, startAmountOutMin, duration)starts it, andauctionPremium(order)reads it.- Plain fills wait until the premium ends. Book matches and pool fills pay the floor. A reprice ends the premium.
- No keeper and no stepping. After the auction the order is a plain good-till-cancelled order.
Testnet hooks:
- Unichain Sepolia:
0x91678C5047d8dc94C0fe56c45e663B8e6aa66888 - Robinhood testnet:
0x91d20e82b2327075e90C8377DBF29BaAF8bb2888
v2.2.0
v2.1.0
v2.0.0
Async Swap v2.0.0 adds flash fills and non-numeraire pools, so any asset can trade for any asset through the order books with no filler inventory. It is a new hook and Router deployment; v1 hooks are unchanged and stay indexed.
What's new
- Flash fills (#94):
Router.fillOrderWithCallbackcredits an order's input to the filler as ERC-6909 claims, callsIAsyncSwapFlashFiller.asyncSwapFlashFillinside the Router's PoolManager unlock, then collects the maker's output as claims. Inside the callback the filler can route through any v4 pool and fill other orders withfillOrderInCallback/matchBookInCallback. Integrators call these throughIAsyncSwapCallback(router). - Non-numeraire pools (#95): a pool such as ETH/AMD can be opened once both tokens have a numeraire pool on the hook with the same tick spacing.
currency1is its quote side, each side's minimum is the token's decimal floor, and it takes no priority bid. - Layout under EIP-170 (#95): the Router's flash surface lives in a
RouterFlashFillsmodule run by DELEGATECALL; the hook's side and pool setup live in the new linkedMultiAssetlibrary.
Validation
| Result | |
|---|---|
| Full Solidity suite (solc 0.8.26, as CI) | 1,123 tests passed |
| Invariants | 64 runs × 64 actions |
| Production sizes and formatting | Passed (AsyncSwap 23,825 B, Router 24,337 B, AsyncMatching 24,070 B) |
Testnet deployments (#97)
| Unichain Sepolia (1301) | Robinhood testnet (46630) | |
|---|---|---|
| AsyncSwap | 0x919Dc5DD035Ad1E4D58250691E2840724e0De888 |
0x91c8C21285a3e247bf72b395D568488aa8132888 |
| Router | 0x3bEaBd857B2E87E6871376A2B3bf4fC7558946A9 |
0x5D2100D5583D3Ce50f5b57b92d7fc4d4c531baf0 |
| MultiAsset | 0xA706e93Cbfe71AA126629B3a214A1De33015ad38 |
same |
Sources verified. Pools: ETH/USDC on 1301; ETH, AMD, AMZN, NFLX, PLTR, TSLA against USDG and ETH/AMD on 46630.
Not audited and not deployed to mainnet. Before audit: invariant handlers for the new paths, a route through an LP-backed v4 pool inside the callback, callback-token reentrancy on the maker payout, and the Lean CtorSpec model for the Router's FLASH_FILLS immutable.
Source: 06146f8d761cfb9545e4c4a4331dd6d24e8d4d60.
v1.3.1
Async Swap v1.3.1 includes incoming-order memory matching, reduced contract bytecode, the nonce-replay fuzz fixture fix and compiler-independent immutable reading in formal tests.
| Validation | Result |
|---|---|
| Full Solidity suite | 1,076 tests/invariant predicates passed (1,066 Forge entries) |
| Full suite with Solar | 1,076 tests/invariant predicates passed; all 15 former layout-reader failures resolved |
| Invariants | 64 runs × 64 actions; unexpected reverts fail |
| Unichain fork | Three tests passed at block 61709000 |
| Production sizes and formatting | Passed |
Source: 34b05bdcfb642727d1d6856f1ba91957dcf5d3b7. Its src/ tree is identical to the Huff differential oracle at 3f4a5f106f55cc4b90b11d0ce0f0143f5e64ed89.
The matching Huff v1.3.1 release documents differential validation and benchmark results. This source release does not change deployed contract addresses.
The release compiler remains solc 0.8.26; Solar is an additional validation run. The helper fix is reviewed in PR #82.
v1.3.0
Async Swap v1.3.0 adds a bounded tick bitmap and maker-funded priority-fee top-ups. New contracts are deployed on Unichain Sepolia and Robinhood Chain testnet using Olive's new-deployer account.
Router.topUpPriorityFee(order, addedFee)increases an open order's remaining bid without changing its limit, remaining input or original maker age. Top-ups are non-refundable and do not automatically match orders.- All nine release modules on each network have exact source matches on Sourcify.
- Live create → top-up → cancel tests passed on both networks. Top-up receipt gas was 200,740 on Unichain Sepolia and 203,261 on Robinhood; these are individual smoke measurements, not throughput claims.
- ETH/USDC and ETH/USDG pools are initialized. No LP liquidity was added. Previous hook and Router records are preserved; existing orders remain on their original deployment.
| Network | Hook | Router |
|---|---|---|
| Unichain Sepolia (1301) | 0x914B6D0B00f0897a1FdaE43329556F477cf86888 | 0xd31b1B308090e461c9944510fECdA447f849Ca52 |
| Robinhood testnet (46630) | 0x917943DEE316842D941FE188bE7f149Dc3D32888 | 0xA93F36580aBA92a85A8C75B0c6f52C213c0226A5 |
Protocol source: c9372ff9577ba3950fa321090a7bfb559fc964a4. See the refreshed audit scope, deployment records, and validation evidence.
This is a testnet deployment release. Frontend/indexer rollout must preserve support for previous hooks. Mainnet audit clearance, integrated load testing and the remaining mainnet-readiness gates are not completed by this release.
v1.2.0
Every fee is now logged, with its pool.
- Book matches emit
OrderFeeAccruedfor both sides: the buyer's 0.02% in the asset, the seller's in the quote. - Dynamic fee: new
DynamicFeeCharged(poolId, orderId, currency, toLps, toFeeVault, refTick). OrderFeeAccruednow includespoolId(indexed, first field) on every fee.
Breaking for indexers
OrderFeeAccrued changed from OrderFeeAccrued(bytes32,address,uint256) to OrderFeeAccrued(bytes32,bytes32,address,uint256), so its topic hash changed. Update any decoder that reads it.
See the fee-events table in docs/protocol.md.
891 Foundry tests pass. AsyncMatching has 14 bytes left under the EIP-170 limit. Not yet covered by the Lean proofs.
Full change: #49
v1.1.1
Deploy fix. v1.1.0 cannot be deployed with script/deploy.sh: AsyncMatching calls the new library, but the script didn't deploy or link it, so the AsyncMatching step fails. v1.1.1 deploys the library through the shared CREATE2 deployer first, links it into AsyncMatching and the hook, and verifies it. Deploy v1.1.1, not v1.1.0.
Rename. The v1.1.0 library BackrunPremium is now DynamicFeeOrdering (deploy script 00_DeployDynamicFeeOrdering.s.sol, CREATE2 salt asyncswap.v2.DynamicFeeOrdering, window constant ORDERING_WINDOW). No behavior change.
Docs. New dynamic fee ordering page, and the order lifecycle, call sequence and money-flow diagrams show the dynamic fee.
888 Foundry tests pass. The library linking was checked on a local anvil chain; a full deploy to a real chain hasn't been run.
Full change: #48
v1.1.0
Backrun premium on pool fills. After a pool fill moves the price, a later pool fill within 2 blocks that moves it back pays half the price gap it closes, from its output (capped at half). Half is donated to in-range LPs, half goes to the FeeVault. The premium is averaged over each fill's start and end ticks, so splitting a backrun doesn't lower it.
In the test scenario the backrunner now keeps 1.34 USDC of the gap instead of 3.39, and LPs plus the FeeVault capture 2.65.
Integration notes
- New linked library
BackrunPremium; deployments must link it, likeAsyncMatching. - The public
asyncOrdersgetter returns 5 fields (addsrefTick,refBlock). - The premium is taken in the fill's output currency.
888 Foundry tests pass. The Lean proofs don't cover this release yet.
Full change: #47
Superseded by v1.1.1: this version can't be deployed with
script/deploy.sh(the new library isn't linked), andBackrunPremiumwas renamedDynamicFeeOrdering. Deploy v1.1.1.
v1.0.0
First tagged release of the Async Swap contracts.
- Fees: book matches and filler fills take 0.02% from what each side receives, credited to the FeeVault. Pool fills pay 0.02% to LPs and 0.01% to the protocol.
- Owner-only pool initialization.
- Best-price routing: a new order tries the pool first when its spot price strictly beats the best opposing book level, otherwise the book first.
useNonceis Router-only, and signed reprices bind the order's current sequence, so a stale signature can't undo a later reprice.
875 Foundry tests pass. The Lean proofs don't yet cover the changes in this release.
Next: dynamic fee on pool fills to capture backrun MEV in USDC (planned for v1.1.0).