-
Notifications
You must be signed in to change notification settings - Fork 9
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
Nested pools release #448
Nested pools release #448
Conversation
* V3 nested removes are always proportional. | ||
* User must approve composite router to spend BPT token - See tests in test/v3/removeLiquidityNested for full flow. | ||
* (Runs against a local Anvil fork) | ||
* Note - remove transaction is not fully run in this example because we cannot use slot method to artificially give test account BPT balance. |
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.
When we get around to the major refactor of examples, should be able to give test account BPT by performing an add liquidity behind the scenes in fork setup right?
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.
Yeah, exactly. Didn't want to get too deep into that at this stage.
console.table({ | ||
tokensOut: queryOutput.amountsOut.map((a) => a.token.address), | ||
amountsOut: queryOutput.amountsOut.map((a) => a.amount), | ||
}); | ||
console.log(`BPT In: ${queryOutput.bptAmountIn.amount.toString()}`); | ||
|
||
// Build the transaction data with slippage applied | ||
const call = removeLiquidityNested.buildCall( | ||
removeLiquidityNested.buildRemoveLiquidityInput(queryOutput, { | ||
slippage, | ||
}), | ||
); | ||
|
||
console.log('\nWith slippage applied:'); | ||
console.table({ | ||
tokensOut: call.minAmountsOut.map((a) => a.token.address), | ||
minAmountsOut: call.minAmountsOut.map((a) => a.amount), | ||
}); |
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.
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.
Hell of a lot easier to follow than makeForkTx
👏
Nice job exposing the approval steps!
// TODO - Leave this in as useful as basis for manual debug | ||
// await client.simulateContract({ | ||
// address: |
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.
❤️ ❤️ ❤️
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.
Well done ser! 🍻
No description provided.