This program allows locking and vesting of SRM/MSRM tokens to receive gSRM tokens, which can then be used to take part in the Serum DAO Governance.
Users will need to initialize a User
account for themselves using the init_user
instruction before they can execute further instructions from the program.
Users can then lock their SRM and MSRM tokens using the deposit_locked_srm
and deposit_locked_msrm
instructions respectively, which would then,
- Create a
LockedAccount
for the deposited tokens. - Issue a
ClaimTicket
, which can be used to claim the gSRM tokens, afterCLAIM_DELAY
seconds have passed since creation, using theclaim
instruction.
The claimed gSRM can also be used to redeem the SRM/MSRM tokens that were locked. This is done by the burn_locked_gsrm
instruction, which also takes in the LockedAccount
to make sure misuse of the claimed gSRM and allows redeeming of tokens in batches if required. The burn_locked_gsrm
instruction would then,
- Update
LockedAccount
according to the amount of gSRM burned. - Issue a
RedeemTicket
, which can be used to receive the SRM/MSRM tokens back, afterREDEEM_DELAY
seconds have passed since creation, using theredeem_srm
andredeem_msrm
instructions.
Users can vest SRM for another user using the deposit_vest_srm
instruction, which would then,
- Create a
VestAccount
for the deposited tokens. This also stores information such asCLIFF_PERIOD
andLINEAR_VESTING_PERIOD
which are configurable constants in the program. - Issue a
ClaimTicket
, which can be used to claim the gSRM tokens, afterCLAIM_DELAY
seconds have passed since creation, using theclaim
instruction.
The owner of the VestAccount can then redeem SRM tokens using the claimed gSRM tokens, following a linear vesting schedule. This is done using the burn_vest_gsrm
instruction, which takes in the VestAccount
to calculate the amount of SRM that has vested. The burn_vest_gsrm
instruction would then,
- Update
VestAccount
according to the amount of gSRM burned. - Issue a
RedeemTicket
, which can be used to receive the SRM tokens, afterREDEEM_DELAY
seconds have passed since creation, using theredeem_srm
instruction. The amount of SRM tokens that can be redeemed is calculated using theCLIFF_PERIOD
,LINEAR_VEST_PERIOD
,clock.unix_timestamp
andVestAccount.gsrm_burned
.
- Program ID:
FBcTbv5rLy7MQkkAU2uDzAEjjZDeu2BVLVRJGxyz6hnV
- Init Signature:
21K6657LRHDnuwDnP53ncM1UKBVhViVvmtyxUxNwGyomph4hUA6piumgrroUmoBUGeDnR9nhP83QV6CiT5prVp8C
- gSRM Mint:
G6DyPo5NjpW5kAvZwvM7hx1KeTUgGmuykPMdKuwWRvER
These should be used for testing on mainnet-beta and devnet.
- Program ID:
EDV6BNBY6pLb4aCJCc5LnELdA9xTywnDZ2m3cWfCbpwZ
- SRM:
2xKASju8WCUK6zC54TP4h6WhHdqdcWMNoFpqAdvXvHV6
- MSRM:
BoFBTKtdMXC4YALXtNV5tmw1xNWtjxTrR17PvZGmKhmP
SPL Governance: G41fmJzd29v7Qmdi8ZyTBBYa98ghh3cwHBTexqCG1PQJ
- Mainnet Realm:
G3FBDbsRiJjcjYuazrH6mRShFMjr9RQn4SxVVxocJavA
- Council Token:
GwNuCfsN5bEdtQyghvyqEU8BMornrpnGiGv8tBjTPj3Q
- Devnet Realm:
439YMWzq623G6EMowVjTFcHnn4y13tBa876NKdzvjcEr
- Mainnet TEST Realm:
3pFLtCJzoewv9aB4JZDhGdRb4xQeJRtVpd66QgpNTDwP