Skip to content

Commit 4c057db

Browse files
committed
fix: added example
1 parent 84f20ea commit 4c057db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

technical-reference/reference-technical-articles/capped-oracles.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,13 @@ The following configuration needs to be defined when configuring the capped orac
2626
* Initial Snapshot Exchange Rate and Timestamp: Defines the initial reference exchange rate and the timestamp at which the exchange rate is taken from.
2727
* Snapshot Gap: Used to define the inflation of the exchange rate at each snapshot.
2828

29-
Note that all the above variables values can be updated using the governance process after the deployment with the initial values.
29+
Note that all the above variables values can be updated using the governance process after the deployment with the initial values.
30+
31+
## Example
32+
33+
Let’s walk through an example to understand how the capped oracle functions. Suppose we want to retrieve the exchange rate between wstETH and stETH.
34+
35+
- **Annual Growth Rate:** Assume an annual growth rate of 2.9%, based on Lido’s estimated APY. Internally, this will be converted into a per-second growth rate.
36+
- **Snapshot Interval:** The snapshot can be updated once per month to refresh the reference exchange rate.
37+
- **Initial Snapshot:** We fetch the current exchange rate and timestamp from the onchain wstETH vault. For instance, the current exchange rate is `1.200101369591475639` and the timestamp is `1744895950`.
38+
- **Snapshot Gap:** A gap can be added to slightly inflate the capped exchange rate—for example, by 5% over the snapshot value. Since snapshots are updated monthly, we can calculate the expected monthly growth from the annual rate and adjust accordingly. With a 2.9% annual growth rate and an initial exchange rate of 1.2, this might translate to an additional buffer of around `0.0001`.

0 commit comments

Comments
 (0)