-
Notifications
You must be signed in to change notification settings - Fork 13
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 liquidity unbalanced permit2 #1117
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -106,4 +134,22 @@ export class UnbalancedAddLiquidityHandler implements AddLiquidityHandler { | |||
kind: AddLiquidityKind.Unbalanced, | |||
} | |||
} | |||
|
|||
public constructBaseBuildCallInput({ |
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 will probably try to extract this method to be shared by all the handlers but for now I will keep it here until I implement the rest of the v3 handlers
slippage: Slippage.fromPercentage(`${Number(slippagePercent)}`), | ||
wethIsEth: this.helpers.includesNativeAsset(sdkQueryOutput.amountsIn), | ||
} | ||
// baseBuildCallParams.amountsIn = baseBuildCallParams.amountsIn.filter( |
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 will delete this later. It is a reminder to try something...
}) | ||
console.log('Call data built:', response) | ||
if (permit2) console.log('permit2 for call data:', permit2) |
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.
We can leave this comment in production for debugging purposes or we can remove it if we see that permit2 is not problematic.
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.
Should we rename this file/class to UnbalancedAddLiquidityV2.handler.ts to make it more explicit? Note that it also used for V1 CowAMM pools to that would not be precise.
Adds v3 permit2 flow only for unbalanced add handler.
Contains many TODOs but let's merge it before moving to the monorepo.
Note: It only works pointing to
test api
in.env.local
as sepolia v3 pools are not yet inproduction api
permit2Adds.mp4