Commit Graph

12 Commits

Author SHA1 Message Date
Dmitri Makarov 65b49073f4
Decrease the stake pool size due to the new mem op syscall base cost (#2705) 2022-01-05 14:26:13 -08:00
Jon Cinque 8c9f8a0088
stake-pool: Reduce maximum pool size (#2654)
* stake-pool: Reduce huge pool size in tests

* stake-pool: Reduce supported maximum size
2021-12-21 13:10:12 +01:00
Jon Cinque 75ddd9bb22
stake-pool-docs: Rearrange docs, add quickstart guide (#2561)
* stake-pool-docs: Rearrange docs, add quickstart guide

* Rearrange doc sidebar
2021-11-06 12:48:11 +00:00
Jon Cinque 756696ee8e
stake-pool-cli: Add validator list argument to create (#2545)
People want to know more about the validator list, but there isn't too
much info provided.

* Include the validator list as an optional parameter to pool creation
* Print out the address during creation
* Always print out the address during `list`
* Add docs about it
2021-10-25 23:13:58 +02:00
Jon Cinque 675d65b965
stake-pool-cli: Add more docs around scripts (#2531) 2021-10-20 01:29:00 +02:00
Jon Cinque b80c10f406
stake-pool: Add withdraw-sol command + CLI + docs (#2475)
* stake-pool: plumb sol withdraw fee and authority

* Add sol withdraw instruction and processor

* Cleanup sysvar usage

* Fix stack size violation

* Add tests

* Add CLI support

* Add docs for new command

* Integrate review feedback
2021-10-05 22:44:03 -04:00
Jon Cinque 562fd6d97f
stake-pool: Bump versions and update id for deployment (#2384) 2021-09-08 13:00:32 +02:00
Jon Cinque 87b74cfa4c
stake-pool: Combine create stake and add validator (#2371) 2021-09-03 00:54:51 +02:00
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
jon-chuang e9e4d36211
Stake pool/withdrawal fee (#2107)
* stake-pool: Add new fee fields for liquid staking and arbitrage

* incorporate withdrawal fee to withdrawal instruction, refactor calculating fees into Fee method

* update withdraw instruction to take manager fee account, revert divide by 0 edge-case removal

* initialize with withdrawal fee, modify integration tests to incorporate withdrawal fee

* extra safety check, prevent divide by 0

* patch Initialize for other tests

* decrease HUGE_POOL_SIZE to fit compute budget

* set_withdrawal_fee, initialize conditions

* Handle current withdrawal fee = 0 case

* add tests for withdrawal fees

* baseline fee increase is explicit constant

* withdrawal_fee for cli for initialize

* fmt, fix cli

* obey clippy

* clean up cli, add increase from 0 tests.

* add cli: set-withdraw-fee

* apply suggestions for code review

* remove 1_000_000 denom limit

* remove denom limit tests, inline, checked muls

* apply suggestions for code review

* referral fee

* tests: use local copy to calculate_withdrawal_fee instead of fetching from chain

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
Co-authored-by: dhy1996 <dhy1996@live.com.sg>
2021-07-25 20:08:16 -04:00
Jon Cinque 054d61c6b2
stake-pool: Increase version for crate release, update program id (#2059) 2021-07-10 00:24:24 +02:00
Jon Cinque 66d28b41ff
stake-pool: Add helper scripts for setting up a pool (#1994) 2021-06-29 23:11:08 +02:00