Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 87d88bd

Browse files
jon-chuangbillythedummyf8122dac91joncinque
authored
Stake pool/liquid deposits (rebased on new master) (#2141)
* rename staking instructions * modify DepositStake te to include manager fees and referrer, continue _stake refactor, referral fees WIP * initialize with fees, fee application, checks * inline functions * temporarily substitute u8 for bool until borsh gets it's * straight * set deposit fee * apply deposit and referral fee to liquid deposit_sol too * add set-deposit-fee, unify cli interface * set-referral-fee * full feature set for liquid deposits (?) * add tests/set_referral_fee.rs * fix missing serialization in process_set_referral_fee * remove duplicated test case in tests/set_withdrawal_fee.rs * tests WIP, numbers dont add up after non-zero deposit fee * fix error, fix tests * deposit_sol tests. Requires additional changes to work properly * simplify deposit_sol tests, add referral fee tests for deposit and deposit_sol * add `sol_deposit_authority`. * split deposit_sol() & deposit_sol_with_authority(), cli sol_deposit --from, minor cleanup * cli deposit-sol from argument should take keypair instead * commands: set-sol-deposit-authority, show * cli: pretty print stake pool struct * chore: comments/naming * fmt, clippy * add args for `create-pool` * mistake in the cli * `system_prog` is `read_only`, require sig from `stake_deposit_auth` * change deposit-sol-authority arg to optional acount, rename instruction::withdraw->withdraw_stake, remove unnecesary sys_prog arg for withdraw_stake * resolve simple nits and suggestions * cli: change default referrer to user's token receiver account instead of pool manager * cli: remove show command, add fees to list command, rename pool -> epoch * update tests for removed unnecessary referral fee account owner check and deposit sol * cli changes: create ephemeral account for deposit_sol * specify pool token type for account info name * add check for manager fee acc in deposit_sol * Apply suggestions from code review Co-authored-by: Jon Cinque <[email protected]> * fix non-rebased bug * SetDepositStakeAuthority * refactor + tests + cli * fmt * clippy * remove unnecessary comment * ASK keyword * unset deposit auth * combine set fee instructions * clippy * applying suggestions * apply out-of-date check only for FeeTypes that need it * add fee + user = new tokens check * Fix test * Unify `SetDepositAuthority` instruction * fmt Co-authored-by: dhy1996 <[email protected]> Co-authored-by: Jesse Y. Cho <[email protected]> Co-authored-by: Jon Cinque <[email protected]>
1 parent 0d8a248 commit 87d88bd

23 files changed

+3076
-391
lines changed

stake-pool/cli/scripts/deposit-withdraw.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ deposit_stakes () {
4747
for validator in $(cat $validator_list)
4848
do
4949
stake=$(solana-keygen pubkey $keys_dir/stake_$validator.json)
50-
$spl_stake_pool deposit $stake_pool_pubkey $stake
50+
$spl_stake_pool deposit-stake $stake_pool_pubkey $stake
5151
done
5252
}
5353

@@ -57,7 +57,7 @@ withdraw_stakes () {
5757
pool_amount=$3
5858
for validator in $(cat $validator_list)
5959
do
60-
$spl_stake_pool withdraw $stake_pool_pubkey $pool_amount --vote-account $validator
60+
$spl_stake_pool withdraw-stake $stake_pool_pubkey $pool_amount --vote-account $validator
6161
done
6262
}
6363

0 commit comments

Comments
 (0)