Skip to main content

IOracleProviderRegistry.sol

IOracleProviderRegistry

Interface for the Oracle Provider Registry contract.

OracleProviderRegistered

event OracleProviderRegistered(address oracleProvider, struct OracleProviderProperties properties)

Emitted when a new oracle provider is registered.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the registered oracle provider.
    propertiesstruct OracleProviderPropertiesThe properties of the registered oracle provider.

OracleProviderUnregistered

event OracleProviderUnregistered(address oracleProvider)

Emitted when an oracle provider is unregistered.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the unregistered oracle provider.

UpdateTakeProfitBPSRange

event UpdateTakeProfitBPSRange(address oracleProvider, uint32 minTakeProfitBPS, uint32 maxTakeProfitBPS)

Emitted when the take-profit basis points range of an oracle provider is updated.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider.
    minTakeProfitBPSuint32The new minimum take-profit basis points.
    maxTakeProfitBPSuint32The new maximum take-profit basis points.

UpdateLeverageLevel

event UpdateLeverageLevel(address oracleProvider, uint8 level)

Emitted when the level of an oracle provider is set.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider.
    leveluint8The new level set for the oracle provider.

registerOracleProvider

function registerOracleProvider(address oracleProvider, struct OracleProviderProperties properties) external

Registers an oracle provider.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider to register.
    propertiesstruct OracleProviderPropertiesThe properties of the oracle provider.

unregisterOracleProvider

function unregisterOracleProvider(address oracleProvider) external

Unregisters an oracle provider.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider to unregister.

registeredOracleProviders

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

Gets the registered oracle providers.

  • Return Values:

    NameTypeDescription
    [0]address[]An array of registered oracle provider addresses.

isRegisteredOracleProvider

function isRegisteredOracleProvider(address oracleProvider) external view returns (bool)

Checks if an oracle provider is registered.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider to check.
  • Return Values:

    NameTypeDescription
    [0]boolA boolean indicating if the oracle provider is registered.

getOracleProviderProperties

function getOracleProviderProperties(address oracleProvider) external view returns (struct OracleProviderProperties)

Retrieves the properties of an oracle provider.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider.
  • Return Values:

    NameTypeDescription
    [0]struct OracleProviderPropertiesThe properties of the oracle provider.

updateTakeProfitBPSRange

function updateTakeProfitBPSRange(address oracleProvider, uint32 minTakeProfitBPS, uint32 maxTakeProfitBPS) external

Updates the take-profit basis points range of an oracle provider.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider.
    minTakeProfitBPSuint32The new minimum take-profit basis points.
    maxTakeProfitBPSuint32The new maximum take-profit basis points.

updateLeverageLevel

function updateLeverageLevel(address oracleProvider, uint8 level) external

Updates the leverage level of an oracle provider in the registry.

The level must be either 0 or 1, and the max leverage must be x10 for level 0 or x20 for level 1.

  • Parameters:

    NameTypeDescription
    oracleProvideraddressThe address of the oracle provider.
    leveluint8The new leverage level to be set for the oracle provider.