-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add chainflip dca #8152
base: develop
Are you sure you want to change the base?
feat: add chainflip dca #8152
Conversation
Took all remarks into account, code is cleaned up a lot (even compared to the initial Chainflip implementation), so it might actually be interesting to take this along. Even though it adds the complexity of DCA, it makes the overall code more logical and cleaner actually :) |
packages/swapper/src/swappers/ChainflipSwapper/swapperApi/getTradeQuote.ts
Show resolved
Hide resolved
packages/swapper/src/swappers/ChainflipSwapper/swapperApi/getTradeQuote.ts
Outdated
Show resolved
Hide resolved
src/components/MultiHopTrade/components/MultiHopTradeConfirm/hooks/useThorStreamingProgress.tsx
Outdated
Show resolved
Hide resolved
packages/swapper/src/swappers/ChainflipSwapper/swapperApi/getTradeRate.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CumpsD pushed a few cleanup commits and fixes as well as actually consuming the flag to programmatically enable DCA quotes (it wasn't consumed previously which rendered the flag effectively useless).
Happy with latest changes here and confirmed no regressions on regular streaming swap component, however spotted two issues:
- Percentage different is borked for Chainflip in this PR
- Execution is borked for regular swaps regardless of flag (tested with tokens sends, which may or may not be the only ones broken here)
See testing in https://gist.github.com/gomesalexandre/6865417ce909c59990700b7f5d541d30
Happy to get this guy in once these two are tackled, and whenever we are ready to merge this after base Chainflip functionality gets some love.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see review above
It seems the power is wrong somewhere in that price. I have been trying to reproduce this, but I think it must have been a temporarly glitch, because I can't manage to get it to repeat this. I recloned this branch from scratch and it worked as expected. I think it is related to the monkey hack on Chainflip pricing, while all others still return the real price for 30$ to ETH, while the Chainflip one gives you a quote for 30000$ to ETH, causing those weird percentages? |
Description
This PR:
Issue
Risk
High:
Testing
Quotes without a wallet connected
DCA swaps (eng. testing only)
Finally, ensure that you actually send a lower base unit amount (in base unit, obviously adapt that to the asset you're sending to make it 30+ bucks, here 0.008907662026062095 ETH on Arb):
All of the steps above are to ensure we're getting rates/quotes for a much larger amount (see quote at confirm step), while actually sending a much lower one
Proceed to a DCA swap, ensuring you've input at least 30 bucks of a sell asset (Sol/Arb chains preferred as those are cheaper, you can even do a same-chain swap if you feel like it, which is obviously cheaper).
The quotes will be totally off while testing this with this monkey patch, which is expected.
Execute said streaming swap and ensure it goes through and status looks good
Engineering
Operations
🏁 My feature is behind a flag and doesn't require operations testing (yet)
It is... ish. Streaming swaps are under flag and do not require ops testing for the time being. However, the changes in the streaming swap component do bring risks, regression test THORChain streaming swaps progress still look good
Quotes without a wallet connected for BTC and Solana chain (SOL/USDC.SOL) sells are fixed by this PR, so should be tested
Ensure you do not see Chainflip DCA (streaming) rates, as the flag is off in prodish envs
Screenshots
Quote
Chainflip Details available on rate
Deposit Channel opened with chunks
Stream starting
Stream in progress
Stream Done
Swap Done