interbtc-api

@interlay/interbtc-api / Exports / DefaultFeeAPI

Class: DefaultFeeAPI

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new DefaultFeeAPI(api, oracleAPI): DefaultFeeAPI

Parameters

Name Type
api ApiPromise
oracleAPI OracleAPI

Returns

DefaultFeeAPI

Defined in

src/parachain/fee.ts:56

Properties

api

Private api: ApiPromise

Defined in

src/parachain/fee.ts:56


oracleAPI

Private oracleAPI: OracleAPI

Defined in

src/parachain/fee.ts:56

Methods

calculateAPY

calculateAPY(feesWrapped, lockedCollateral, exchangeRate?): Promise<Big>

Parameters

Name Type Description
feesWrapped MonetaryAmount<Currency> Wrapped token fees accrued, in wrapped token (e.g. BTC)
lockedCollateral MonetaryAmount<CollateralCurrencyExt> Collateral value representing the value locked to gain yield.
exchangeRate? ExchangeRate<Currency, CollateralCurrencyExt> (Optional) Conversion rate, as a Monetary.js object

Returns

Promise<Big>

The APY, given the parameters

Implementation of

FeeAPI.calculateAPY

Defined in

src/parachain/fee.ts:100


getGriefingCollateral

getGriefingCollateral(amount, type): Promise<MonetaryAmount<CurrencyExt>>

Parameters

Name Type Description
amount MonetaryAmount<Currency> Amount, in BTC, for which to compute the required griefing collateral
type GriefingCollateralType Type of griefing collateral to compute (e.g. for issuing, replacing)

Returns

Promise<MonetaryAmount<CurrencyExt>>

The griefing collateral

Implementation of

FeeAPI.getGriefingCollateral

Defined in

src/parachain/fee.ts:58


getIssueFee

getIssueFee(): Promise<Big>

Returns

Promise<Big>

The percentage of issued token that is received by the vault as reward

Implementation of

FeeAPI.getIssueFee

Defined in

src/parachain/fee.ts:95


getIssueGriefingCollateralRate

getIssueGriefingCollateralRate(): Promise<Big>

Returns

Promise<Big>

The griefing collateral rate for issuing InterBTC

Implementation of

FeeAPI.getIssueGriefingCollateralRate

Defined in

src/parachain/fee.ts:85


getReplaceGriefingCollateralRate

getReplaceGriefingCollateralRate(): Promise<Big>

Returns

Promise<Big>

The griefing collateral rate for the Vault replace request

Implementation of

FeeAPI.getReplaceGriefingCollateralRate

Defined in

src/parachain/fee.ts:90