Skip to content

Latest commit

 

History

History

staking

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Staking Contract

Introduction

The Contract to hold Pair Between Swap Tokens.

Sections

Init

Request
Name Type Description optional
staking_amount Uint128 Total Reward Amount for staking no
reward_token TokenType Reward Token Type no
contract Contract AMMPair Contract Address Link to register staking contract no

User

Queries

GetContractOwner

Get Contract Owner Address.

Request
Name Type Description optional
Response
{
  "address": "Contract Owner Address",
}

Queries

GetConfig

Get Contract Config Info.

Request
Name Type Description optional
Response
{
  "reward_token": "Contract Link of Reward Token",
  "lp_token": "Contract Link of LP Token",
  "daily_reward_amount": "Reward Amount of Staking Contract",
  "contract_owner": "Admin Address of Staking Contract,
}

GetClaimReward

Get Claimable Reward for staker.

Request
Name Type Description optional
staker HumanAddr Address to calculate claimable amount no
time u128 Time to use for calculation claimable amount no
key String Key which user setup for viewing key no
Response
{
  "amount": "trade count",
}

GetStakerLpTokenInfo

Get Staker Lp Token Information.

Request
Name Type Description optional
staker HumanAddr Address to calculate claimable amount no
key String Key which user setup for viewing key no
Response
{
  "staked_lp_token": "Uint128",
  "total_staked_lp_token": "Uint128",
  "reward_token" : "Contract"
}

GetRewardTokenBalance

Get Reward Token Balance for staker

Request
Name Type Description optional
staker HumanAddr Address to calculate claimable amount no
key String Seed which user setup for viewing key no
Response
{
  "amount": "Uint128",
  "reward_token" : "Contract"
}

GetStakerRewardTokenBalance

Get Reward Token Balance for staker and total Reward Liquidity

Request
Name Type Description optional
staker HumanAddr Address to calculate claimable amount no
key String Seed which user setup for viewing key no
Response
{
  "reward_amount": "Uint128",
  "total_rewards_liquidity": "Uint128"
}

Messages

ClaimRewards

Claim reward.

Request
Name Type Description optional
Response
{
  "complete_task": {
    "status": "success"
  }
}

Unstake

Remove amount and address from staking

Request
Name Type Description optional
amount Uint128 Amount to unstake no
remove_liquidity bool Remove form liquidity yes
Response
{
  "complete_task": {
    "status": "success"
  }
}

SetVKForStaker

Set viewing key for staker

Request
Name Type Description optional
key String Seed for viewing key no
Response
{
  "complete_task": {
    "status": "success"
  }
}

SetRewardToken

Set either new reward token or update existing with emission_rate and valid to

Request
Name Type Description optional
reward_token Contract Reward Token Contract Link no
amount Uint128 Emission Rate no
valid_to Uint128 Timestamp till Reward Token is valid - milliseconds no
Response
{
  "complete_task": {
    "status": "success"
  }
}

Callback

Messages

Receive

Receive Callback.

Request
Name Type Description optional
from HumanAddr who invokes the callback no
msg Message to Invoke in Pair Contract yes
amount Uint128 amount sent no
Response
{
  "complete_task": {
    "status": "success"
  }
}

Invoke

Messages

Stake

Stake amount and address

Request
Name Type Description optional
from HumanAddr who invokes the callback no
amount Uint128 amount sent no

|

Response
{
  "complete_task": {
    "status": "success"
  }
}