You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -183,13 +184,13 @@ Imagine your dApp requires a USD/ETH price feed with 8 decimal places, but the a
183
184
1. **Deploy `InverseApi3ReaderProxyV1`**:
184
185
- Input `PROXY`: Address of the ETH/USD `IApi3ReaderProxy` dAPI.
185
186
- Output: An `IApi3ReaderProxy` contract. This deployed instance of `InverseApi3ReaderProxyV1` reads USD/ETH.
186
-
- Example command: `NETWORK=your_network PROXY=0xAddressOfEthUsdDapi pnpm deploy:InverseApi3ReaderProxyV1`
187
+
- Example command: `NETWORK=base PROXY=0xAddressOfEthUsdDapi pnpm deploy:InverseApi3ReaderProxyV1`
187
188
188
189
2. **Deploy `ScaledApi3FeedProxyV1`**:
189
190
- Input `PROXY`: Address of the `InverseApi3ReaderProxyV1` instance deployed in step 1.
190
191
- Input `DECIMALS`: `8`.
191
192
- Output: An `AggregatorV2V3Interface` contract. This deployed instance of `ScaledApi3FeedProxyV1` reads USD/ETH scaled to 8 decimals.
192
-
- Example command: `NETWORK=your_network PROXY=0xAddressOfDeployedInverseApi3ReaderProxyV1FromStep1 DECIMALS=8 pnpm deploy:ScaledApi3FeedProxyV1`
193
+
- Example command: `NETWORK=base PROXY=0xAddressOfDeployedInverseApi3ReaderProxyV1FromStep1 DECIMALS=8 pnpm deploy:ScaledApi3FeedProxyV1`
193
194
_Note: Replace `0xAddressOfDeployedInverseApi3ReaderProxyV1FromStep1` with the actual address obtained from the deployment artifact of step 1._
194
195
195
196
This pipeline successfully provides the dApp with the required USD/ETH feed at the desired precision and interface.
@@ -229,16 +230,17 @@ To derive the desired uStETH/USD feed and make it compatible with the Api3 ecosy
229
230
1. **Deploy `NormalizedApi3ReaderProxyV1`**:
230
231
- This step adapts the external uStETH/ETH feed, which implements the `AggregatorV2V3Interface`, to the `IApi3ReaderProxy` interface. A key functionof`NormalizedApi3ReaderProxyV1` is to read the `decimals()` from the external feed and automatically scale its value to the 18 decimal places expected by the `IApi3ReaderProxy` interface. For instance, if the uStETH/ETH feed returns its value with a different precision (e.g., 8 or 36 decimals), this proxy will normalize it.
231
232
- Input `FEED`: Address of the external uStETH/ETH `AggregatorV2V3Interface` feed.
233
+
- Input `DAPP_ID`: The dApp ID to associate with this proxy.
232
234
- Output: An `IApi3ReaderProxy` contract. This deployed instance of `NormalizedApi3ReaderProxyV1` reads uStETH/ETH, with its value normalized to 18 decimals.
233
-
- Example command: `NETWORK=your_network FEED=0xAddressOfExternal_uStETH_ETH_Feed pnpm deploy:NormalizedApi3ReaderProxyV1`
235
+
- Example command: `NETWORK=base FEED=0xAddressOfExternal_uStETH_ETH_Feed DAPP_ID=YourDappId pnpm deploy:NormalizedApi3ReaderProxyV1`
234
236
235
237
2. **Deploy `ProductApi3ReaderProxyV1` to calculate uStETH/USD**:
236
238
- This step multiplies the normalized uStETH/ETH rate by the ETH/USD rate from the Api3 dAPI.
237
239
- Input `PROXY1`: Address of the `NormalizedApi3ReaderProxyV1` instance deployed in step 1.
238
240
- Input `PROXY2`: Address of the existing ETH/USD `IApi3ReaderProxy` dAPI.
239
241
- Output: An `IApi3ReaderProxy` contract. This deployed instance of `ProductApi3ReaderProxyV1` reads uStETH/USD.
- Example command: `NETWORK=your_network PROXY1=0xAddressOfDeployedNormalizedApi3ReaderProxyV1FromStep1 PROXY2=0xAddressOfApi3EthUsdDapi pnpm deploy:ProductApi3ReaderProxyV1`
243
+
- Example command: `NETWORK=base PROXY1=0xAddressOfDeployedNormalizedApi3ReaderProxyV1FromStep1 PROXY2=0xAddressOfApi3EthUsdDapi pnpm deploy:ProductApi3ReaderProxyV1`
242
244
_(Note: Replace `0xAddressOfDeployedNormalizedApi3ReaderProxyV1FromStep1` with the actual address obtained from the deployment artifact of step 1)._
243
245
244
246
This scenario highlights how `NormalizedApi3ReaderProxyV1` serves as a crucial bridge, enabling dApps to integrate valuable data from external sources (that may not meet Api3 dAPI listing criteria or are simply outside the current offerings) and combine it with trusted Api3 dAPIs using the standard set of combinator tools.
0 commit comments