Block-Latency Feeds
FTSOv2's block-latency feeds update incrementally with each new block on Flare, approximately every 1.8 seconds. Every feed leverages Flare's network of 100 independent data providers. These feeds primarily support cryptocurrency price data and are free to query on Flare, enabling decentralized applications to access up-to-date information without incurring additional costs.
Each block-latency feed is uniquely identified by an ID composed of three components in a structured encoding process:
-
Category: Indicates the type of asset - Crypto:
01
, Forex:02
, Commodity:03
, Stock:04
-
Hex-Encoded Feed Name: The name of the feed is converted to a hexadecimal format.
-
Zero Padding: The combined category and hex-encoded feed name are padded with zeros to a length of 21 bytes.
The resulting string is then prefixed with 0x
.
Example of the structured encoding process.
Taking the feed name FLR/USD
:
- Category:
01
(Crypto) - Hex-Encoded Feed Name:
464c522f555344
(hexadecimal representation ofFLR/USD
) - Zero Padding: The category and hex-encoded feed name combined and padded:
01464c522f55534400000000000000000000000000
- Final ID: Adding the
0x
prefix results in0x01464c522f55534400000000000000000000000000
- Solidity
- Javascript
- Python
- Rust
- Go
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;
import {ContractRegistry} from "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol";
import {IFtsoFeedIdConverter} from "@flarenetwork/flare-periphery-contracts/coston2/IFtsoFeedIdConverter.sol";
contract GetFeedId {
IFtsoFeedIdConverter internal feedIdConverter;
constructor() {
feedIdConverter = ContractRegistry.getFtsoFeedIdConverter();
}
function exampleFlrUsdConversion() external view returns (bytes21) {
return feedIdConverter.getFeedId(1, "FLR/USD");
}
}
function getFeedId(category, feedName) {
const hexFeedName = Array.from(feedName)
.map((c) => c.charCodeAt(0).toString(16).padStart(2, "0"))
.join("");
const paddedHexString = (category + hexFeedName).padEnd(42, "0");
return `0x${paddedHexString}`;
}
const feedId = getFeedId("01", "FLR/USD");
console.log(feedId);
def get_feed_id(category: str, feed_name: str) -> str:
hex_feed_name = feed_name.encode("utf-8").hex()
padded_hex_string = (category + hex_feed_name).ljust(42, "0")
return f"0x{padded_hex_string}"
feed_id = get_feed_id("01", "FLR/USD")
print(feed_id)
fn get_feed_id(category: &str, feed_name: &str) -> String {
let hex_feed_name = feed_name
.as_bytes()
.iter()
.map(|byte| format!("{:02x}", byte))
.collect::<Vec<String>>()
.join("");
let combined = format!("{}{}", category, hex_feed_name);
let padded_hex_string = format!("{:0<42}", combined);
format!("0x{}", padded_hex_string)
}
fn main() {
let feed_id = get_feed_id("01", "FLR/USD");
println!("{}", feed_id);
}
package main
import (
"encoding/hex"
"fmt"
"strings"
)
func getFeedID(category, feedName string) string {
hexFeedName := hex.EncodeToString([]byte(feedName))
paddedHexString := category + hexFeedName
if len(paddedHexString) < 42 {
paddedHexString = paddedHexString + strings.Repeat("0", 42-len(paddedHexString))
}
feedId := "0x" + paddedHexString
fmt.Println(feedId)
return feedId
}
Feed IDs are not addresses. They are bytes21
structured encodings that combine the category and feed name to ensure each feed has a unique identifier.
Feed Name | Feed Index | Feed ID | Base Asset | Decimals | Category |
---|---|---|---|---|---|
FLR/USD | 0 | 0x01464c522f55534400000000000000000000000000 | Flare | 7 | Crypto |
SGB/USD | 1 | 0x015347422f55534400000000000000000000000000 | Songbird | 8 | Crypto |
BTC/USD | 2 | 0x014254432f55534400000000000000000000000000 | Bitcoin | 2 | Crypto |
XRP/USD | 3 | 0x015852502f55534400000000000000000000000000 | XRP | 6 | Crypto |
LTC/USD | 4 | 0x014c54432f55534400000000000000000000000000 | Litecoin | 5 | Crypto |
XLM/USD | 5 | 0x01584c4d2f55534400000000000000000000000000 | Stellar | 6 | Crypto |
DOGE/USD | 6 | 0x01444f47452f555344000000000000000000000000 | Dogecoin | 6 | Crypto |
ADA/USD | 7 | 0x014144412f55534400000000000000000000000000 | Cardano | 6 | Crypto |
ALGO/USD | 8 | 0x01414c474f2f555344000000000000000000000000 | Algorand | 6 | Crypto |
ETH/USD | 9 | 0x014554482f55534400000000000000000000000000 | Ethereum | 3 | Crypto |
FIL/USD | 10 | 0x0146494c2f55534400000000000000000000000000 | Filecoin | 5 | Crypto |
ARB/USD | 11 | 0x014152422f55534400000000000000000000000000 | Arbitrum | 6 | Crypto |
AVAX/USD | 12 | 0x01415641582f555344000000000000000000000000 | Avalanche | 5 | Crypto |
BNB/USD | 13 | 0x01424e422f55534400000000000000000000000000 | BNB | 4 | Crypto |
MATIC/USD | 14 | 0x014d415449432f5553440000000000000000000000 | Polygon | 6 | Crypto |
SOL/USD | 15 | 0x01534f4c2f55534400000000000000000000000000 | Solana | 4 | Crypto |
USDC/USD | 16 | 0x01555344432f555344000000000000000000000000 | USDC | 5 | Crypto |
USDT/USD | 17 | 0x01555344542f555344000000000000000000000000 | Tether | 5 | Crypto |
XDC/USD | 18 | 0x015844432f55534400000000000000000000000000 | XDC Network | 7 | Crypto |
TRX/USD | 19 | 0x015452582f55534400000000000000000000000000 | TRON | 6 | Crypto |
LINK/USD | 20 | 0x014c494e4b2f555344000000000000000000000000 | Chainlink | 5 | Crypto |
ATOM/USD | 21 | 0x0141544f4d2f555344000000000000000000000000 | Cosmos Hub | 5 | Crypto |
DOT/USD | 22 | 0x01444f542f55534400000000000000000000000000 | Polkadot | 5 | Crypto |
TON/USD | 23 | 0x01544f4e2f55534400000000000000000000000000 | Toncoin | 5 | Crypto |
ICP/USD | 24 | 0x014943502f55534400000000000000000000000000 | Internet Computer | 5 | Crypto |
SHIB/USD | 25 | 0x01534849422f555344000000000000000000000000 | Shiba Inu | 10 | Crypto |
DAI/USD | 26 | 0x014441492f55534400000000000000000000000000 | Dai | 5 | Crypto |
BCH/USD | 27 | 0x014243482f55534400000000000000000000000000 | Bitcoin Cash | 4 | Crypto |
NEAR/USD | 28 | 0x014e4541522f555344000000000000000000000000 | NEAR Protocol | 5 | Crypto |
LEO/USD | 29 | 0x014c454f2f55534400000000000000000000000000 | LEO Token | 5 | Crypto |
UNI/USD | 30 | 0x01554e492f55534400000000000000000000000000 | Uniswap | 5 | Crypto |
ETC/USD | 31 | 0x014554432f55534400000000000000000000000000 | Ethereum Classic | 5 | Crypto |
WIF/USD | 32 | 0x015749462f55534400000000000000000000000000 | dogwifhat | 5 | Crypto |
BONK/USD | 33 | 0x01424f4e4b2f555344000000000000000000000000 | Bonk | 10 | Crypto |
JUP/USD | 34 | 0x014a55502f55534400000000000000000000000000 | Jupiter | 5 | Crypto |
ETHFI/USD | 35 | 0x0145544846492f5553440000000000000000000000 | Ether.fi | 5 | Crypto |
ENA/USD | 36 | 0x01454e412f55534400000000000000000000000000 | Ethena | 6 | Crypto |
PYTH/USD | 37 | 0x01505954482f555344000000000000000000000000 | Pyth Network | 6 | Crypto |
Need more feeds?
FTSOv2 can scale up to 1000 feeds. If you need additional FTSOv2 feeds beyond what is currently available, you can raise a New Feed Request Issue on GitHub. When a feed request is submitted, it is reviewed by the FTSO Management Group, which is comprised of the FTSO data providers as outlined in FIP.08.
Build your first FTSOv2 app using Foundry, or read feeds offchain in languages like JavaScript, Python, Rust, and Go.