staker.gno

Stakes or unstakes a position obtained from adding liquidity.

CreateExternalIncentive

func CreateExternalIncentive(
	targetPoolPath string,
	rewardToken string, // token path should be registered
	rewardAmount uint64,
	startTimestamp int64,
	endTimestamp int64,
)

Creates an incentive program for a pool.

Parameters

NameTypeDescription

targetPoolPath

string

The path of the pool in which to add incentives.

rewardToken

string

The path of the token to add as incentives.

rewardAmount

uint64

The amount of tokens to add as incentives.

startTimestamp

int64

The time to start the incentive program.

endTimestamp

int64

The time to end the incentive program.

StakeToken

func StakeToken(
	tokenId uint64 // LP TokenID
)

Stakes a position.

Parameters

NameTypeDescription

tokenId

uint64

The ID of the position to stake.

Return Values

NameTypeDescription

poolPath

string

The path of the pool that the position exists.

token0Amount

string

The amount of token0 to be staked.

token1Amount

string

The amount of token1 to be staked.

CollectReward

func CollectReward(
	tokenId uint64 // LP TokenID
)

Collects staking rewards accrued to a position.

Parameters

NameTypeDescription

tokenId

uint64

The ID of the position to collect incentives from.

Return Values

NameTypeDescription

poolPath

string

The path of the pool that the position exists.

UnstakeToken

func UnstakeToken(
	tokenId uint64 // LP TokenID
)

The ID of the position to unstake.

Parameters

NameTypeDescription

tokenId

uint64

The ID of the position to unstake.

Return Values

NameTypeDescription

poolPath

string

The path of the pool that the position will be unstaked from.

token0Amount

string

The amount of token0 to be unstaked.

token1Amount

string

The amount of token1 to be unstaked.

EndExternalIncentive

func EndExternalIncentive(
        _refundee, targetPoolPath, rewardToken string
)

Ends an incentive program.

Parameters

NameTypeDescription

refundee

string

The wallet address to receive the remaining staking rewards from the program.

targetPoolPath

string

The path of the pool to end the incentive program.

rewardToken

string

The token of the incentive program to end.

Last updated