Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

feat v3 proportional adds/removes #1157

Merged
merged 73 commits into from
Oct 10, 2024
Merged

feat v3 proportional adds/removes #1157

merged 73 commits into from
Oct 10, 2024

Conversation

agualis
Copy link
Contributor

@agualis agualis commented Oct 10, 2024

Some v3 pools (the ones with disableUnbalancedLiquidity property) require proportional token adds/removes.

Important note

Note that this pool has low liquidity and it will fail if you try to add amounts bigger than 1-2 USD.
@groninge01 will replicate the removes feature to disable >25% adds soon. We'll have to test that feature with proportional adds too.

For now we only have this SEPOLIA example (only in test-api):
pools/sepolia/v3/0x8fc07bcf9b88ace84c7523248dc4a85f638c9536/

Add example:
https://github.com/user-attachments/assets/1f00cd63-9405-4be3-933c-abc36ea32888

Remove example:
https://github.com/user-attachments/assets/91ff5711-6dd5-4b94-850a-95837068674f

Copy link

vercel bot commented Oct 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2024 8:26am
test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2024 8:26am

@agualis agualis self-assigned this Oct 10, 2024
@agualis agualis changed the title feat v3 proportional adds feat v3 proportional adds/removes Oct 10, 2024
@agualis agualis requested a review from garethfuller October 10, 2024 08:19
return signature
}

// Instead of MaxAllowanceTransferAmount(MaxUint160) we use MaxUint159 to avoid overflow issues
const MaxUint159 = BigInt('0x7fffffffffffffffffffffffffffffffffffffff')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garethfuller I found problems when using MaxAllowanceTransferAmount (MaxUint160) in the b-sdk. Using 159 works but I will check with the SDK team to discard related bugs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, yeah please check with SDK team. Where did you get the solution to use 159?

Copy link
Contributor

@garethfuller garethfuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the integration errors are flaky.

@agualis agualis merged commit 3e7627d into main Oct 10, 2024
7 checks passed
@agualis agualis deleted the feat/v3ProportionalAdds branch October 10, 2024 14:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants