Zero Knowledge
Pool Functions
For any signer argument, the actor will always be the user that it applies to.
.stake(amount: string, lockUntil: ethers.BigNumber, signer: ethers.Signer) Make a deposit of the specified amount for the given locking period. The lockUntil parameter has to be provided as a Unix timestamp in the future. See the locking page for more specifics on calculating lock periods.
.unstake(depositId: string, amount: string, signer: ethers.Signer) Remove a specific deposit in whole or in part from a given pool if it is unlocked.
.processRewards(signer: ethers.Signer) Manually handle any pending rewards from all deposits and move them into the rewards pool where they will be staked for one year.
.updateStakeLock(depositId: string, lockUntil: ethers.BigNumber, signer: ethers.Signer) Update the locking period for a specific deposit for up to 365 days from when the deposit was first made.
.pendingYieldRewards(address: string) View a given user's unclaimed rewards from all deposits
.getAllDeposits(address: string) Get a list of all the deposits a user has made
.getUser(address: string) Get a set of user data for a pool. The response is a user object that includes their total tokenAmount in that pool. Calling to this mapping also exposes the totalWeight and subYieldRewards of a user which are values used internally for calculating rewards and can be ignored.
.getPoolToken() Get the token being staked in the pool
.calculateUserValueStaked(address: string) Calculate a user's value that is still locked and unlocked in the pool
Last modified 1mo ago
Copy link