Conversation
| bump, | ||
| space = 8 + Vesting::INIT_SPACE | ||
| )] | ||
| pub vesting: AccountLoader<'info, Vesting>, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I'm fine with normal account
helper get account
* 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>
To support jup-lock like vesting, and permanent lock