@@ -50,14 +50,11 @@ contract MorphoChainlinkOracleV2 is IMorphoChainlinkOracleV2 {
50
50
/* CONSTRUCTOR */
51
51
52
52
/// @dev Here is the list of assumptions that guarantees the oracle behaves as expected:
53
- /// - Feeds are either Chainlink-compliant or the address zero.
54
- /// - Feeds have the same behavioral assumptions as Chainlink's.
55
- /// - Feeds are set in the correct order.
53
+ /// - The vaults, if set, are ERC4626-compliant.
54
+ /// - The feeds, if set, are Chainlink-interface-compliant.
56
55
/// - Decimals passed as argument are correct.
57
- /// - The vaults' sample shares quoted as assets and the base feed prices don't overflow when multiplied.
58
- /// - The quote feed prices don't overflow when multiplied.
59
- /// - Vaults are either ERC4626-compliant or the address zero.
60
- /// @dev The base asset is the collateral token and the quote asset is the loan token.
56
+ /// - The base vaults's sample shares quoted as assets and the base feed prices don't overflow when multiplied.
57
+ /// - The quote vault's sample shares quoted as assets and the quote feed prices don't overflow when multiplied.
61
58
/// @param baseVault Base vault. Pass address zero to omit this parameter.
62
59
/// @param baseVaultConversionSample The sample amount of base vault shares used to convert to underlying.
63
60
/// Pass 1 if the base asset is not a vault. Should be chosen such that converting `baseVaultConversionSample` to
@@ -72,6 +69,7 @@ contract MorphoChainlinkOracleV2 is IMorphoChainlinkOracleV2 {
72
69
/// @param quoteFeed1 First quote feed. Pass address zero if the price = 1.
73
70
/// @param quoteFeed2 Second quote feed. Pass address zero if the price = 1.
74
71
/// @param quoteTokenDecimals Quote token decimals.
72
+ /// @dev The base asset should be the collateral token and the quote asset the loan token.
75
73
constructor (
76
74
IERC4626 baseVault ,
77
75
uint256 baseVaultConversionSample ,
@@ -125,7 +123,7 @@ contract MorphoChainlinkOracleV2 is IMorphoChainlinkOracleV2 {
125
123
// = 1e36 * (pB1 * 1e(-dB1) * pB2) / (pQ1 * 1e(-dQ1) * pQ2)
126
124
127
125
// Let fpB1, fpB2, fpQ1, fpQ2 be the feed precision of the respective prices pB1, pB2, pQ1, pQ2.
128
- // Chainlink feeds return pB1 * 1e(fpB1), pB2 * 1e(fpB2), pQ1 * 1e(fpQ1) and pQ2 * 1e(fpQ2).
126
+ // Feeds return pB1 * 1e(fpB1), pB2 * 1e(fpB2), pQ1 * 1e(fpQ1) and pQ2 * 1e(fpQ2).
129
127
130
128
// Based on the implementation of `price()` below, the value of `SCALE_FACTOR` should thus satisfy:
131
129
// (pB1 * 1e(fpB1)) * (pB2 * 1e(fpB2)) * SCALE_FACTOR / ((pQ1 * 1e(fpQ1)) * (pQ2 * 1e(fpQ2)))
0 commit comments