Anchor Feeds
Scaling's anchor feeds update every 90 seconds with each new voting epoch on Flare. These feeds, accessible offchain, support various asset classes including equities, commodities, and cryptocurrencies.
Each anchor 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
- Crypto:
-
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
}
🚦 Understanding feed risks.
When building applications, developers must carefully evaluate the quality of the data they use. As a developer, you are responsible for identifying and assessing the accuracy, availability, and overall quality of the data you choose to integrate. It is important to understand that all data feeds carry inherent risks.
The table below categorizes feeds into three risk levels based on their market integrity, ranging from lowest to highest, a feed is assigned a higher risk level if it fails to meet all the criteria required for classification within a lower risk level:
Aspect | 🟢 Low Risk | 🟡 Medium Risk | 🔴 High Risk |
---|---|---|---|
Intrinsic Volatility | Low, stable price trends | Moderate price fluctuations | High, frequent price swings |
Liquidity Variation | Abundant and consistent | Sufficient but variable | Limited and inconsistent |
Liquidity Concentration | Broad and well-distributed across venues | Somewhat concentrated | Highly concentrated in a few sources |
Asset Spread Risk | Tight spreads, minimal bid-ask gaps | Moderate spreads, acceptable bid-ask gaps | Wide spreads, significant bid-ask gaps |
Cross Rate Risk | Low correlation, direct pricing available | Moderate correlation, indirect pricing used | High correlation, dependent on multiple intermediaries |
Each feed undergoes a rigorous assessment process prior to deployment. The evaluation criteria may vary depending on the specific type of feed being implemented and can evolve over time as our understanding of market integrity risks improves.
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.
Name | Feed ID | Details | Risk |
---|---|---|---|
FLR/USD | 0x01464c522f55534400000000000000000000000000 | Base Asset: Flare Decimals: 7 Category: Crypto | 🟢 |
SGB/USD | 0x015347422f55534400000000000000000000000000 | Base Asset: Songbird Decimals: 8 Category: Crypto | 🟡 |
BTC/USD | 0x014254432f55534400000000000000000000000000 | Base Asset: Bitcoin Decimals: 2 Category: Crypto | 🟢 |
XRP/USD | 0x015852502f55534400000000000000000000000000 | Base Asset: XRP Decimals: 6 Category: Crypto | 🟡 |
LTC/USD | 0x014c54432f55534400000000000000000000000000 | Base Asset: Litecoin Decimals: 5 Category: Crypto | 🟢 |
XLM/USD | 0x01584c4d2f55534400000000000000000000000000 | Base Asset: Stellar Decimals: 6 Category: Crypto | 🟢 |
DOGE/USD | 0x01444f47452f555344000000000000000000000000 | Base Asset: Dogecoin Decimals: 6 Category: Crypto | 🟡 |
ADA/USD | 0x014144412f55534400000000000000000000000000 | Base Asset: Cardano Decimals: 6 Category: Crypto | 🟡 |
ALGO/USD | 0x01414c474f2f555344000000000000000000000000 | Base Asset: Algorand Decimals: 6 Category: Crypto | 🟡 |
ETH/USD | 0x014554482f55534400000000000000000000000000 | Base Asset: Ethereum Decimals: 3 Category: Crypto | 🟢 |
FIL/USD | 0x0146494c2f55534400000000000000000000000000 | Base Asset: Filecoin Decimals: 5 Category: Crypto | 🟢 |
ARB/USD | 0x014152422f55534400000000000000000000000000 | Base Asset: Arbitrum Decimals: 6 Category: Crypto | 🟢 |
AVAX/USD | 0x01415641582f555344000000000000000000000000 | Base Asset: Avalanche Decimals: 5 Category: Crypto | 🟢 |
BNB/USD | 0x01424e422f55534400000000000000000000000000 | Base Asset: BNB Decimals: 4 Category: Crypto | 🟢 |
POL/USD | 0x01504f4c2f55534400000000000000000000000000 | Base Asset: POL (ex-MATIC) Decimals: 6 Category: Crypto | 🟢 |
SOL/USD | 0x01534f4c2f55534400000000000000000000000000 | Base Asset: Solana Decimals: 4 Category: Crypto | 🟢 |
USDC/USD | 0x01555344432f555344000000000000000000000000 | Base Asset: USDC Decimals: 5 Category: Crypto | 🟢 |
USDT/USD | 0x01555344542f555344000000000000000000000000 | Base Asset: Tether Decimals: 5 Category: Crypto | 🟢 |
XDC/USD | 0x015844432f55534400000000000000000000000000 | Base Asset: XDC Network Decimals: 7 Category: Crypto | 🟡 |
TRX/USD | 0x015452582f55534400000000000000000000000000 | Base Asset: TRON Decimals: 6 Category: Crypto | 🔴 |
LINK/USD | 0x014c494e4b2f555344000000000000000000000000 | Base Asset: Chainlink Decimals: 5 Category: Crypto | 🟢 |
ATOM/USD | 0x0141544f4d2f555344000000000000000000000000 | Base Asset: Cosmos Hub Decimals: 5 Category: Crypto | 🟢 |
DOT/USD | 0x01444f542f55534400000000000000000000000000 | Base Asset: Polkadot Decimals: 5 Category: Crypto | 🟢 |
TON/USD | 0x01544f4e2f55534400000000000000000000000000 | Base Asset: Toncoin Decimals: 5 Category: Crypto | 🟢 |
ICP/USD | 0x014943502f55534400000000000000000000000000 | Base Asset: Internet Computer Decimals: 5 Category: Crypto | 🟢 |
SHIB/USD | 0x01534849422f555344000000000000000000000000 | Base Asset: Shiba Inu Decimals: 10 Category: Crypto | 🔴 |
DAI/USD | 0x014441492f55534400000000000000000000000000 | Base Asset: Dai Decimals: 5 Category: Crypto | 🟢 |
BCH/USD | 0x014243482f55534400000000000000000000000000 | Base Asset: Bitcoin Cash Decimals: 4 Category: Crypto | 🟢 |
NEAR/USD | 0x014e4541522f555344000000000000000000000000 | Base Asset: NEAR Protocol Decimals: 5 Category: Crypto | 🟢 |
LEO/USD | 0x014c454f2f55534400000000000000000000000000 | Base Asset: LEO Token Decimals: 5 Category: Crypto | 🔴 |
UNI/USD | 0x01554e492f55534400000000000000000000000000 | Base Asset: Uniswap Decimals: 5 Category: Crypto | 🟢 |
ETC/USD | 0x014554432f55534400000000000000000000000000 | Base Asset: Ethereum Classic Decimals: 5 Category: Crypto | 🟡 |
WIF/USD | 0x015749462f55534400000000000000000000000000 | Base Asset: dogwifhat Decimals: 5 Category: Crypto | 🔴 |
BONK/USD | 0x01424f4e4b2f555344000000000000000000000000 | Base Asset: Bonk Decimals: 10 Category: Crypto | 🔴 |
JUP/USD | 0x014a55502f55534400000000000000000000000000 | Base Asset: Jupiter Decimals: 5 Category: Crypto | 🟢 |
ETHFI/USD | 0x0145544846492f5553440000000000000000000000 | Base Asset: Ether.fi Decimals: 5 Category: Crypto | 🟡 |
ENA/USD | 0x01454e412f55534400000000000000000000000000 | Base Asset: Ethena Decimals: 6 Category: Crypto | 🔴 |
PYTH/USD | 0x01505954482f555344000000000000000000000000 | Base Asset: Pyth Network Decimals: 6 Category: Crypto | 🟢 |
HNT/USD | 0x01484e542f55534400000000000000000000000000 | Base Asset: Helium Decimals: 5 Category: Crypto | 🟡 |
SUI/USD | 0x015355492f55534400000000000000000000000000 | Base Asset: Sui Decimals: 5 Category: Crypto | 🟢 |
PEPE/USD | 0x01504550452f555344000000000000000000000000 | Base Asset: Pepe Decimals: 10 Category: Crypto | 🔴 |
QNT/USD | 0x01514e542f55534400000000000000000000000000 | Base Asset: Quant Decimals: 5 Category: Crypto | 🟡 |
AAVE/USD | 0x01414156452f555344000000000000000000000000 | Base Asset: Aave Decimals: 4 Category: Crypto | 🟢 |
FTM/USD | 0x0146544d2f55534400000000000000000000000000 | Base Asset: Fantom Decimals: 6 Category: Crypto | 🟡 |
ONDO/USD | 0x014f4e444f2f555344000000000000000000000000 | Base Asset: Ondo Decimals: 6 Category: Crypto | 🟡 |
TAO/USD | 0x0154414f2f55534400000000000000000000000000 | Base Asset: Bittensor Decimals: 4 Category: Crypto | 🟡 |
FET/USD | 0x014645542f55534400000000000000000000000000 | Base Asset: Artificial Superintelligence Alliance Decimals: 5 Category: Crypto | 🟢 |
RENDER/USD | 0x0152454e4445522f55534400000000000000000000 | Base Asset: Render Decimals: 5 Category: Crypto | 🟢 |
NOT/USD | 0x014e4f542f55534400000000000000000000000000 | Base Asset: Notcoin Decimals: 8 Category: Crypto | 🟡 |
RUNE/USD | 0x0152554e452f555344000000000000000000000000 | Base Asset: THORChain Decimals: 5 Category: Crypto | 🟡 |