StabilityPool

Write Methods

function provideToSP(uint256 _amount) external

Deposits debt tokens into the pool, accrues rewards, and updates snapshots.

Input Parameter

Type

Description

_amount

uint256

Amount of debt tokens to deposit.

function withdrawFromSP(uint256 _amount) external

Withdraws debt tokens from the pool, claims rewards, and updates snapshots.

Input Parameter

Type

Description

_amount

uint256

Amount of debt tokens to withdraw.

function claimCollateralGains(
        address recipient,
        uint256[] calldata collateralIndexes
    ) public

Claims collateral gains for specified tokens and sends them to the recipient.

Input Parameter

Type

Description

recipient

address

Address to receive gains.

collateralIndexes

uint256[]

Array of collateral indices to claim.

Returns the pending Bit rewards for a depositor.

Input Parameter

Type

Description

recipient

address

Address to receive rewards.

Returns:

Return Value

Type

Description

amount

uint256

Amount of rewards claimed.

View Methods

Returns the total debt tokens deposited in the pool.

Returns:

Return Value

Type

Description

totalDebt

uint256

Total debt tokens deposited.

Returns the collateral gains earned by a depositor.

Input Parameter

Type

Description

_depositor

address

Depositor address.

Returns:

Return Value

Type

Description

collateralGains

uint256[]

Array of collateral gains per token.

Returns the pending Bit rewards for a depositor.

Input Parameter

Type

Description

_depositor

address

Depositor address.

Returns:

Return Value

Type

Description

reward

uint256

Claimable reward amount.

Calculates a depositor’s compounded debt deposit after rewards.

Input Parameter

Type

Description

_depositor

address

Depositor address.

Returns:

Return Value

Type

Description

compoundedDeposit

uint256

Compounded debt deposit amount.

Structs

Events

Last updated