Skip to main content

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:

    NameTypeDescription
    tokenaddressThe address of the registered settlement token.
    oracleProvideraddressThe oracle provider address for the settlement token.
    minimumMarginuint256The minimum margin for the markets using this settlement token.
    interestRateuint256The interest rate for the settlement token.
    flashLoanFeeRateuint256The flash loan fee rate for the settlement token.
    earningDistributionThresholduint256The earning distribution threshold for the settlement token.
    uniswapFeeTieruint24The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    oracleProvideraddressThe 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    minimumMarginuint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    flashLoanFeeRateuint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    earningDistributionThresholduint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    uniswapFeeTieruint24The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    annualRateBPSuint256The annual interest rate in basis points (BPS).
    beginTimestampuint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    annualRateBPSuint256The annual interest rate in basis points (BPS).
    beginTimestampuint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token to register.
    oracleProvideraddressThe oracle provider address for the settlement token.
    minimumMarginuint256The minimum margin for the settlement token.
    interestRateuint256The interest rate for the settlement token.
    flashLoanFeeRateuint256The flash loan fee rate for the settlement token.
    earningDistributionThresholduint256The earning distribution threshold for the settlement token.
    uniswapFeeTieruint24The Uniswap fee tier for the settlement token.

registeredSettlementTokens

function registeredSettlementTokens() external view returns (address[])

Gets the list of registered settlement tokens.

  • Return Values:

    NameTypeDescription
    [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:

    NameTypeDescription
    tokenaddressThe address of the settlement token to check.
  • Return Values:

    NameTypeDescription
    [0]boolTrue 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]addressThe 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    oracleProvideraddressThe 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]uint256The minimum margin for the settlement token.

setMinimumMargin

function setMinimumMargin(address token, uint256 minimumMargin) external

Sets the minimum margin for a settlement token.

  • Parameters:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    minimumMarginuint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]uint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    flashLoanFeeRateuint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]uint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    earningDistributionThresholduint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]uint24The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    uniswapFeeTieruint24The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
    annualRateBPSuint256The annual interest rate in basis points (BPS).
    beginTimestampuint256The timestamp when the interest rate record begins.

removeLastInterestRateRecord

function removeLastInterestRateRecord(address token) external

Removes the last interest rate record for a settlement token.

  • Parameters:

    NameTypeDescription
    tokenaddressThe address of the settlement token.

currentInterestRate

function currentInterestRate(address token) external view returns (uint256)

Gets the current interest rate for a settlement token.

  • Parameters:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]uint256The 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:

    NameTypeDescription
    tokenaddressThe address of the settlement token.
  • Return Values:

    NameTypeDescription
    [0]struct InterestRate.Record[]An array of interest rate records for the settlement token.