Fee Calculator

Git Source

Inherits: IFeeCalculator

Author: Sperax Foundation

A contract that calculates fees for minting and redeeming USDs.

State Variables

LOWER_THRESHOLD

uint16 private constant LOWER_THRESHOLD = 5000;

UPPER_THRESHOLD

uint16 private constant UPPER_THRESHOLD = 15000;

DISCOUNT_FACTOR

uint16 private constant DISCOUNT_FACTOR = 2;

PENALTY_MULTIPLIER

CALIBRATION_GAP

COLLATERAL_MANAGER

collateralFee

Functions

constructor

calibrateFee

Calibrates fee for a particular collateral

Parameters

Name
Type
Description

_collateral

address

Address of the desired collateral

getMintFee

Calculates fee to be collected for minting

Parameters

Name
Type
Description

_collateral

address

Returns

Name
Type
Description

uint256

(uint256) baseFeeIn

getRedeemFee

Calculates fee to be collected for redeeming

Parameters

Name
Type
Description

_collateral

address

Returns

Name
Type
Description

uint256

(uint256) baseFeeOut

calibrateFeeForAll

Calibrates fee for all the collaterals registered

_calibrateFee

Helper function for calibrating fee for a collateral

Parameters

Name
Type
Description

_collateral

address

Address of the desired collateral

Events

FeeCalibrated

Errors

InvalidCalibration

Structs

FeeData

Last updated