feat: relay swapper quotes evm sign and status#9188
Conversation
gomesalexandre
left a comment
There was a problem hiding this comment.
See review comments for code pass.
Runtime test
- Unable to test locally without explicitly enabling the flag - flag needs to be enabled in devish envs 🚫
- Able to do a same-chain EVM swap e2e ✅
https://jam.dev/c/59b8d6aa-5ef3-4605-b626-3d1dedf13e0b
- Able to do a cross-chain EVM swap e2e ✅
https://jam.dev/c/0ad0f432-2440-4ebc-9131-1e9f554c62ba
gomesalexandre
left a comment
There was a problem hiding this comment.
See comments
getEvmTransactionFees()is unimplemented - fees estimation are broken at confirm timegetUnsignedEvmTransaction()is using quote fee estimate for fees- SDK is imported but unused
There was a problem hiding this comment.
- Types are wrong and need to be accomodated vs. simply copied and pasted
getEvmTransactionFeesis still wrong and polling is still borked - will always return hardcodednetworkFeeCryptoBaseunitfrom quote at the moment final quote was fetched, i.e static, stale fees when we got the final quote vs. polling node as it should
gomesalexandre
left a comment
There was a problem hiding this comment.
Code-wise pass looking good now, runtime pass to follow soon
gomesalexandre
left a comment
There was a problem hiding this comment.
Tested locally, happy with this one
Two main things I spotted for follow-ups:
- Actual amount out doesn't consistently update. Seemingly, same-chain Txs aren't parsed properly
- We'll want to revisit the buy amount to both be as close as possible to the one that's guaranteed, i.e optimistic but never under (except for slippage obviously), probably worth spending a few hours while we're done with the meat of Relay to see how they do it in their UI
Rabby same-chain ✅
https://jam.dev/c/863dc93b-855f-406f-8c5c-af2721a7d930
Note: non-blocking, but we don't seem to introspect transfers properly in <SpotTradeSuccess /> - may or may not be related to this PR but would be nice to tackle as a follow-up as users don't see the receive amount being greater than it really is
Would also be nice to tweak things a notch here so that the amount we display is as optimistic as possible without lying, though as previously discussed, it may or may not be possible to achieve this without giving false guarantees.
Rabby cross-chain ✅
https://jam.dev/c/c236bdf9-1634-406a-ab2c-f106924dc1a0
Ledger (EIP-1559) cross-chain ✅
https://jam.dev/c/33a4a0f1-1cb6-47c5-be3e-ba6a5ddfa81d
Ledger (EIP-1559) same-chain ✅
https://jam.dev/c/242ca953-b8ca-40af-8afe-29b8630f8a10
Same thing here, actual amount out never updated, hinting at deciphering transfers
That's a nice catch, creating an issue for tracking purposes #9304
This is what I was saying in the |
apply review from #9188 #9188 (comment)
Description
Implements Relay EVM quotes:
Issue (if applicable)
closes #9160
closes #9161
Risk
Medium (new swapper)
Testing
yarn preview:prod)Engineering
n/a
Operations
n/a
Screenshots (if applicable)
https://jam.dev/c/e8cdc489-a802-4ad1-af66-2491c8e20a42
Swap fees amount test FOX => AVAX
(0.03 USD (0.002 AVAX))
Swap fees amount test AVAX => FOX on Arb
(1.1 FOX (0.026 USDC)), according to the USDC amount of the quote it should be
0.025937 USD), maths seems goodSwap fees amount test ETH on Arb => FOX on Arb
0 fees from relayer
Full retest
https://jam.dev/c/cda7820f-9589-4871-b64c-b906f3d9683a