-
Notifications
You must be signed in to change notification settings - Fork 5
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 lifi swap quote provider #65
Conversation
dea0de3
to
bf2afbc
Compare
1ac6b5b
to
6dac9e3
Compare
…gration tests" This reverts commit 6dac9e3.
@@ -44,7 +44,8 @@ jobs: | |||
- run: npm run test:rwa | |||
- run: npm run test:btc2x | |||
- run: npm run test:cdeti | |||
- run: npm run test:dseth | |||
# skipping as currently no liquidity for sfrETH |
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.
please note this also for other skipped tests for dsETH in this PR
|
||
async getSwapQuote(request: SwapQuoteRequest): Promise<SwapQuote | null> { | ||
// This is not ideal but right now the only way to get only uniV2 and sushi quotes | ||
const allowExchanges = ['uniswap', 'sushiswap'] |
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.
This would likely be an issue in production as LiFi only supports UniV2
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.
e.g. this won't work since sushiswap
is provided?
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.
Since the contracts require UniV3 quotes
const isUniswap = lifiResult.toolDetails.name | ||
.toLowerCase() | ||
.includes('uniswap') | ||
const exchange = isUniswap ? Exchange.UniV3 : Exchange.Sushiswap |
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.
this would likely be an issue in production
lifiResult.action.toToken.address, | ||
], | ||
fees: [fees], | ||
pool: AddressZero, |
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.
Since we can't get the pool from LiFi quotes, sushi quotes probably wouldn't work
@@ -20,6 +20,7 @@ export interface SwapQuoteRequest { | |||
inputAmount?: string | |||
outputAmount?: string | |||
// Optional | |||
address?: string |
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.
If we'd try to use LiFi with new contracts at some point, we'd need to add address (user's account) to all requests.
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.
any reason why that would be a problem? (i'm wondering if we should just make it required starting now)
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.
because it changes several interfaces throughout the project which we might not need for any other swap quote provider
LiFiSwapQuoteProvider
- an adapter for swap quotes as an alternative to 0xWhat's different from 0x?
fromAddress
, so theaddress
was added to theSwapQuoteRequest
TODOs