Skip to content

Commit 2b7c713

Browse files
committed
docs: create feeds-registry.md; misc editing
1 parent 91461c6 commit 2b7c713

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Flux - First-Party Price Feeds for EVM
22

3-
This repository contains contracts for first-party price feeds for EVM chains, using [OpenZeppelin](https://docs.openzeppelin.com/contracts/4.x/api/access#AccessControl) for access control. Those with a validator role can post numeric data to deployed contracts at any interval. `FluxPriceFeed` contracts are compatible with Chainlink's V2 and V3 aggregator interface, and `FluxPriceFeedFactory` is EIP-2362 compatible.
3+
This repository contains contracts for first-party price feeds for EVM chains, using [OpenZeppelin](https://docs.openzeppelin.com/contracts/4.x/api/access#AccessControl) for access control. Those with a validator role can post numeric data to deployed contracts at any interval. `FluxPriceFeed` contracts are compatible with Chainlink's V2 and V3 aggregator interface, and the `FluxPriceFeedFactory` contract is EIP-2362 compatible.
44

5-
If you are a smart contract developer looking to utilize Flux price feeds, check out the [live pairs](https://docs.fluxprotocol.org/docs/live-data-feeds/live-pairs) on the documentation and copy the interface file `contracts/interface/CLV2V3Interface.sol` to use within your project so your contracts know how to query a price feed contract. If you are interested in becoming a first-party data provider, deploy a price feed factory or individual price feed using the instructions in this repository and post data to it using the [fpo-node](https://github.com/fluxprotocol/fpo-node).
5+
If you are a smart contract developer looking to utilize Flux price feeds, check out the [live pairs](https://docs.fluxprotocol.org/docs/live-data-feeds/fpo-live-networks-and-pairs) on the documentation and copy the interface file `contracts/interface/CLV2V3Interface.sol` to use within your contracts. The contracts `ExamplePriceFeedConsumer` and `RelayerOracleConsumer` demonstrate how to use a price feed within a smart contract.
6+
7+
If you are interested in becoming a first-party data provider, deploy a price feed factory or individual price feed using the instructions in this repository and post data to it using the [fpo-node](https://github.com/fluxprotocol/fpo-node).
68

79
See the `docs/` directory for more information on using the contracts.
810

@@ -25,8 +27,6 @@ Next, compile the smart contracts with Hardhat:
2527
$ yarn compile
2628
```
2729

28-
---
29-
3030
### TypeChain
3131

3232
Compile the smart contracts and generate TypeChain artifacts:

docs/feeds-registry.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Feeds registry
2+
3+
`FeedsRegistry.sol` mimicks the [Chainlink Feed Registry](https://blog.chain.link/introducing-the-chainlink-feed-registry/) interface to query the latest value from price feeds by only providing a pair of asset and denomination addresses, without needing to know each feed’s contract address.
4+
5+
### Deploy
6+
7+
Deploy a feed registry (e.g. to Aurora):
8+
9+
```bash
10+
$ yarn deployFeedsRegistry --network aurora
11+
```
12+
13+
Save the deployed contract address outputted by the command above.
14+
15+
Optionally include `--admin "0xMyAddress"` to grant a specific address the initial validator role rather than the deployer.

docs/price-feed.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Save the deployed contract address outputted by the command above.
1212

1313
Optionally include `--validator "0xMyAddress"` to grant a specific address the initial validator role rather than the deployer.
1414

15-
_Note: We deployed a price feed contract on Aurora at address `0x8BAac7F07c86895cd017C8a2c7d3C72cF9f1051F` with all role-based permissions removed. Feel free to try posting and fetching data on this contract without deploying your own!_
16-
1715
### Update answer
1816

1917
Using the mnemonic of the validator in the `.env` file, update the value on a deployed contract:
@@ -29,19 +27,3 @@ $ yarn latestAnswer --contract "0xContractAddress" --network aurora
2927

3028
4200000000
3129
```
32-
33-
## Feeds registry
34-
35-
`FeedsRegistry.sol` mimicks the [Chainlink Feed Registry](https://blog.chain.link/introducing-the-chainlink-feed-registry/) interface to query the latest value from price feeds by only providing a pair of asset and denomination addresses, without needing to know each feed’s contract address.
36-
37-
### Deploy
38-
39-
Deploy a feed registry (e.g. to Aurora):
40-
41-
```bash
42-
$ yarn deployFeedsRegistry --network aurora
43-
```
44-
45-
Save the deployed contract address outputted by the command above.
46-
47-
Optionally include `--admin "0xMyAddress"` to grant a specific address the initial validator role rather than the deployer.

docs/relayer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Relayer model
22

3-
For increased redundancy, we encourage protocols to implement a relayer price feed to verify against a main price feed. The contract `RelayerPriceFeedConsumer` demonstrates an example of how a relayer oracle might be used:
3+
For increased redundancy, protocols are encouraged to implement a relayer price feed to verify against a main price feed. The contract `RelayerPriceFeedConsumer` demonstrates an example of how a relayer oracle might be used:
44

55
```solidity
66
(, int256 price, , uint256 timestamp, ) = priceFeed.latestRoundData();
@@ -19,4 +19,4 @@ return price;
1919

2020
In this example, if the relayer oracle reports too large of a deviation from the main oracle or the maximum delay is exceeded, the transaction will be reverted.
2121

22-
The maximum delay and maximum deviation percentage depend on the price feeds being used. It is recommended to test with different values before deploying to production.
22+
The maximum delay and maximum deviation percentage depend on the price feeds being used (for example, stablecoins will require a smaller maximum deviation percentage than volatile assets). It is recommended to test with different values before deploying to production.

0 commit comments

Comments
 (0)