ISettlementTokenRegistry.sol
ISettlementTokenRegistry
Interface for the Settlement Token Registry contract.
SettlementTokenRegistered
event SettlementTokenRegistered(address token, address oracleProvider, uint256 minimumMargin, uint256 interestRate, uint256 flashLoanFeeRate, uint256 earningDistributionThreshold, uint24 uniswapFeeTier)
Emitted when a new settlement token is registered.
Parameters:
Name Type Description token address The address of the registered settlement token. oracleProvider address The oracle provider address for the settlement token. minimumMargin uint256 The minimum margin for the markets using this settlement token. interestRate uint256 The interest rate for the settlement token. flashLoanFeeRate uint256 The flash loan fee rate for the settlement token. earningDistributionThreshold uint256 The earning distribution threshold for the settlement token. uniswapFeeTier uint24 The Uniswap fee tier for the settlement token.
SetSettlementTokenOracleProvider
event SetSettlementTokenOracleProvider(address token, address oracleProvider)
Emitted when the oracle provider address for a settlement token is set.
Parameters:
Name Type Description token address The address of the settlement token. oracleProvider address The oracle provider address for the settlement token.
SetMinimumMargin
event SetMinimumMargin(address token, uint256 minimumMargin)
Emitted when the minimum margin for a settlement token is set.
Parameters:
Name Type Description token address The address of the settlement token. minimumMargin uint256 The new minimum margin for the settlement token.
SetFlashLoanFeeRate
event SetFlashLoanFeeRate(address token, uint256 flashLoanFeeRate)
Emitted when the flash loan fee rate for a settlement token is set.
Parameters:
Name Type Description token address The address of the settlement token. flashLoanFeeRate uint256 The new flash loan fee rate for the settlement token.
SetEarningDistributionThreshold
event SetEarningDistributionThreshold(address token, uint256 earningDistributionThreshold)
Emitted when the earning distribution threshold for a settlement token is set.
Parameters:
Name Type Description token address The address of the settlement token. earningDistributionThreshold uint256 The new earning distribution threshold for the settlement token.
SetUniswapFeeTier
event SetUniswapFeeTier(address token, uint24 uniswapFeeTier)
Emitted when the Uniswap fee tier for a settlement token is set.
Parameters:
Name Type Description token address The address of the settlement token. uniswapFeeTier uint24 The new Uniswap fee tier for the settlement token.
InterestRateRecordAppended
event InterestRateRecordAppended(address token, uint256 annualRateBPS, uint256 beginTimestamp)
Emitted when an interest rate record is appended for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. annualRateBPS uint256 The annual interest rate in basis points (BPS). beginTimestamp uint256 The timestamp when the interest rate record begins.
LastInterestRateRecordRemoved
event LastInterestRateRecordRemoved(address token, uint256 annualRateBPS, uint256 beginTimestamp)
Emitted when the last interest rate record is removed for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. annualRateBPS uint256 The annual interest rate in basis points (BPS). beginTimestamp uint256 The timestamp when the interest rate record begins.
registerSettlementToken
function registerSettlementToken(address token, address oracleProvider, uint256 minimumMargin, uint256 interestRate, uint256 flashLoanFeeRate, uint256 earningDistributionThreshold, uint24 uniswapFeeTier) external
Registers a new settlement token.
Parameters:
Name Type Description token address The address of the settlement token to register. oracleProvider address The oracle provider address for the settlement token. minimumMargin uint256 The minimum margin for the settlement token. interestRate uint256 The interest rate for the settlement token. flashLoanFeeRate uint256 The flash loan fee rate for the settlement token. earningDistributionThreshold uint256 The earning distribution threshold for the settlement token. uniswapFeeTier uint24 The Uniswap fee tier for the settlement token.
registeredSettlementTokens
function registeredSettlementTokens() external view returns (address[])
Gets the list of registered settlement tokens.
Return Values:
Name Type Description [0] address[] An array of addresses representing the registered settlement tokens.
isRegisteredSettlementToken
function isRegisteredSettlementToken(address token) external view returns (bool)
Checks if a settlement token is registered.
Parameters:
Name Type Description token address The address of the settlement token to check. Return Values:
Name Type Description [0] bool True if the settlement token is registered, false otherwise.
getSettlementTokenOracleProvider
function getSettlementTokenOracleProvider(address token) external view returns (address)
Gets the oracle provider address for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] address The oracle provider address for the settlement token.
setSettlementTokenOracleProvider
function setSettlementTokenOracleProvider(address token, address oracleProvider) external
Sets the oracle provider address for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. oracleProvider address The new oracle provider address for the settlement token.
getMinimumMargin
function getMinimumMargin(address token) external view returns (uint256)
Gets the minimum margin for a settlement token.
The minimumMargin is used as the minimum value for the taker margin of a position or as the minimum value for the maker margin of each bin.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] uint256 The minimum margin for the settlement token.
setMinimumMargin
function setMinimumMargin(address token, uint256 minimumMargin) external
Sets the minimum margin for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. minimumMargin uint256 The new minimum margin for the settlement token.
getFlashLoanFeeRate
function getFlashLoanFeeRate(address token) external view returns (uint256)
Gets the flash loan fee rate for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] uint256 The flash loan fee rate for the settlement token.
setFlashLoanFeeRate
function setFlashLoanFeeRate(address token, uint256 flashLoanFeeRate) external
Sets the flash loan fee rate for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. flashLoanFeeRate uint256 The new flash loan fee rate for the settlement token.
getEarningDistributionThreshold
function getEarningDistributionThreshold(address token) external view returns (uint256)
Gets the earning distribution threshold for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] uint256 The earning distribution threshold for the settlement token.
setEarningDistributionThreshold
function setEarningDistributionThreshold(address token, uint256 earningDistributionThreshold) external
Sets the earning distribution threshold for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. earningDistributionThreshold uint256 The new earning distribution threshold for the settlement token.
getUniswapFeeTier
function getUniswapFeeTier(address token) external view returns (uint24)
Gets the Uniswap fee tier for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] uint24 The Uniswap fee tier for the settlement token.
setUniswapFeeTier
function setUniswapFeeTier(address token, uint24 uniswapFeeTier) external
Sets the Uniswap fee tier for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. uniswapFeeTier uint24 The new Uniswap fee tier for the settlement token.
appendInterestRateRecord
function appendInterestRateRecord(address token, uint256 annualRateBPS, uint256 beginTimestamp) external
Appends an interest rate record for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. annualRateBPS uint256 The annual interest rate in basis points (BPS). beginTimestamp uint256 The timestamp when the interest rate record begins.
removeLastInterestRateRecord
function removeLastInterestRateRecord(address token) external
Removes the last interest rate record for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token.
currentInterestRate
function currentInterestRate(address token) external view returns (uint256)
Gets the current interest rate for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] uint256 The current interest rate for the settlement token.
getInterestRateRecords
function getInterestRateRecords(address token) external view returns (struct InterestRate.Record[])
Gets all the interest rate records for a settlement token.
Parameters:
Name Type Description token address The address of the settlement token. Return Values:
Name Type Description [0] struct InterestRate.Record[] An array of interest rate records for the settlement token.