-
Notifications
You must be signed in to change notification settings - Fork 25
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(handlefi): add support for HandleFi swap plugin #144
Conversation
🦋 Changeset detectedLatest commit: 4a116f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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 - Nice work on this one. This has gotta be one of the most complex plugins yet.
} from './abi' | ||
import { WETH } from './constants' | ||
|
||
export function getParaSwapFilter(params: SwapActionParams) { |
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 is super cool - this way we can just recycle the filter generators for a given protocol against aggregates! Good idea.
|
||
export function getParaSwapFilter(params: SwapActionParams) { | ||
const { tokenIn, tokenOut, amountIn, amountOut } = params | ||
const internalEthAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' |
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 has to be my least favorite way to represent ETH lol
fromAmount: amountIn, | ||
toAmount: amountOut, | ||
toToken: tokenOutUsed, | ||
partner: '0xFa2c1bE677BE4BEc8851D1577B343F7060B51E3A', |
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.
What do you think about making this a param from the function call? I would either do that or hardcode it to a const.
|
||
// There isnt really a good way to tell which pool you are in without knowing the contract address of the pool | ||
// i will always be fxUSD (0) | ||
// j can either be FRAX, USDC.e, or USDT (may get false posiitves here) |
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.
I think the false positives are fine - it's a pretty obscure edge-case. We'll find out if there's a way for the users to leverage this though, if there's a way they'll find it 😆
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.
Very obscure. The fxUSD frax pool sees roughly 1 tx a day, and the 3pool sees maybe 1 per week.
Changes look good! Let's get this merged in. |
Integration of
handlefi
swap action plugin for QuestDKThis PR introduces the integration of the
handlefi
swap plugin for QuestDK.About The Project
HandleFi is a decentralized multi currency stablecoin protocol based on Arbitrum. They offer several products including perpetual swaps, convert, staking, and fxTokens.
Implementation Details
There are several contracts that a swap may be routed through, making this plugin quite complex to implement. The majority of swaps will be routed via paraswap. fxTokens are routed through handlefis contracts or external curve/balancer pools.
Current Limitations
amountOutMin
which takes into account the amount of slippage set.