Repository navigation
1.11.0: spot compares every route
Spot compares every route
Every spot quote now checks the market's listed pools plus every standard Uniswap route for the exact amount, and the trade fills on the one that pays the trader most:
- v3 USDG pools at every fee tier (0.01%, 0.05%, 0.30%, 1%)
- v3 routes through WETH (USDG/WETH at 0.01% or 0.05%, then every tier)
- v4 USDG pools without hooks at the common fee and tick-spacing pairs
- for crypto tokens, v4 pools against native ETH without hooks
Only canonical Uniswap pools and v4 pools without hooks are added, so no added route runs hook code that has not been reviewed. The 0.15% PRIVO fee and the trader's slippage limit are the same on every route.
In this release
src/privo-swap.js:quote()returnsall(every route with what it pays) andchecked. New exports:routesOf(sym)andvenueLabel(pool). Quotes go through Multicall3 three at a time, retried route by route if a group fails.src/privo-burn.js: the fee Safe buyback still quotes only $PRIVO's listed pool (every: false), so a second owner can rebuild the batch byte for byte.test/sim/routes-test.mjs(new): forces every route a quote finds, in turn, and executes it on mainnet state witheth_call; a quote 2% above what an added route pays must revert.test/sim/basket-sell-test.mjs: both simulations run on the same block.
On privoexchange.com, the Spot ticket lists every route with what it pays and how far it is from the one used.