Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion automations/custom_feeds.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
[
{
"feed_name": "SFLR/USD",
"feed_name": "sFLR/USD",
"feed_id": "0x2173464c522f555344000000000000000000000000",
"base_asset": "Staked Flare",
"provider_name": "Sceptre",
"provider_url": "https://www.sceptre.fi",
"contract": "0xD1002F3820ad32145b868aD889eC7753E3944c8D"
},
{
"feed_name": "stXRP/USD",
"feed_id": "0x2173745852502f5553440000000000000000000000",
"base_asset": "Staked XRP",
"provider_name": "Firelight",
"provider_url": "https://firelight.finance",
"contract": "0x69A25267E870D8DF434935583227a68a2Ce04208"
}
]
14 changes: 1 addition & 13 deletions docs/ftso/2-feeds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,12 @@ import CustomFeeds from "@site/src/components/DataTables/CustomFeeds";

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:

1. **Category:** Indicates the type of asset - Crypto: `01`, Forex: `02`, Commodity: `03`, Stock: `04`, Custom Feeds: `05`

2. **Hex-Encoded Feed Name:** The name of the feed is converted to a hexadecimal format.

3. **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`.

<FeedExplanation />

:::warning

- 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.
- **Do not** hardcode the number of decimals for a feed in your smart contract, as these can change as the feed value changes. You can use either of the following solutions:
- Check the number of decimal places every query using [`getFeedById`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyid).
- Use the feed value in Wei using [`getFeedByIdInWei`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyidinwei).
- **Do not** hardcode the number of decimals for a feed, as these can change. You can either check the number of decimal places every query using [`getFeedById`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyid), or use the feed value in Wei using [`getFeedByIdInWei`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyidinwei).

:::

Expand Down
14 changes: 12 additions & 2 deletions docs/ftso/_feed_explanation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ import GetFeedIdRs from "!!raw-loader!/examples/developer-hub-rust/src/bin/get_f
import GetFeedIdGo from "!!raw-loader!/examples/developer-hub-go/get_feed_id.go";

<details>
<summary>Example of the structured encoding process.</summary>
<summary>How Feed IDs are derived.</summary>

Taking the feed name `FLR/USD`:
Each block-latency feed is uniquely identified by an ID composed of three components in a structured encoding process:

1. **Category:** Indicates the type of asset - Crypto: `01`, Forex: `02`, Commodity: `03`, Stock: `04`, Custom Feeds: `21`

2. **Hex-Encoded Feed Name:** The name of the feed is converted to a hexadecimal format.

3. **Zero Padding:** The combined category and hex-encoded feed name are padded with zeros to a length of 21 bytes.

4. **0x-prefix:** The resulting string is then prefixed with `0x`.

As an example, take the feed name `FLR/USD`:

- **Category**: `01` (Crypto)
- **Hex-Encoded Feed Name**: `464c522f555344` (hexadecimal representation of `FLR/USD`)
Expand Down
14 changes: 0 additions & 14 deletions docs/ftso/scaling/3-anchor-feeds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@ import FeedExplanation from "../_feed_explanation.mdx";

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:

1. **Category:** Indicates the type of asset:
- Crypto: `01`
- Forex: `02`
- Commodity: `03`
- Stock: `04`

2. **Hex-Encoded Feed Name:** The name of the feed is converted to a hexadecimal format.

3. **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`.

<FeedExplanation />

:::warning
Expand Down