You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of having two versions of balances, locked and unlocked, for a given member account, one can consolidate these two with the following scheme:
When depositing into the stake program, the program can create a redeemable "deposit token" that represents a claim on the assets in the stake account (separate from the pool token, which is just used as an accounting measurement for rewards). For locked tokens, the locked token program would send funds to the stake program, and the stake program would mint these "deposit tokens" to the lockup program. To withdraw, one would provide these "deposit tokens" to the stake program, which would burn them and return the corresponding number of assets.
Lockup
Any app can then facilitate the use of locked tokens by implementing an additional deposit_locked method that takes in a Vesting account and mints these "deposit tokens" to an account with an owner being program derived address with the vesting account as one of the seeds. Withdrawals would not need to be special cased. Any transaction signed by an owner of a "deposit token" would be able to withdrawal.
Pros
Cuts the number of required accounts for a Member account in half
Easier to reason about the locked property being maintained. A program has to just prove two things: 1) all tokens coming into and out of the program are through the deposit_* and withdraw instructions and 2) deposit_locked only mints "deposit tokens" to token accounts owned by vesting accounts.
The text was updated successfully, but these errors were encountered:
armaniferrante
changed the title
registry: Remove special cased locked balances
lockup, registry: Remove special cased locked balances
Apr 5, 2021
Registry:
Instead of having two versions of balances, locked and unlocked, for a given member account, one can consolidate these two with the following scheme:
When depositing into the stake program, the program can create a redeemable "deposit token" that represents a claim on the assets in the stake account (separate from the pool token, which is just used as an accounting measurement for rewards). For locked tokens, the locked token program would send funds to the stake program, and the stake program would mint these "deposit tokens" to the lockup program. To withdraw, one would provide these "deposit tokens" to the stake program, which would burn them and return the corresponding number of assets.
Lockup
Any app can then facilitate the use of locked tokens by implementing an additional
deposit_locked
method that takes in a Vesting account and mints these "deposit tokens" to an account with an owner being program derived address with the vesting account as one of the seeds. Withdrawals would not need to be special cased. Any transaction signed by an owner of a "deposit token" would be able to withdrawal.Pros
Member
account in halfdeposit_*
andwithdraw
instructions and 2)deposit_locked
only mints "deposit tokens" to token accounts owned by vesting accounts.The text was updated successfully, but these errors were encountered: