Skip to main content

IFundingManager

IFundingManager

Addresses

ChainAddress

Functions

updateFunding

Update cumulative sums with the integral of the current funding and interest rates since last update.

function updateFunding(bytes32 _productId) external
Dev note

Called whenever a product's funding and interest rates change. Only callable by DomFiPerp

Parameters

NameTypeDescription
_productIdbytes32product to update

getCumulativeFunding

Get cumulative funding, as a percent, for a product since it was added. Compare this to a previous cumulative funding value to see the net funding accrued between the two measurements.

function getCumulativeFunding(bytes32 _productId) external view returns (FPSigned cumulativeFunding)

Parameters

NameTypeDescription
_productIdbytes32product in question

Return Values

NameTypeDescription
cumulativeFundingFPSignedintegral of getFundingRate(_productId)

getCumulativeInterest

Get cumulative interest, as a percent, for a product since it was added. Compare this to a previous cumulative interest value to see the interest accrued between the two measurements. Note that unlike funding, interest rate is always positive; cumulative interest will never decrease.

function getCumulativeInterest(bytes32 _productId) external view returns (FPUnsigned cumulativeInterest)

Parameters

NameTypeDescription
_productIdbytes32product in question

Return Values

NameTypeDescription
cumulativeInterestFPUnsignedintegral of getInterestRate(_productId)

getFundingRate

get funding rate for the given product

function getFundingRate(bytes32 _productId) external view returns (FPSigned fundingRate)

Parameters

NameTypeDescription
_productIdbytes32product to get funding rate for

Return Values

NameTypeDescription
fundingRateFPSigned% per year charged for long and paid to short orders

getInterestRate

get interest rate for the given product

function getInterestRate(bytes32 _productId) external view returns (FPUnsigned interestRate)

Parameters

NameTypeDescription
_productIdbytes32product to get interest rate for

Return Values

NameTypeDescription
interestRateFPUnsignedflat % per year charged to both long and short orders