IDragonswapV2Staker
Allows staking nonfungible liquidity tokens in exchange for reward tokens
Functions
factory
The DragonswapV2 Factory
nonfungiblePositionManager
The nonfungible position manager with which this staking contract is compatible
maxIncentiveDuration
The max duration of an incentive in seconds
maxIncentiveStartLeadTime
The max amount of seconds into the future the incentive startTime can be set
incentives
Represents a staking incentive
Parameters:
Name | Type | Description |
---|---|---|
| bytes32 | The ID of the incentive computed from its parameters |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The amount of reward token not yet claimed by users |
| uint160 | Total liquidity-seconds claimed, represented as a UQ32.128 |
| uint96 | The count of deposits that are currently staked for the incentive |
deposits
Returns information about a deposited NFT
Return Values:
Name | Type | Description |
---|---|---|
| address | The owner of the deposited NFT |
| uint48 | Counter of how many incentives for which the liquidity is staked |
| int24 | The lower tick of the range |
| int24 | The upper tick of the range |
stakes
Returns information about a staked liquidity NFT
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The ID of the staked token |
| bytes32 | The ID of the incentive for which the token is staked |
Return Values:
Name | Type | Description |
---|---|---|
| uint160 | secondsPerLiquidity represented as a UQ32.128 |
| uint128 | The amount of liquidity in the NFT as of the last time the rewards were computed |
rewards
Returns amounts of reward tokens owed to a given address according to the last time all stakes were updated
Parameters:
Name | Type | Description |
---|---|---|
| contract IERC20Minimal | The token for which to check rewards |
| address | The owner for which the rewards owed are checked |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The amount of the reward token claimable by the owner |
createIncentive
Creates a new liquidity mining incentive program
Parameters:
Name | Type | Description |
---|---|---|
| struct IDragonswapV2Staker.IncentiveKey | Details of the incentive to create |
| uint256 | The amount of reward tokens to be distributed |
endIncentive
Ends an incentive after the incentive end time has passed and all stakes have been withdrawn
Parameters:
Name | Type | Description |
---|---|---|
| struct IDragonswapV2Staker.IncentiveKey | Details of the incentive to end |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The remaining reward tokens when the incentive is ended |
transferDeposit
Transfers ownership of a deposit from the sender to the given recipient
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The ID of the token (and the deposit) to transfer |
| address | The new owner of the deposit |
withdrawToken
Withdraws a DragonswapV2 LP token tokenId
from this contract to the recipient to
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The unique identifier of an DragonswapV2 LP token |
| address | The address where the LP token will be sent |
| bytes | An optional data array that will be passed along to the |
stakeToken
Stakes a DragonswapV2 LP token
Parameters:
Name | Type | Description |
---|---|---|
| struct IDragonswapV2Staker.IncentiveKey | The key of the incentive for which to stake the NFT |
| uint256 | The ID of the token to stake |
unstakeToken
Unstakes a DragonswapV2 LP token
Parameters:
Name | Type | Description |
---|---|---|
| struct IDragonswapV2Staker.IncentiveKey | The key of the incentive for which to unstake the NFT |
| uint256 | The ID of the token to unstake |
claimReward
Transfers amountRequested
of accrued rewardToken
rewards from the contract to the recipient to
Parameters:
Name | Type | Description |
---|---|---|
| contract IERC20Minimal | The token being distributed as a reward |
| address | The address where claimed rewards will be sent to |
| uint256 | The amount of reward tokens to claim. Claims entire reward amount if set to 0. |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The amount of reward tokens claimed |
getRewardInfo
Calculates the reward amount that will be received for the given stake
Parameters:
Name | Type | Description |
---|---|---|
| struct IDragonswapV2Staker.IncentiveKey | The key of the incentive |
| uint256 | The ID of the token |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | The reward accrued to the NFT for the given incentive thus far |
| uint160 | The seconds inside the tick range |
Events
IncentiveCreated
Event emitted when a liquidity mining incentive has been created
Parameters:
Name | Type | Description |
---|---|---|
| contract IERC20Minimal | The token being distributed as a reward |
| contract IDragonswapV2Pool | The DragonswapV2 pool |
| uint256 | The time when the incentive program begins |
| uint256 | The time when rewards stop accruing |
| address | The address which receives any remaining reward tokens after the end time |
| uint256 | The amount of reward tokens to be distributed |
IncentiveEnded
Event that can be emitted when a liquidity mining incentive has ended
Parameters:
Name | Type | Description |
---|---|---|
| bytes32 | The incentive which is ending |
| uint256 | The amount of reward tokens refunded |
DepositTransferred
Emitted when ownership of a deposit changes
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The ID of the deposit (and token) that is being transferred |
| address | The owner before the deposit was transferred |
| address | The owner after the deposit was transferred |
TokenStaked
Event emitted when a DragonswapV2 LP token has been staked
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The unique identifier of an DragonswapV2 LP token |
| bytes32 | The amount of liquidity staked |
| uint128 | The incentive in which the token is staking |
TokenUnstaked
Event emitted when a DragonswapV2 LP token has been unstaked
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The unique identifier of an DragonswapV2 LP token |
| bytes32 | The incentive in which the token is staking |
RewardClaimed
Event emitted when a reward token has been claimed
Parameters:
Name | Type | Description |
---|---|---|
| address | The address where claimed rewards were sent to |
| uint256 | The amount of reward tokens claimed |
Last updated