-
Notifications
You must be signed in to change notification settings - Fork 191
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: search entire UniswapV3 fee range for longtail swaps #5870
Conversation
TSAggregatorUniswapV3_100 = '0xbd68cbe6c247e2c3a0e36b8f0e24964914f26ee8', | ||
TSAggregatorUniswapV3_500 = '0xe4ddca21881bac219af7f217703db0475d2a9f02', | ||
TSAggregatorUniswapV3_3000 = '0x11733abf0cdb43298f7e949c930188451a9a9ef2', | ||
TSAggregatorUniswapV3_10000 = '0xb33874810e5395eb49d8bd7e912631db115d5a03', |
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.
THORChain will blackhole funds if any of these are wrong - they must be whitelisted on https://gitlab.com/thorchain/thornode/-/blob/develop/x/thorchain/aggregators/dex_mainnet_current.go
07146fb
to
bb312d0
Compare
f6f1f0a
to
be74145
Compare
src/lib/swapper/swappers/ThorchainSwapper/utils/longTailHelpers.ts
Outdated
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.
lgtm, no blocking comments
Description
Adds UniswapV3 pool optimization to long-tail swaps, enabling more assets and better rates.
This PR adds the ability to search all fee ranges for a given asset pair's available pools, get a quote for each, and transact against the contract resulting in the best rate. In particular, we'll get better rates for assets with tight liquidity pools.
Also adds support for additional assets that did not have pools for the
3000
fee range of UniswapV3.An example to see this working: compare the rate between this branch and prod for LINK to DOGE.
Pull Request Type
Issue (if applicable)
Closes #5878
Risk
High risk to long-tail swaps - we'll want to test these again, as messing up the contracts here (e.g. using a non-whitelisted contract) could lead to funds landing in a black hole.
Testing
Perform longtail swaps on a range of assets (the sell asset is important, not so much the buy asset - so just use the cheapest).
Engineering
Sanity check the contract selection logic - using the wrong aggregator contract will cause lost funds.
Operations
☝️
Screenshots (if applicable)
N/A