Content pfp
Content
@
0 reply
0 recast
2 reactions

Greg pfp
Greg
@greg
is there any reference implementation of a smart contract that checks multiple dex's for the best price onchain, or is hardcoding uniswap's universal router the best approach? are there similar routers for other dex's? cc @dcposch.eth im guessing you guys explored this for daimo
5 replies
2 recasts
7 reactions

✳️ dcposch on daimo pfp
✳️ dcposch on daimo
@dcposch.eth
You can use Uniswap TWAP/TWAL. Unfortunately these are averages: median would be better and more resistant to manipulation. TWAP/TWAL does have the advantage that only uses previous-block pricing = it's resistant to within-block/within-tx manimuplation
1 reply
0 recast
0 reaction

Greg pfp
Greg
@greg
interesting, thanks. is this your latest version working in prod? https://github.com/daimo-eth/daimo/blob/master/packages/contract/src/DaimoUSDCSwapper.sol any chance you can share the deployed address?
1 reply
0 recast
0 reaction

✳️ dcposch on daimo pfp
✳️ dcposch on daimo
@dcposch.eth
wrapping an audit, soon
0 reply
0 recast
1 reaction