Create Staking Pool (with Liquidity)
Last updated
Last updated
To create a Staking Pool using this option, the staking token must have liquidity, otherwise, use the Token without liquidity option. The fee for this option is the amount of the staked token in the ratio of 1 ETH. Staking Pool Recipe contract uses the price oracle contract to get the price of the token and calculates the amount of the token to be paid. You can calculate the amount of the token fee yourself here.
We'll interact with some contracts using write mode on Etherscan to create a Staking Pool.
Staking Pool creation process:
Approve the staking token to give permission for the recipe contract to spend the token
Create a Staking Pool
Approve Tokens
First, we have to approve the staking token.
Go to your token's contract address by looking it up on Etherscan. Then click the Contract tab and Write Contract like this.
Connect your wallet using the "Connect to Web3" button, go to the approve
function and enter:
spender - the Staking Pool Recipe contract address
amount - 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff (this is the max amount)
Staking Pool Recipe address:
Ethereum mainnet - 0x7679D3c9191f85C2fd7AD9c7D8f4cE9fF13D98Ce
Goerli - 0xce139e3aff464c084a398ba6d8e764e07aacc892
Once the token is approved, we can start creating a Staking Pool.
Staking Pool Recipe contract:
Go to the Staking Pool Recipe contract on Etherscan, connect your wallet using the "Connect to Web3" button, and enter the details for the prepareStickyPool
function:
_poolAdmin - an address to be the admin of the Staking Pool (you can use your own address)
_stakedToken - an address of the staked token (ERC20)
Once that transaction is completed, click through to see the transaction details.
Then find your Staking Pool Contract by going to the Logs tab, scroll to the bottom where you see StickyPoolDeployed, and copy the address labeled "pool"
here in the events
The next step is to customize your Staking Pool UI.