Skip to content

Position lock#7

Merged
andrewsource147 merged 8 commits intomainfrom
feat/position-customization
Feb 20, 2025
Merged

Position lock#7
andrewsource147 merged 8 commits intomainfrom
feat/position-customization

Conversation

@codewithgun
Copy link
Contributor

@codewithgun codewithgun commented Feb 19, 2025

To support jup-lock like vesting, and permanent lock

@codewithgun codewithgun marked this pull request as ready for review February 19, 2025 18:25
@codewithgun codewithgun changed the title More position customization Position lock Feb 20, 2025
bump,
space = 8 + Vesting::INIT_SPACE
)]
pub vesting: AccountLoader<'info, Vesting>,
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need a PDA, or just normal account?
caused if we do PDA, then each time user call this, we need to loop to find unused index

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm trying to experiment the same concept as HD wallet account discovery (https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account-discovery) so that we don't need gPA to fetch all position's vestings.

Since 1 gMA can fetch 100 accounts, we will derive (0-99) and gMA. If there are accounts, then we continue until it return empty, then find the earliest usable index. I think most of the position will not have > 100 vesting accounts

Can switch back to normal account too, I don't have a strong opinion which to use.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with normal account

@andrewsource147 andrewsource147 merged commit 7f5006a into main Feb 20, 2025
5 checks passed
@andrewsource147 andrewsource147 deleted the feat/position-customization branch February 20, 2025 09:35
florian-klein pushed a commit to florian-klein/cp-amm that referenced this pull request Aug 23, 2025
danielAsaboro pushed a commit to danielAsaboro/damm-v2 that referenced this pull request Oct 15, 2025
* feat: transfer position

* feat: lock position

* chore: some basic lock position test

* chore: support single position multiple vesting

* fix: lock position tests

* chore: remove liquidity use max instead of exact value

* chore: fix based on comments

* fix based comments

---------

Co-authored-by: Andrew Nguyen <cuong.hv.dtvt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants