lib-base.fees.borrowingrate

Home > @mosaic/lib-base > Fees > borrowingRate

Fees.borrowingRate() method

Calculate the current borrowing rate.

Signature:

borrowingRate(when?: Date): Decimal;

Parameters

Returns:

Decimal

Remarks

By default, the fee is calculated at the time of the latest block. This can be overridden using the when parameter.

To calculate the borrowing fee in MoUSD, multiply the borrowed MoUSD amount by the borrowing rate.

Example

const fees = await mosaic.getFees();

const borrowedMoUSDAmount = 100;
const borrowingRate = fees.borrowingRate();
const borrowingFeeMoUSD = borrowingRate.mul(borrowedMoUSDAmount);

Last updated