The Staking Contract contains the logic for LP Token staking and reward distribution. Staking rewards for LP stakers come from the new NEB tokens generated at each block by the Factory Contract and are split between all combined staking pools. The new NEB tokens are distributed in proportion to size of staked LP tokens multiplied by the weight of that asset's staking pool.
{
"owner": String,
"nebula_token": String,
"astroport_factory": String
}
- address of the owner of the
staking
contract nebula_token
: contract address of Nebula Token (NEB)astroport_factory
: address of the Astroport factory contract
Can be called during a CW20 token transfer when the Gov contract is the recipient. Allows the token transfer to execute a Receive Hook as a subsequent action within the same transaction.
{
"receive": {
"amount": Uint128,
"sender": String,
"msg": Option<Binary>
}
}
amount
: amount of tokens receivedsender
: sender of the token transfermsg
: Base64-encoded JSON of the Receive Hook
Updates contract variables
{
"update_config": {
"owner": Option<String>
}
}
owner
: address of the owner of thestaking
contract
Registers a new staking pool for an asset token and associates the LP token with the staking pool.
{
"register_asset": {
"asset_token": String,
"staking_token": String
}
}
asset_token
: contract address of cluster/NEB tokenstaking_token
: contract address of asset's corresponding LP token
Users can issue the unbond message at any time to remove their staked LP tokens from a staking position
{
"unbond": {
"asset_token": String,
"amount": Uint128
}
}
asset_token
: contract address of cluster/NEB tokenamount
: amount of LP tokens to unbond
Withdraws a user's rewards for a specific staking position
{
"withdraw": {
"asset_token": Option<String>
}
}
asset_token
: contract address of asset token (staking pool identifier). If empty, withdraws all rewards from all staking pools involved.
When providing liquidity in Nebula Protocol, asset pair is first sent to Staking contract, and it acts as a relay. When defined assets are sent to the contract, the contract provides liquidity to receive LP tokens and starts AutoStakeHook.
Note: Executor of the transaction should first increase allowance to spend CW20 tokens
{
"auto_stake": {
"assets": [Asset; 2],
"slippage_tolerance": Option<Decimal>
}
}
assets
: information of assets that are provided into liquidity poolslippage_tolerance
: maximum price slippage allowed to execute this transaction
Can be issued when the user sends LP Tokens to the Staking contract. The LP token must be recognized by the staking pool of the specified asset token.
If you send LP Tokens to the Staking contract without issuing this hook, they will not be staked and will BE LOST FOREVER.
{
"bond": {
"asset_token": String
}
}
asset_token
: contract address of asset token
Can be issued when the user sends NEB tokens to the Staking contract, which will be used as rewards for the specified asset's staking pool. Used by Factory Contract to deposit newly minted NEB tokens.
{
"deposit_reward": {
"rewards": Vec<(String, Uint128)>
}
}
rewards
: list of reward info. vector of (asset_token, reward_amount)
{
"config": {}
}
Returns information related to a staking pool
{
"pool_info": {
"asset_token": String
}
}
asset_token
: contract address of asset token to query pool info for
Returns information related to a staker's reward info
{
"reward_info": {
"staker_addr": String,
"asset_token": Option<String>
}
}
staker_addr
: address of the staker to query the reward info forasset_token
: contract address of asset token to query pool info for. If empty, will return all revelant rewards forstaker_addr