Skip to content

Commit b2290e5

Browse files
authored
feat(ftso): add stxrp custom feeds (#1067)
2 parents ae61f30 + aaabf30 commit b2290e5

File tree

4 files changed

+22
-30
lines changed

4 files changed

+22
-30
lines changed

automations/custom_feeds.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
[
22
{
3-
"feed_name": "SFLR/USD",
3+
"feed_name": "sFLR/USD",
44
"feed_id": "0x2173464c522f555344000000000000000000000000",
55
"base_asset": "Staked Flare",
66
"provider_name": "Sceptre",
77
"provider_url": "https://www.sceptre.fi",
88
"contract": "0xD1002F3820ad32145b868aD889eC7753E3944c8D"
9+
},
10+
{
11+
"feed_name": "stXRP/USD",
12+
"feed_id": "0x2173745852502f5553440000000000000000000000",
13+
"base_asset": "Staked XRP",
14+
"provider_name": "Firelight",
15+
"provider_url": "https://firelight.finance",
16+
"contract": "0x69A25267E870D8DF434935583227a68a2Ce04208"
917
}
1018
]

docs/ftso/2-feeds.mdx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,12 @@ import CustomFeeds from "@site/src/components/DataTables/CustomFeeds";
1616

1717
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.
1818

19-
Each block-latency feed is uniquely identified by an ID composed of three components in a structured encoding process:
20-
21-
1. **Category:** Indicates the type of asset - Crypto: `01`, Forex: `02`, Commodity: `03`, Stock: `04`, Custom Feeds: `05`
22-
23-
2. **Hex-Encoded Feed Name:** The name of the feed is converted to a hexadecimal format.
24-
25-
3. **Zero Padding:** The combined category and hex-encoded feed name are padded with zeros to a length of 21 bytes.
26-
27-
The resulting string is then prefixed with `0x`.
28-
2919
<FeedExplanation />
3020

3121
:::warning
3222

3323
- 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.
34-
- **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:
35-
- Check the number of decimal places every query using [`getFeedById`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyid).
36-
- Use the feed value in Wei using [`getFeedByIdInWei`](/ftso/solidity-reference/FtsoV2Interface#getfeedbyidinwei).
24+
- **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).
3725

3826
:::
3927

docs/ftso/_feed_explanation.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,19 @@ import GetFeedIdRs from "!!raw-loader!/examples/developer-hub-rust/src/bin/get_f
88
import GetFeedIdGo from "!!raw-loader!/examples/developer-hub-go/get_feed_id.go";
99

1010
<details>
11-
<summary>Example of the structured encoding process.</summary>
11+
<summary>How Feed IDs are derived.</summary>
1212

13-
Taking the feed name `FLR/USD`:
13+
Each block-latency feed is uniquely identified by an ID composed of three components in a structured encoding process:
14+
15+
1. **Category:** Indicates the type of asset - Crypto: `01`, Forex: `02`, Commodity: `03`, Stock: `04`, Custom Feeds: `21`
16+
17+
2. **Hex-Encoded Feed Name:** The name of the feed is converted to a hexadecimal format.
18+
19+
3. **Zero Padding:** The combined category and hex-encoded feed name are padded with zeros to a length of 21 bytes.
20+
21+
4. **0x-prefix:** The resulting string is then prefixed with `0x`.
22+
23+
As an example, take the feed name `FLR/USD`:
1424

1525
- **Category**: `01` (Crypto)
1626
- **Hex-Encoded Feed Name**: `464c522f555344` (hexadecimal representation of `FLR/USD`)

docs/ftso/scaling/3-anchor-feeds.mdx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,6 @@ import FeedExplanation from "../_feed_explanation.mdx";
1111

1212
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.
1313

14-
Each anchor feed is uniquely identified by an ID composed of three components in a structured encoding process:
15-
16-
1. **Category:** Indicates the type of asset:
17-
- Crypto: `01`
18-
- Forex: `02`
19-
- Commodity: `03`
20-
- Stock: `04`
21-
22-
2. **Hex-Encoded Feed Name:** The name of the feed is converted to a hexadecimal format.
23-
24-
3. **Zero Padding:** The combined category and hex-encoded feed name are padded with zeros to a length of 21 bytes.
25-
26-
The resulting string is then prefixed with `0x`.
27-
2814
<FeedExplanation />
2915

3016
:::warning

0 commit comments

Comments
 (0)