IFundingManager
IFundingManager
Addresses
Chain | Address |
---|
Functions
updateFunding
Update cumulative sums with the integral of the current funding and interest rates since last update.
function updateFunding(ProductId _productId) external
Dev note
Called whenever a product's funding and interest rates change. Only callable by DomFiPerp
Parameters
Name | Type | Description |
---|---|---|
_productId | ProductId | product 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(ProductId _productId) external view returns (FPSigned cumulativeFunding)
Parameters
Name | Type | Description |
---|---|---|
_productId | ProductId | product in question |
Return Values
Name | Type | Description |
---|---|---|
cumulativeFunding | FPSigned | integral 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(ProductId _productId) external view returns (FPUnsigned cumulativeInterest)
Parameters
Name | Type | Description |
---|---|---|
_productId | ProductId | product in question |
Return Values
Name | Type | Description |
---|---|---|
cumulativeInterest | FPUnsigned | integral of getInterestRate(_productId) |
getFundingRate
get funding rate for the given product
function getFundingRate(ProductId _productId) external view returns (FPSigned fundingRate)
Parameters
Name | Type | Description |
---|---|---|
_productId | ProductId | product to get funding rate for |
Return Values
Name | Type | Description |
---|---|---|
fundingRate | FPSigned | % per year charged for long and paid to short orders |
getInterestRate
get interest rate for the given product
function getInterestRate(ProductId _productId) external view returns (FPUnsigned interestRate)
Parameters
Name | Type | Description |
---|---|---|
_productId | ProductId | product to get interest rate for |
Return Values
Name | Type | Description |
---|---|---|
interestRate | FPUnsigned | flat % per year charged to both long and short orders |