-
Notifications
You must be signed in to change notification settings - Fork 0
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: v3 boosted adds/removes #146
Merged
Merged
Changes from all commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
6b05613
feat: permit2 swaps
agualis 9dadc80
Merge branch 'main' into feat/permit2Swaps
agualis c6b5343
Merge branch 'main' into feat/permit2Swaps
agualis e6decf2
Merge branch 'main' into feat/permit2Swaps
agualis 38fb4b0
Merge branch 'main' into feat/permit2Swaps
agualis 0fe1a3e
Merge branch 'main' into feat/permit2Swaps
agualis 107ca37
fix: delete old function
agualis 89c7204
refactor: permit2 callback
agualis f2c8789
chore: fix tsx format
agualis e5dcbb8
fix: add pool chain to swap state when isPoolSwap
agualis 1f1c591
Merge branch 'main' into feat/permit2Swaps
agualis a1dc1f6
Merge branch 'main' into feat/permit2Swaps
agualis 495397b
chore: merge with main
agualis 20ad904
chore: merge with main2
agualis 6f02b5d
chore: remove duplicated line
agualis ffc70ae
chore: refactor permit2 helper names
agualis 1bd8278
chore: eslint
agualis 6f5c51e
Empty commit
agualis d1da4aa
chore: add isBuffer to swap query
agualis 49d9192
chore: disable gen cache
agualis 879f96e
chore: enable gen cache again
agualis a0cee86
chore: fix isBuffer query
agualis 3e89813
Merge branch 'main' into feat/permit2Swaps
agualis 6652215
fix: returned selectedChain from SwapProvider
agualis 221d6c9
refactor: replace deprecated API pool.allTokens by allPoolTokens func…
agualis 181a0b5
chore: skip sepolia integration test
agualis 4b482df
chore: bump b-sdk 0.30.0
agualis c67ff68
chore: Remove temporary workaround file after SDK update
agualis 3fc0897
Merge branch 'chore/bumpSdk0.30.0' into feat/v3BoostedAdds
agualis 23db892
refactor: router spender setup
agualis 203c0c7
chore: move TokenCore type to pool.types
agualis 46a35ee
chore: sync beets debug page
agualis 4416ede
chore: bump SDK 0.30.1
agualis f6204ab
Merge branch 'main' into feat/permit2Swaps
agualis 79f63ae
Merge branch 'main' into feat/replaceAllTokens
agualis 9ecb42f
Merge branch 'main' into feat/v3BoostedAdds
agualis b06d9ac
chore: add comment for optional permit2
agualis 214034c
Merge branch 'main' into feat/permit2Swaps
agualis 4b0ede3
chore: improve comment
agualis acc0359
refactor: use balancer router for pool swaps
agualis bcd0820
Merge branch 'main' into feat/v3BoostedAdds
agualis 5bb550d
chore: permit2 address from SDK
agualis 315263f
chore: add index to TokenCore
agualis 63e8483
Merge branch 'feat/replaceAllTokens' into feat/v3BoostedAdds
agualis 9b0c97d
chore: remove trailing commas
agualis db3c7ed
Merge branch 'main' into feat/v3BoostedAdds
agualis ab2380a
feat: add Boosted unbalanced add handler
agualis 53a938d
Merge branch 'main' into feat/permit2Swaps
agualis 7b6611c
Merge branch 'main' into feat/v3BoostedAdds
agualis 831202f
chore: update debug boosted pool
agualis d7c8183
chore: clean test
agualis f02f601
Merge branch 'main' into feat/permit2Swaps
agualis 7480f46
refactor: integrate with b-sdk 0.31.1
agualis 1a29237
Merge branch 'main' into feat/permit2Swaps
agualis b04a79a
Merge branch 'main' into feat/v3BoostedAdds
agualis 79cb630
Merge branch 'main' into feat/permit2Swaps
agualis d31e02d
chore: update pnpm lock after merge
agualis 1407d05
chore: move from userData to sender
agualis 5588b7a
chore: bump sdk to 0.31.2
agualis d564953
Merge branch 'main' into feat/v3BoostedAdds
agualis 790902c
Merge branch 'feat/permit2Swaps' into feat/v3BoostedAdds
agualis 32b27ba
Merge branch 'main' into feat/v3BoostedAdds
agualis d34dc97
refactor: allPoolTokens function
agualis 8968202
Merge branch 'main' into feat/v3BoostedAdds
agualis a45385b
fix: pnpm lock
agualis 519f8e8
feat: unbalanced v3 boosted adds
agualis 1a9314c
chore: skip sepolia test-api related tests
agualis b5821a7
chore: skip sepolia test-api related tests 2
agualis 3fe398c
Merge branch 'main' into feat/v3BoostedAdds
agualis b8674af
fix: add wrapping tokens to boosted actionable
agualis b80f835
feat: explicit handler for boosted proportional removes
agualis 55e8008
fix: use explicit boosted sign function
agualis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...ctions/add-liquidity/handlers/BoostedUnbalancedAddLiquidityV3.handler.integration.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* eslint-disable max-len */ | ||
import { getNetworkConfig } from '@repo/lib/config/app.config' | ||
import { HumanTokenAmountWithAddress } from '@repo/lib/modules/tokens/token.types' | ||
import { GqlChain, GqlPoolElement } from '@repo/lib/shared/services/api/generated/graphql' | ||
import { defaultTestUserAccount } from '@repo/lib/test/anvil/anvil-setup' | ||
import { getPoolMock } from '../../../__mocks__/getPoolMock' | ||
import { BoostedUnbalancedAddLiquidityV3Handler } from './BoostedUnbalancedAddLiquidityV3.handler' | ||
import { selectAddLiquidityHandler } from './selectAddLiquidityHandler' | ||
|
||
// TODO: unskip this test when sepolia V3 pools are available in production api | ||
describe.skip('When adding unbalanced liquidity for a V3 BOOSTED pool', async () => { | ||
// Sepolia | ||
const poolId = '0x6dbdd7a36d900083a5b86a55583d90021e9f33e8' // Sepolia stataEthUSDC stataEthUSDT | ||
|
||
const usdcAaveAddress = '0x94a9d9ac8a22534e3faca9f4e7f2e2cf85d5e4c8' // Sepolia underlying usdcAave faucet address (temporary until we have the real one) | ||
const usdtAaveAddress = '0xaA8E23Fb1079EA71e0a56F48a2aA51851D8433D0' // Sepolia underlying usdcAave faucet address (temporary until we have the real one) | ||
// const v3Pool = await getPoolMock(poolId, GqlChain.Sepolia) | ||
const v3Pool = {} as GqlPoolElement | ||
|
||
const handler = selectAddLiquidityHandler(v3Pool) as BoostedUnbalancedAddLiquidityV3Handler | ||
|
||
const humanAmountsIn: HumanTokenAmountWithAddress[] = [ | ||
{ humanAmount: '0.1', tokenAddress: usdcAaveAddress }, | ||
{ humanAmount: '0.1', tokenAddress: usdtAaveAddress }, | ||
] | ||
|
||
it('calculates price impact', async () => { | ||
const priceImpact = await handler.getPriceImpact(humanAmountsIn) | ||
expect(priceImpact).toBe(0) | ||
}) | ||
|
||
it('queries bptOut', async () => { | ||
const result = await handler.simulate(humanAmountsIn) | ||
|
||
expect(result.bptOut.amount).toBeGreaterThan(100000000000000n) | ||
expect(result.bptOut.token.address).toBe(poolId) | ||
}) | ||
|
||
it('builds Tx Config', async () => { | ||
const queryOutput = await handler.simulate(humanAmountsIn) | ||
|
||
const result = await handler.buildCallData({ | ||
humanAmountsIn, | ||
account: defaultTestUserAccount, | ||
slippagePercent: '0.2', | ||
queryOutput, | ||
}) | ||
const router = getNetworkConfig(GqlChain.Sepolia).contracts.balancer.compositeLiquidityRouter | ||
expect(result.to).toBe(router) | ||
expect(result.data).toBeDefined() | ||
}) | ||
}) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@gareth This works with the reference boosted pool works but I have to double check this with the SDK team.