PropAMMVenue merges every maker’s ladder, best price first. Integrate it like a pool. No API, no signatures, no per-trade requests. The venue implements the IPropAMM pool interface and its IPropAMMFillable extension.
1
Discover pairs
Re-read
getPairs() on PairAdded.2
Quote
All four are view functions; call them with
eth_call. Segment output is floor(take * price / 1e18). Per-block caps and each maker’s payable inventory are already applied in all four, so the venue quotes only what makers can pay. A splitting router can size the venue with one quoteFillable call and send fillableAmountIn.3
Swap
Push payment: transfer exactly
amountIn to the venue, then call swap in the same transaction.quote does not include your fee: with swapWithFee the recipient receives quote - quote * extraFeePpm / 1e6. A short push reverts. An over-push stays in the venue.Pull instead of push. If your router approves a pool and calls it, writing the input amount into the calldata, approve PropAMMPullRouter and call the same swap or swapWithFee on it. It pulls amountIn from the caller with transferFrom, then swaps on the venue. Signatures, selectors, the amountIn offset and every rule above are the same.The router also rejects itself as
recipient or feeReceiver (BadRecipient()), exposes quote (the venue’s), and accepts ERC-20 only. Quote and size on the venue or the router; the result is the same. Swaps through it emit the venue’s events with the router as sender.4
Refresh
Ladders can reprice every block, and per-block caps reset each block. Re-read each block, or on
AnchorCommitted, LadderCommitted, OffsetsCommitted, ControlsCommitted, MMFillExecuted and MakerPaused from the executor 0x0000006f9bBA066e4efda2e0CAbE4FF8cf9030aC. An AnchorCommitted reprices both directions of its pair. Or subscribe to the board feed: every maker’s board each block, without reading the venue.Fees
When either fee is non-zero the venue also emits
FeesTaken(uint256 protocolFee, address feeRecipient, uint256 routerFee, address feeReceiver), topic0 0x2e155316dd41148f34c353563f59940c4496861ec9264f7b97847857203340a5. Both fees come from the taker’s output; the maker’s price is not changed.
Reverts
Events
Each swap emitsSwapped, then PropAMMSwap, for the same trade and the same amounts. Index one of them. Do not add them together.
Selectors
Test on Base Sepolia
Pairs:
MockWETH/MockUSDC, MockDAI/MockUSDC. Anyone can call mint(address,uint256).