solana-program-library/stake-pool
jon-chuang 87d88bd078
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 <jon.cinque@gmail.com>

* 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 <dhy1996@live.com.sg>
Co-authored-by: Jesse Y. Cho <f8122dac91@gmail.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-08-11 00:15:45 -04:00
..
cli Stake pool/liquid deposits (rebased on new master) (#2141) 2021-08-11 00:15:45 -04:00
js stake-pool: Stake pool deserializer (#1656) 2021-06-23 14:18:45 +02:00
program Stake pool/liquid deposits (rebased on new master) (#2141) 2021-08-11 00:15:45 -04:00
README.md Fix broken stake-pool docs link and make readme's consistent (#805) 2020-11-06 09:15:27 +08:00

README.md

stake-pool program

A work-in-progress program for pooling together SOL to be staked by an off-chain agent running SoM (Stake-o-Matic).

Each SoM needs at least one pool. Users deposit stakes into the SoM pool and receives a pool token minus the fee. The SoM redistributes the stakes across the network and tries to maximize censorship resistance and rewards.

Full documentation is available at https://spl.solana.com/stake-pool

Javascript bindings are available in the ./js directory.