Skip to content

IFtsoRegistry#

Source | Inherits from IFtsoRegistryGenesis

Interface for the FtsoRegistry contract.

Functions#

getAllCurrentPrices#

Defined in IFtsoRegistry (Docs, Source).

function getAllCurrentPrices(
) external view returns (
    struct IFtsoRegistry.PriceInfo[]);

Returns the current price of all supported assets.

Returns Type Description
[0] struct IFtsoRegistry.PriceInfo[] Array of PriceInfo structures.

getCurrentPrice#

Defined in IFtsoRegistry (Docs, Source).

function getCurrentPrice(
    uint256 _ftsoIndex
) external view returns (
    uint256 _price,
    uint256 _timestamp);

Public view function to get the current price of a given active FTSO index. Reverts if the index is not supported.

Parameters Type Description
_ftsoIndex uint256 Index to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^ASSET_PRICE_USD_DECIMALS.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.

getCurrentPrice#

Defined in IFtsoRegistry (Docs, Source).

function getCurrentPrice(
    string _symbol
) external view returns (
    uint256 _price,
    uint256 _timestamp);

Public view function to get the current price of a given active asset symbol. Reverts if the symbol is not supported.

Parameters Type Description
_symbol string Symbol to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^ASSET_PRICE_USD_DECIMALS.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.

getCurrentPriceWithDecimals#

Defined in IFtsoRegistry (Docs, Source).

function getCurrentPriceWithDecimals(
    uint256 _assetIndex
) external view returns (
    uint256 _price,
    uint256 _timestamp,
    uint256 _assetPriceUsdDecimals);

Public view function to get the current price and decimals of a given active FTSO index. Reverts if the index is not supported.

Parameters Type Description
_assetIndex uint256 Index to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^_assetPriceUsdDecimals.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.
_assetPriceUsdDecimals uint256 Number of decimals used to return the _price.

getCurrentPriceWithDecimals#

Defined in IFtsoRegistry (Docs, Source).

function getCurrentPriceWithDecimals(
    string _symbol
) external view returns (
    uint256 _price,
    uint256 _timestamp,
    uint256 _assetPriceUsdDecimals);

Public view function to get the current price and decimals of a given active asset symbol. Reverts if the symbol is not supported.

Parameters Type Description
_symbol string Symbol to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^_assetPriceUsdDecimals.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.
_assetPriceUsdDecimals uint256 Number of decimals used to return the _price.

getCurrentPricesByIndices#

Defined in IFtsoRegistry (Docs, Source).

function getCurrentPricesByIndices(
    uint256[] _indices
) external view returns (
    struct IFtsoRegistry.PriceInfo[]);

Returns the current price of a list of indices. Reverts if any of the indices is not supported.

Parameters Type Description
_indices uint256[] Array of indices to query.
Returns Type Description
[0] struct IFtsoRegistry.PriceInfo[] Array of PriceInfo structures.

getCurrentPricesBySymbols#

Defined in IFtsoRegistry (Docs, Source).

function getCurrentPricesBySymbols(
    string[] _symbols
) external view returns (
    struct IFtsoRegistry.PriceInfo[]);

Returns the current price of a list of asset symbols. Reverts if any of the symbols is not supported.

Parameters Type Description
_symbols string[] Array of symbols to query.
Returns Type Description
[0] struct IFtsoRegistry.PriceInfo[] Array of PriceInfo structures.

getFtso#

Defined in IFtsoRegistry (Docs, Source).

function getFtso(
    uint256 _activeFtso
) external view returns (
    contract IIFtso _activeFtsoAddress);

Returns the address of the FTSO contract for a given index. Reverts if unsupported index is passed.

Parameters Type Description
_activeFtso uint256 The queried index.
Returns Type Description
_activeFtsoAddress contract IIFtso FTSO contract address for the queried index.

getFtsoBySymbol#

Defined in IFtsoRegistry (Docs, Source).

function getFtsoBySymbol(
    string _symbol
) external view returns (
    contract IIFtso _activeFtsoAddress);

Returns the address of the FTSO contract for a given symbol. Reverts if unsupported symbol is passed.

Parameters Type Description
_symbol string The queried symbol.
Returns Type Description
_activeFtsoAddress contract IIFtso FTSO contract address for the queried symbol.

getFtsoIndex#

Defined in IFtsoRegistry (Docs, Source).

function getFtsoIndex(
    string _symbol
) external view returns (
    uint256 _assetIndex);

Returns the FTSO index corresponding to a given asset symbol. Reverts if the symbol is not supported.

Parameters Type Description
_symbol string Symbol to query.
Returns Type Description
_assetIndex uint256 The corresponding asset index.

getFtsoSymbol#

Defined in IFtsoRegistry (Docs, Source).

function getFtsoSymbol(
    uint256 _ftsoIndex
) external view returns (
    string _symbol);

Returns the asset symbol corresponding to a given FTSO index. Reverts if the index is not supported.

Parameters Type Description
_ftsoIndex uint256 Index to query.
Returns Type Description
_symbol string The corresponding asset symbol.

getFtsos#

Defined in IFtsoRegistryGenesis (Docs, Source).

function getFtsos(
    uint256[] _indices
) external view returns (
    contract IFtsoGenesis[] _ftsos);

Get the addresses of the active FTSOs at the given indices. Reverts if any of the provided indices is non-existing or inactive.

Parameters Type Description
_indices uint256[] Array of FTSO indices to query.
Returns Type Description
_ftsos contract IFtsoGenesis[] The array of FTSO addresses.

getSupportedFtsos#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedFtsos(
) external view returns (
    contract IIFtso[] _ftsos);

Get array of all FTSO contracts for all supported asset indices. The index of FTSO in returned array does not necessarily correspond to the asset's index. Due to deletion, some indices might be unsupported.

Use getSupportedIndicesAndFtsos to retrieve pairs of correct indices and FTSOs, where possible "null" holes are readily apparent.

Returns Type Description
_ftsos contract IIFtso[] Array of all supported FTSOs.

getSupportedIndices#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedIndices(
) external view returns (
    uint256[] _supportedIndices);

Returns the indices of the currently supported FTSOs. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all active FTSO indices in increasing order.

getSupportedIndicesAndFtsos#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedIndicesAndFtsos(
) external view returns (
    uint256[] _supportedIndices,
    contract IIFtso[] _ftsos);

Get all supported indices and corresponding FTSO addresses. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all supported indices.
_ftsos contract IIFtso[] Array of all supported FTSO addresses.

getSupportedIndicesAndSymbols#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedIndicesAndSymbols(
) external view returns (
    uint256[] _supportedIndices,
    string[] _supportedSymbols);

Get all supported indices and corresponding symbols. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all supported indices.
_supportedSymbols string[] Array of all supported symbols.

getSupportedIndicesSymbolsAndFtsos#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedIndicesSymbolsAndFtsos(
) external view returns (
    uint256[] _supportedIndices,
    string[] _supportedSymbols,
    contract IIFtso[] _ftsos);

Get all supported indices, symbols, and corresponding FTSO addresses. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all supported indices.
_supportedSymbols string[] Array of all supported symbols.
_ftsos contract IIFtso[] Array of all supported FTSO addresses.

getSupportedSymbols#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedSymbols(
) external view returns (
    string[] _supportedSymbols);

Returns the symbols of the currently supported FTSOs. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedSymbols string[] Array of all active FTSO symbols in increasing order.

getSupportedSymbolsAndFtsos#

Defined in IFtsoRegistry (Docs, Source).

function getSupportedSymbolsAndFtsos(
) external view returns (
    string[] _supportedSymbols,
    contract IIFtso[] _ftsos);

Get all supported symbols and corresponding FTSO addresses. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedSymbols string[] Array of all supported symbols.
_ftsos contract IIFtso[] Array of all supported FTSO addresses.

Structures#

PriceInfo#

Defined in IFtsoRegistry (Docs, Source).

struct PriceInfo {
  uint256 ftsoIndex;
  uint256 price;
  uint256 decimals;
  uint256 timestamp;
}

Last update: 2024-03-01