Staking OKS is a fairly complicated process with numerous strategies to optimise yield and reduce risk.
The effort and skill required to optimally stake OKS presents an opportunity for staking pools managed by community members with fee structures based on performance. This is a fully decentralized non-custodial staking pool were all fund movements will be defined through smart contracts logic.
Users not familliar with OKS ecosystem will have to stake their OKS in one of the deployed pools and the mangers will handle the strategies to optimize the yields.
The pool participants will deposit OKS and receive a pool tokens equivalent to their stake share, after a specific period of time the users will be able to withdrawal their OKS + staking reward by burning the previously minted pool tokens.
The pool managers will be able to
- Mint/ burn with pooled OKS
- Collect & distribute fees
- Deposit to AMM pools
- Call exchange
- Set fee structure % of fees, or % of OKS staked or some combination of the two
- node v10.20.1
- npm 6.14.4
$ git clone https://github.com/oikos-cash/staking-contracts.git
$ cd staking-contracts
$ npm install
$ npm run test:contracts
To report gas consumption use the following command:
$ npm run test:contracts:report
To check unit test coverage run the following command:
$ npm run test:coverage
Please note that using StakingPoolFactoryProxy
address is sufficient to get all required information needed for the UI.
StakingPoolFactoryProxy
will remain unchanged in the opposite of StakingPoolFactory
and all the deployed pools that can be upgraded.
To deploy a demo to shasta network you should first set some required environment variables:
$ export PROXY_OKS_SHASTA="address"
$ export SWAP_FACTORY_SHASTA="address"
$ export PRIVATE_KEY_SHASTA="private key"
Then run the following command to deploy all necessary contracts.
$ npm run deploy:shasta
Once the initial setup done, copy the "StakingPoolFactoryProxy" address and set is as an environment variable to be able to run the next step and deploy the staking pool.
$ export SHASTA_STAKINGPOOLFACTORY_PROXY="address"
Multiple staking pools can be deployed, if the following command is used multiple times.
$ npm run deploy:pool:shasta -- \
$ --poolName "staking pool name" \
$ --tokenName "liquidity token name" \
$ --tokenSymbol "liquidity token symbol" \
$ --stakingPoolOwner "pool manager address"
To upgrade any staking pool, run the following command with the staking pool address as argument.
$ npm run upgrade:pool:shasta -- \
$ --poolAddress "TEd9QbiNNvF3yxMZxBkb5QVfcP7CK1h9hp"
StakingPoolFactoryProxy
:StakingPoolFactory
:StakingPoolFactoryStorage
: