Skip to content

Commit 38f9af3

Browse files
authored
Merge pull request #155 from VenusProtocol/docs/ven-2352
2 parents 76bc5c8 + b735454 commit 38f9af3

File tree

5 files changed

+107
-9
lines changed

5 files changed

+107
-9
lines changed

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
* [BinanceOracle](technical-reference/reference-oracle/oracles/binance-oracle.md)
128128
* [TwapOracle](technical-reference/reference-oracle/oracles/twap-oracle.md)
129129
* [PythOracle](technical-reference/reference-oracle/oracles/pyth-oracle.md)
130+
* [WstETHOracle](technical-reference/reference-oracle/oracles/wstethoracle.md)
130131
* [Governance](technical-reference/reference-governance/README.md)
131132
* [AccessControlManager](technical-reference/reference-governance/access-control-manager.md)
132133
* [GovernorBravoDelegate](technical-reference/reference-governance/governor-bravo-delegate.md)

deployed-contracts/oracles.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* Bound Validator:[`0x1Cd5f336A1d28Dff445619CC63d3A0329B4d8a58`](https://etherscan.io/address/0x1Cd5f336A1d28Dff445619CC63d3A0329B4d8a58)
2828
* Chainlink Oracle:[`0x94c3A2d6B7B2c051aDa041282aec5B0752F8A1F2`](https://etherscan.io/address/0x94c3A2d6B7B2c051aDa041282aec5B0752F8A1F2)
2929
* RedStone Oracle:[`0x0FC8001B2c9Ec90352A46093130e284de5889C86`](https://etherscan.io/address/0x0FC8001B2c9Ec90352A46093130e284de5889C86)
30+
* WSTETH Oracle:[`0x987F64F99cA9441D9BD141a34E195818961cCBa6`](https://etherscan.io/address/0x987F64F99cA9441D9BD141a34E195818961cCBa6)
3031
* Resilient Oracle:[`0xd2ce3fb018805ef92b8C5976cb31F84b4E295F94`](https://etherscan.io/address/0xd2ce3fb018805ef92b8C5976cb31F84b4E295F94)
3132
* DefaultProxyAdmin:[`0x567e4cc5e085d09f66f836fa8279f38b4e5866b9`](https://etherscan.io/address/0x567e4cc5e085d09f66f836fa8279f38b4e5866b9)
3233

@@ -35,6 +36,7 @@
3536
* Bound Validator:[`0x60c4Aa92eEb6884a76b309Dd8B3731ad514d6f9B`](https://sepolia.etherscan.io/address/0x60c4Aa92eEb6884a76b309Dd8B3731ad514d6f9B)
3637
* Chainlink Oracle:[`0x102F0b714E5d321187A4b6E5993358448f7261cE`](https://sepolia.etherscan.io/address/0x102F0b714E5d321187A4b6E5993358448f7261cE)
3738
* RedStone Oracle:[`0x4e6269Ef406B4CEE6e67BA5B5197c2FfD15099AE`](https://sepolia.etherscan.io/address/0x4e6269Ef406B4CEE6e67BA5B5197c2FfD15099AE)
39+
* WSTETH Oracle:[`0x92E7F73B0d57902fDC453E8aef990EdEe827b0BF`](https://sepolia.etherscan.io/address/0x92E7F73B0d57902fDC453E8aef990EdEe827b0BF)
3840
* Resilient Oracle:[`0x8000eca36201dddf5805Aa4BeFD73d1EB4D23264`](https://sepolia.etherscan.io/address/0x8000eca36201dddf5805Aa4BeFD73d1EB4D23264)
3941
* DefaultProxyAdmin:[`0x01435866babd91311b1355cf3af488cca36db68e`](https://sepolia.etherscan.io/address/0x01435866babd91311b1355cf3af488cca36db68e)
4042

risk/resilient-price-oracle.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,28 @@ In implementing the Resilient Price Oracle, several safety measures have been ad
2828

2929
<figure><img src="../.gitbook/assets/17b75928-d6a2-4207-9a0b-89d1d41690d4.png" alt=""><figcaption></figcaption></figure>
3030

31+
32+
### Pricing for Liquid Staked Tokens
33+
For LSTs (Liquid Staked Tokens) pricing, best practice suggests oracles quote the smart contract of the LST to derive its value in underlying token units and then multiply that by the USD price of the underlying. In Venus we use dedicated oracles for each LST asset in order to calculate the price as follows:
34+
* convert the LST to the underlying tokens (using the exchange rate provided by the LST contract)
35+
* convert the underlying token calculated in the previous step to USD, using a “traditional” oracle based on market price
36+
37+
{% hint style="warning" %}
38+
It is worth mentioning that with this approach we assume 1:1 price ratio between the LST and the underlying asset (e.g. 1 ETH = 1 STETH). The primary risks involved with the above approach are related to smart contract vulnerabilities and other counterparty risks that could affect the redemption processes of the LSTs. In scenarios where there is substantial counterparty risk, notably if the underlying tokens are not redeemable against the LSTs, the direct smart contract pricing might become unreliable. Under such circumstances, it is prudent to switch to price oracles that derive quotes from secondary market prices, thereby maintaining pricing accuracy and reliability.
39+
{% endhint %}
40+
3141
### Further Reading
3242

3343
For more detailed information, refer to the following resources:
3444

35-
**Audit reports**
45+
#### Audit reports
3646

37-
* [Peckshield audit report](https://github.com/VenusProtocol/oracle/blob/develop/audits/013\_oracles\_peckshield\_20230424.pdf)
38-
* [Certik audit report](https://github.com/VenusProtocol/oracle/blob/develop/audits/024\_oracles\_certik\_20230522.pdf)
39-
* [Hacken audit report](https://github.com/VenusProtocol/oracle/blob/develop/audits/016\_oracles\_hacken\_20230426.pdf)
47+
* [Resilient Price Oracle](../security-and-audits.md#oracles)
48+
* [Resilient Price Oracle upgrade](../security-and-audits.md#oracles-upgrade-2023-07-24)
49+
* [WstETH oracle](../security-and-audits.md#oracle-for-wsteth)
4050

41-
**References**
51+
#### References
4252

4353
* [Repository](https://github.com/VenusProtocol/oracle)
44-
* [Simulation pre/post upgrade](https://github.com/VenusProtocol/vips/pull/4/)
45-
* [Deployment on testnet](https://github.com/VenusProtocol/oracle/tree/develop/deployments/bsctestnet)
4654
* [Community post about Venus V4, introducing Resilient Price Feeds](https://community.venus.io/t/proposing-venus-v4/3188#price-feed-redundancy-6)
4755
* [Venus Stars blog post about Binance Oracle](https://venusstars.io/community/index.php/2023/05/09/venus-enhances-resilience-binance-oracle-feeds/)
48-
* [Community discussion about Pyth Oracle](https://community.venus.io/t/vip-xx-integrate-with-pyth-as-an-oracle/2723/6)
49-
* [RedStone’s proposal to be added to the interface](https://community.venus.io/t/adding-redstone-oracles-to-the-venus-oracle-interface/3620)

security-and-audits.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ We firmly believe that the true test of a smart contract's security lies in its
88

99
## Audits
1010

11+
### Oracle for wstETH
12+
13+
**Scope**: [Oracle for wstETH](https://github.com/VenusProtocol/oracle/blob/develop/contracts/oracles/WstETHOracle.sol), using the exchange rate `wstETH/stETH` from the `stETH` contract on Ethereum, assuming 1:1 for the conversion rate `stETH:ETH`, and converting `ETH` to `USD` using the Resilient Oracles.
14+
15+
- [Certik audit audit report (2024/01/26)](https://github.com/VenusProtocol/oracle/blob/e99feb67f4677168632f5bedd70034fba8dc55db/audits/090_wstETHOracle_certik_20240126.pdf)
16+
17+
<details>
18+
<summary>Detailed scope</summary>
19+
20+
- Pull request [#155](https://github.com/VenusProtocol/oracle/pull/155) in the `oracle` repo
21+
- contracts/oracles/WstETHOracle.sol
22+
23+
</details>
24+
1125
### Token converters
1226

1327
**Scope**: [Token converter contracts](https://github.com/VenusProtocol/protocol-reserve/pull/9). These contracts will allow the protocol to convert the income generated to the needed tokens, following the [Tokenomics](https://snapshot.org/#/venus-xvs.eth/proposal/0xc9d270ccecb7b91c75b95b8d9af24fc7c20cd38c0c0c44888ed4e7724f4e7ce9). Enabled in [VIP-245](https://app.venus.io/#/governance/proposal/245) and [VIP-248](https://app.venus.io/#/governance/proposal/248).
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# WstETHOracle
2+
This oracle returns the USD price of wstETH asset.
3+
Price is based on assumption that 1 stETH = 1 ETH.
4+
5+
# Solidity API
6+
7+
### STETH
8+
9+
Address of stETH
10+
11+
```solidity
12+
contract IStETH STETH
13+
```
14+
15+
- - -
16+
17+
### WSTETH_ADDRESS
18+
19+
Address of wstETH
20+
21+
```solidity
22+
address WSTETH_ADDRESS
23+
```
24+
25+
- - -
26+
27+
### WETH_ADDRESS
28+
29+
Address of WETH
30+
31+
```solidity
32+
address WETH_ADDRESS
33+
```
34+
35+
- - -
36+
37+
### RESILIENT_ORACLE
38+
39+
Address of Resilient Oracle
40+
41+
```solidity
42+
contract OracleInterface RESILIENT_ORACLE
43+
```
44+
45+
- - -
46+
47+
### constructor
48+
49+
Constructor for the implementation contract.
50+
51+
```solidity
52+
constructor(address wstETHAddress, address wETHAddress, address stETHAddress, address resilientOracleAddress) public
53+
```
54+
55+
- - -
56+
57+
### getPrice
58+
59+
Gets the USD price of wstETH asset
60+
61+
```solidity
62+
function getPrice(address asset) public view returns (uint256)
63+
```
64+
65+
#### Parameters
66+
| Name | Type | Description |
67+
| ---- | ---- | ----------- |
68+
| asset | address | Address of wstETH |
69+
70+
#### Return Values
71+
| Name | Type | Description |
72+
| ---- | ---- | ----------- |
73+
| [0] | uint256 | wstETH Price in USD scaled by 1e18 |
74+
75+
- - -

0 commit comments

Comments
 (0)