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

Name
Type
Description

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(
	positionId uint64 
) (string, string, string)

Stakes a position.

Parameters

Name
Type
Description

positionId

uint64

The ID of the position to stake.

Return Values

Name
Type
Description

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(
    positionId uint64, 
    unwrapResult bool
) string

Collects staking rewards accrued to a position.

Parameters

Name
Type
Description

positionId

uint64

The ID of the position to collect incentives from.

unwrapResult

bool

(if position has wugnot fee) whether to receive reward in ugnot or not.

Return Values

Name
Type
Description

poolPath

string

The path of the pool that the position exists.

UnStakeToken

func UnStakeToken(
	positionId uint64
	unwrapResult bool
) (string, string, string)

The ID of the position to unstake.

Parameters

Name
Type
Description

positionId

uint64

The ID of the position to unstake.

Return Values

Name
Type
Description

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 std.Address,
        targetPoolPath,
        rewardToken string,
        startTimestamp int64,
        endTimestamp int64,
        height int64 
)

Ends an incentive program.

Parameters

Name
Type
Description

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.

startTimestamp

int64

The startTimestamp of the incentive program to end.

endTimestamp

int64

The endTimestamp of the incentive program to end.

height

int64

The created height of the incentive program to end.

Last updated

Was this helpful?