Skip to content

Latest commit

 

History

History
213 lines (130 loc) · 4.84 KB

Incentives.md

File metadata and controls

213 lines (130 loc) · 4.84 KB

Incentives

Acala Developers

Incentives Predeploy Contract

You can use this predeploy contract to call incentives pallet

This contracts will interact with incentives pallet

Methods

claimRewards

function claimRewards(enum InterfaceIncentives.PoolId pool, address poolCurrencyId) external nonpayable returns (bool)

Claim all avalible multi currencies rewards for specific PoolId.

It'll emit an {ClaimedRewards} event.

Parameters

Name Type Description
pool enum InterfaceIncentives.PoolId The pool type.
poolCurrencyId address The LP token currency id.

Returns

Name Type Description
_0 bool Returns a boolean value indicating whether the operation succeeded.

depositDexShare

function depositDexShare(address currencyId, uint256 amount) external nonpayable returns (bool)

Stake LP token to add shares to PoolId::Dex.

It'll emit an {DepositedShare} event.

Parameters

Name Type Description
currencyId address The LP token currency id.
amount uint256 The amount to stake.

Returns

Name Type Description
_0 bool Returns a boolean value indicating whether the operation succeeded.

getClaimRewardDeductionRate

function getClaimRewardDeductionRate(enum InterfaceIncentives.PoolId pool, address poolCurrencyId) external view returns (uint256)

Gets deduction rate for claiming reward early.

Parameters

Name Type Description
pool enum InterfaceIncentives.PoolId The pool type.
poolCurrencyId address The LP token currency id.

Returns

Name Type Description
_0 uint256 Returns (claim_reward_deduction_rate) as a FixedU128 representing a decimal value.

getIncentiveRewardAmount

function getIncentiveRewardAmount(enum InterfaceIncentives.PoolId pool, address poolCurrencyId, address rewardCurrencyId) external view returns (uint256)

Gets reward amount in rewardCurrency added per period.

Parameters

Name Type Description
pool enum InterfaceIncentives.PoolId The pool type.
poolCurrencyId address The LP token currency id.
rewardCurrencyId address The reward currency id.

Returns

Name Type Description
_0 uint256 Returns (reward_amount).

getPendingRewards

function getPendingRewards(address[] currencyIds, enum InterfaceIncentives.PoolId pool, address poolCurrencyId, address who) external view returns (uint256[])

Gets the pending rewards for a pool, actual reward could be deducted.

Parameters

Name Type Description
currencyIds address[] undefined
pool enum InterfaceIncentives.PoolId The pool type.
poolCurrencyId address The LP token currency id.
who address The specified user.

Returns

Name Type Description
_0 uint256[] Returns (balances), an array of reward balances corresponding to currencyIds.

withdrawDexShare

function withdrawDexShare(address currencyId, uint256 amount) external nonpayable returns (bool)

Unstake LP token to remove shares from PoolId::Dex.

It'll emit an {WithdrewShare} event.

Parameters

Name Type Description
currencyId address The LP token currency id.
amount uint256 The amount to unstake.

Returns

Name Type Description
_0 bool Returns a boolean value indicating whether the operation succeeded.

Events

ClaimedRewards

event ClaimedRewards(address indexed sender, enum InterfaceIncentives.PoolId indexed pool, address indexed poolCurrencyId)

The Claimed rewards event.

Parameters

Name Type Description
sender indexed address The sender of the transaction.
pool indexed enum InterfaceIncentives.PoolId The pool type.
poolCurrencyId indexed address The LP token currency id.

DepositedShare

event DepositedShare(address indexed sender, address indexed currencyId, uint256 amount)

The deposited share event.

Parameters

Name Type Description
sender indexed address The sender of the transaction.
currencyId indexed address The LP token currency id.
amount uint256 The amount to stake.

WithdrewShare

event WithdrewShare(address indexed sender, address indexed currencyId, uint256 amount)

The withdrew share event.

Parameters

Name Type Description
sender indexed address The sender of the transaction.
currencyId indexed address The LP token currency id.
amount uint256 The amount to unstake.