Rewards Dispatcher

The Rewards Dispatcher contract accumulates the rewards from Hub's delegations and manages the rewards.

All rewards from stINJ tokens (the share of all rewards proportional to the amount of stINJ tokens minted) are converted to INJ and are re-delegated back to the validators pool.

All rewards from bINJ (the share of all rewards proportional to the amount of bINJ tokens minted) are sent to the Reward Contract and handled the old way.

Config

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct Config {
    pub owner: CanonicalAddr,
    pub hub_contract: CanonicalAddr,
    pub binj_reward_contract: CanonicalAddr,
    pub stinj_reward_denom: String,
    pub binj_reward_denom: String,
    pub ninja_keeper_address: CanonicalAddr,
    pub ninja_keeper_rate: Decimal,
    pub swap_contract: CanonicalAddr,
    pub swap_denoms: Vec<String>,
    pub oracle_contract: CanonicalAddr,
}
KeyTypeDescription

owner

CanonicalAddr

Owner of the contract

hub_contract

CanonicalAddr

Contract address of Hub

binj_reward_contract

CanonicalAddr

Contract address of bINJ Reward

stinj_reward_denom

String

Native token denomination for distributed stINJ rewards

binj_reward_denom

String

Native token denomination for distributed bINJ rewards

ninja_keeper_address

CanonicalAddr

Address for fee distribution

ninja_keeper_rate

Decimal

Amount of fees which goes to Fee Address

swap_contract

CanonicalAddr

Contract address of Swap Extension

swap_denoms

Vec<String>

The supported swap denoms type is configured as "inj"

oracle_contract

CanonicalAddr

Contract address of Oracle

InitMsg

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
    pub hub_contract: String,
    pub binj_reward_contract: String,
    pub stinj_reward_denom: String,
    pub binj_reward_denom: String,
    pub ninja_keeper_address: String,
    pub ninja_keeper_rate: Decimal,
    pub swap_contract: String,
    pub swap_denoms: Vec<String>,
    pub oracle_contract: String,
}
KeyTypeDescription

hub_contract

CanonicalAddr

Contract address of Hub

binj_reward_contract

CanonicalAddr

Contract address of bINJ Reward

stinj_reward_denom

String

Native token denomination for distributed stINJ rewards

binj_reward_denom

String

Native token denomination for distributed bINJ rewards

ninja_keeper_address

CanonicalAddr

Address for fee distribution

ninja_keeper_rate

Decimal

Amount of fees which goes to Fee Address

swap_contract

CanonicalAddr

Contract address of Swap Extension

swap_denoms

Vec<String>

The supported swap denoms type is configured as "inj"

oracle_contract

CanonicalAddr

Contract address of Oracle

ExecuteMsg

[Internal] SwapToRewardDenom

Swaps all native tokens on his balance to INJ and kUSD proportional to the minted stINJ and bINJ amount.

Can only be executed by the Hub.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    SwapToRewardDenom {
        binj_total_bonded: Uint128,
        stinj_total_bonded: Uint128,
    },
}
KeyTypeDescription

binj_total_bonded

Uint128

Total amount of minted bINJ

stinj_total_bonded

Uint128

Total amount of minted stINJ

[Internal] DispatchRewards

Re-stakes the stINJ rewards (with subtracted Fee) and sends the bINJ rewards to the old bINJ Rewards contract (with subtracted Fee).

Can only be executed by the Hub.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    DispatchRewards {},
}

UpdateConfig

Updates the dispatcher's configuration. Can only be executed by the owner.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateConfig {
        hub_contract: Option<String>,
        binj_reward_contract: Option<String>,
        stinj_reward_denom: Option<String>,
        binj_reward_denom: Option<String>,
        ninja_keeper_address: Option<String>,
        ninja_keeper_rate: Option<Decimal>,
    },
}
KeyTypeDescription

hub_contract

String

Contract address of Hub

binj_reward_contract

String

Contract address of bINJ Reward

stinj_reward_denom

String

Native token denomination for distributed stINJ rewards

binj_reward_denom

String

Native token denomination for distributed bINJ rewards

krp_keeper_addres

String

Address for fee distribution

ninja_keeper_rate

Decimal

Amount of fees which goes to Fee Address

SetOwner

Transfer ownership permissions to a new owner address.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
 SetOwner {
        new_owner_addr: String,
    },
}
KeyTypeDescription

new_owner_addr

String

The address of new owner

AcceptOwnership

The new owner accepts ownership permissions.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    AcceptOwnership {},
}

UpdateSwapContract

Update the contract address of the Swap Extension, which can only be modified by the owner.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
     UpdateSwapContract {
        swap_contract: String,
     },
}
KeyTypeDescription

swap_contract

String

The new address of Swap Extension

UpdateSwapDenom

Add or remove Native token denomination types supported by the Swap Extension.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateSwapDenom {
        swap_denom: String,
        is_add: bool,
    },
}
KeyTypeDescription

swap_denom

String

Add or remove Native token denomination types

is_add

bool

"true" represents "add", and "false" represents "remove"

UpdateOracleContract

Update the contract address of the Oracle, which can only be modified by the owner.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
    UpdateOracleContract{
        oracle_contract: String,
    }
}
KeyTypeDescription

oracle_contract

String

The new address of Oracle

QueryMsg

Config

Returns the current configuration of the contract.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Config {},
}

ConfigResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct ConfigResponse {
    pub owner: String,
    pub hub_contract: String,
    pub binj_reward_contract: String,
    pub stinj_reward_denom: String,
    pub binj_reward_denom: String,
    pub ninja_keeper_address: String,
    pub ninja_keeper_rate: Decimal,
    pub swap_contract: String,
    pub swap_denoms: Vec<String>,
    pub oracle_contract: String,
}
KeyTypeDescription

owner

CanonicalAddr

Owner of the contract

hub_contract

CanonicalAddr

Contract address of Hub

binj_reward_contract

CanonicalAddr

Contract address of bINJ Reward

stinj_reward_denom

String

Native token denomination for distributed stINJ rewards

binj_reward_denom

String

Native token denomination for distributed bINJ rewards

ninja_keeper_address

CanonicalAddr

Address for fee distribution

ninja_keeper_rate

Decimal

Amount of fees which goes to Fee Address

swap_contract

CanonicalAddr

Contract address of Swap Extension

swap_denoms

Vec<String>

The supported swap denoms type is configured as "inj"

oracle_contract

CanonicalAddr

Contract address of Oracle

NewOwner

Query the address of the new owner.

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
  NewOwner {},
}

NewOwnerResponse

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct NewOwnerResponse {
    pub new_owner: String,
}
KeyTypeDescription

new_owner

String

The address of new owner

Last updated