Skip to main content

IFeeCalculator

IFeeCalculator

Addresses

ChainAddress

Functions

feeReferral

function feeReferral() external view returns (contract IFeeReferral)

getTradeFee

Get trade fee for a particular account, sender, and product.

function getTradeFee(FPUnsigned productFee, address account, address sender) external view returns (FPUnsigned)

Parameters

NameTypeDescription
productFeeFPUnsigneddefault fee for the product
accountaddressaccount to open position for
senderaddresssender of the transaction

Return Values

NameTypeDescription
[0]FPUnsignedfee total fee rate

getDepositFee

Get deposit fee for a particular sender.

function getDepositFee(address sender) external view returns (FPUnsigned fee)
Dev note

Since LP tokens are transferable, there's no point in allowing per- account discounts like we do for trade fees.

Parameters

NameTypeDescription
senderaddresssender of the transaction

Return Values

NameTypeDescription
feeFPUnsignedtotal fee rate. Range [0,1)[0, 1)

getWithdrawFee

Get withdraw fee for a particular sender.

function getWithdrawFee(address sender) external view returns (FPUnsigned fee)
Dev note

Since LP tokens are transferable, there's no point in allowing per- account discounts like we do for trade fees.

Parameters

NameTypeDescription
senderaddresssender of the transaction

Return Values

NameTypeDescription
feeFPUnsignedtotal fee rate. Range [0,1)[0, 1)