@pendle/core-v2 4.6.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPPtLpOracle.sol/IPPtLpOracle.json → IPPYLpOracle.sol/IPPYLpOracle.json} +50 -2
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/PendlePYLpOracle.sol/PendlePYLpOracle.json +422 -0
- package/build/artifacts/contracts/oracles/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendlePtOracleLib.sol/PendlePtOracleLib.json → PendlePYOracleLib.sol/PendlePYOracleLib.json} +4 -4
- package/build/artifacts/contracts/oracles/samples/BoringLpGlpOracle.sol/BoringLpGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/BoringLpGlpOracle.sol/BoringLpGlpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.json +183 -0
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.json +183 -0
- package/contracts/interfaces/{IPPtLpOracle.sol → IPPYLpOracle.sol} +5 -1
- package/contracts/oracles/PendleLpOracleLib.sol +4 -4
- package/contracts/oracles/{PendlePtLpOracle.sol → PendlePYLpOracle.sol} +51 -21
- package/contracts/oracles/{PendlePtOracleLib.sol → PendlePYOracleLib.sol} +31 -1
- package/contracts/oracles/samples/BoringLpGlpOracle.sol +2 -2
- package/contracts/oracles/samples/{BoringPtUsdChainlinkOracle.sol → BoringPYUsdChainlinkAssetOracle.sol} +36 -12
- package/contracts/oracles/samples/BoringPYUsdChainlinkSYOracle.sol +102 -0
- package/deployments/1-core.json +1 -1
- package/deployments/10-core.json +1 -1
- package/deployments/42161-core.json +1 -1
- package/deployments/42161-markets/CAMELOT-PEP-ARBITRUM-JUNE2025.json +14 -0
- package/deployments/5000-core.json +1 -1
- package/deployments/56-core.json +1 -1
- package/package.json +1 -1
- package/typechain-types/PendlePYLpOracle.ts +10 -3
- package/typechain-types/factories/BoringLpGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePYLpOracle__factory.ts +12 -24
- package/typechain-types/hardhat.d.ts +36 -0
- package/typechain-types/index.ts +8 -0
- package/build/artifacts/contracts/interfaces/IPPtLpOracle.sol/IPPtLpOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendlePtLpOracle.sol/PendlePtLpOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendlePtLpOracle.sol/PendlePtLpOracle.json +0 -367
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringPtUsdChainlinkOracle.sol/BoringPtUsdChainlinkOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringPtUsdChainlinkOracle.sol/BoringPtUsdChainlinkOracle.json +0 -157
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import "./
|
|
4
|
+
import "./PendlePYOracleLib.sol";
|
|
5
5
|
|
|
6
6
|
library PendleLpOracleLib {
|
|
7
|
-
using
|
|
7
|
+
using PendlePYOracleLib for IPMarket;
|
|
8
8
|
using PMath for uint256;
|
|
9
9
|
using PMath for int256;
|
|
10
10
|
using MarketMathCore for MarketState;
|
|
@@ -16,7 +16,7 @@ library PendleLpOracleLib {
|
|
|
16
16
|
* @param duration twap duration
|
|
17
17
|
*/
|
|
18
18
|
function getLpToAssetRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
19
|
-
(uint256 syIndex, uint256 pyIndex) =
|
|
19
|
+
(uint256 syIndex, uint256 pyIndex) = PendlePYOracleLib.getSYandPYIndexCurrent(market);
|
|
20
20
|
uint256 lpToAssetRateRaw = _getLpToAssetRateRaw(market, duration, pyIndex);
|
|
21
21
|
if (syIndex >= pyIndex) {
|
|
22
22
|
return lpToAssetRateRaw;
|
|
@@ -32,7 +32,7 @@ library PendleLpOracleLib {
|
|
|
32
32
|
* @param duration twap duration
|
|
33
33
|
*/
|
|
34
34
|
function getLpToSyRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
35
|
-
(uint256 syIndex, uint256 pyIndex) =
|
|
35
|
+
(uint256 syIndex, uint256 pyIndex) = PendlePYOracleLib.getSYandPYIndexCurrent(market);
|
|
36
36
|
uint256 lpToAssetRateRaw = _getLpToAssetRateRaw(market, duration, pyIndex);
|
|
37
37
|
if (syIndex >= pyIndex) {
|
|
38
38
|
return lpToAssetRateRaw.divDown(syIndex);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "./
|
|
4
|
+
import "./PendlePYOracleLib.sol";
|
|
5
5
|
import "./PendleLpOracleLib.sol";
|
|
6
|
-
import "../interfaces/
|
|
6
|
+
import "../interfaces/IPPYLpOracle.sol";
|
|
7
7
|
import "../core/libraries/BoringOwnableUpgradeable.sol";
|
|
8
8
|
|
|
9
9
|
// This is a pre-deployed version of PendlePtOracleLib & PendleLpOracleLib with additional utility functions.
|
|
10
10
|
// Use of this contract rather than direct library integration resulting in a smaller bytecode size and simpler structure
|
|
11
11
|
// but slightly higher gas usage (~ 4000 gas, 2 external calls & 1 cold code load)
|
|
12
|
-
contract
|
|
13
|
-
using
|
|
12
|
+
contract PendlePYLpOracle is BoringOwnableUpgradeable, IPPYLpOracle {
|
|
13
|
+
using PendlePYOracleLib for IPMarket;
|
|
14
14
|
using PendleLpOracleLib for IPMarket;
|
|
15
15
|
|
|
16
16
|
error InvalidBlockRate(uint256 blockCycleNumerator);
|
|
@@ -26,38 +26,54 @@ contract PendlePtLpOracle is BoringOwnableUpgradeable, IPPtLpOracle {
|
|
|
26
26
|
uint16 public blockCycleNumerator;
|
|
27
27
|
uint16 public constant BLOCK_CYCLE_DENOMINATOR = 1000;
|
|
28
28
|
|
|
29
|
-
constructor(
|
|
29
|
+
constructor() {
|
|
30
|
+
_disableInitializers();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function initialize(uint16 _blockCycleNumerator) external initializer {
|
|
30
34
|
__BoringOwnable_init();
|
|
31
|
-
|
|
35
|
+
_setBlockCycleNumerator(_blockCycleNumerator);
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
if (newBlockCycleNumerator < BLOCK_CYCLE_DENOMINATOR) {
|
|
36
|
-
revert InvalidBlockRate(newBlockCycleNumerator);
|
|
37
|
-
}
|
|
38
|
+
// Refer to https://docs.pendle.finance/Home on how to use the oracle
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
/*///////////////////////////////////////////////////////////////
|
|
41
|
+
PT, YT, LP to SY
|
|
42
|
+
//////////////////////////////////////////////////////////////*/
|
|
43
|
+
|
|
44
|
+
function getPtToSyRate(address market, uint32 duration) external view returns (uint256) {
|
|
45
|
+
return IPMarket(market).getPtToSyRate(duration);
|
|
41
46
|
}
|
|
42
47
|
|
|
43
|
-
function
|
|
44
|
-
return IPMarket(market).
|
|
48
|
+
function getYtToSyRate(address market, uint32 duration) external view returns (uint256) {
|
|
49
|
+
return IPMarket(market).getYtToSyRate(duration);
|
|
45
50
|
}
|
|
46
51
|
|
|
52
|
+
function getLpToSyRate(address market, uint32 duration) external view returns (uint256) {
|
|
53
|
+
return IPMarket(market).getLpToSyRate(duration);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*///////////////////////////////////////////////////////////////
|
|
57
|
+
PT, YT, LP to Asset
|
|
58
|
+
//////////////////////////////////////////////////////////////*/
|
|
59
|
+
|
|
47
60
|
/// @notice make sure you have taken into account the risk of not being able to withdraw from SY to Asset
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return IPMarket(market).getLpToAssetRate(duration);
|
|
61
|
+
function getPtToAssetRate(address market, uint32 duration) external view returns (uint256) {
|
|
62
|
+
return IPMarket(market).getPtToAssetRate(duration);
|
|
51
63
|
}
|
|
52
64
|
|
|
53
|
-
function
|
|
54
|
-
return IPMarket(market).
|
|
65
|
+
function getYtToAssetRate(address market, uint32 duration) external view returns (uint256) {
|
|
66
|
+
return IPMarket(market).getYtToAssetRate(duration);
|
|
55
67
|
}
|
|
56
68
|
|
|
57
|
-
function
|
|
58
|
-
return IPMarket(market).
|
|
69
|
+
function getLpToAssetRate(address market, uint32 duration) external view returns (uint256) {
|
|
70
|
+
return IPMarket(market).getLpToAssetRate(duration);
|
|
59
71
|
}
|
|
60
72
|
|
|
73
|
+
/*///////////////////////////////////////////////////////////////
|
|
74
|
+
Utility functions
|
|
75
|
+
//////////////////////////////////////////////////////////////*/
|
|
76
|
+
|
|
61
77
|
/**
|
|
62
78
|
* A check function for the cardinality status of the market
|
|
63
79
|
* @param market PendleMarket address
|
|
@@ -99,4 +115,18 @@ contract PendlePtLpOracle is BoringOwnableUpgradeable, IPPtLpOracle {
|
|
|
99
115
|
}
|
|
100
116
|
return uint16(cardinalityRequired);
|
|
101
117
|
}
|
|
118
|
+
|
|
119
|
+
// --- Owner-Only Functions ---
|
|
120
|
+
function setBlockCycleNumerator(uint16 newBlockCycleNumerator) external onlyOwner {
|
|
121
|
+
_setBlockCycleNumerator(newBlockCycleNumerator);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function _setBlockCycleNumerator(uint16 newBlockCycleNumerator) internal {
|
|
125
|
+
if (newBlockCycleNumerator < BLOCK_CYCLE_DENOMINATOR) {
|
|
126
|
+
revert InvalidBlockRate(newBlockCycleNumerator);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
blockCycleNumerator = newBlockCycleNumerator;
|
|
130
|
+
emit SetBlockCycleNumerator(newBlockCycleNumerator);
|
|
131
|
+
}
|
|
102
132
|
}
|
|
@@ -6,7 +6,7 @@ import "../core/libraries/math/PMath.sol";
|
|
|
6
6
|
|
|
7
7
|
// This library can & should be integrated directly for optimal gas usage.
|
|
8
8
|
// If you prefer not to integrate it directly, the PendlePtOracle contract (a pre-deployed version of this contract) can be used.
|
|
9
|
-
library
|
|
9
|
+
library PendlePYOracleLib {
|
|
10
10
|
using PMath for uint256;
|
|
11
11
|
using PMath for int256;
|
|
12
12
|
|
|
@@ -25,6 +25,21 @@ library PendlePtOracleLib {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* This function returns the twap rate YT/Asset on market, but take into account the current rate of SY
|
|
30
|
+
This is to account for special cases where underlying asset becomes insolvent and has decreasing exchangeRate
|
|
31
|
+
* @param market market to get rate from
|
|
32
|
+
* @param duration twap duration
|
|
33
|
+
*/
|
|
34
|
+
function getYtToAssetRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
35
|
+
(uint256 syIndex, uint256 pyIndex) = getSYandPYIndexCurrent(market);
|
|
36
|
+
if (syIndex >= pyIndex) {
|
|
37
|
+
return getYtToAssetRateRaw(market, duration);
|
|
38
|
+
} else {
|
|
39
|
+
return (getYtToAssetRateRaw(market, duration) * syIndex) / pyIndex;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
28
43
|
/// @notice Similar to getPtToAsset but returns the rate in SY instead
|
|
29
44
|
function getPtToSyRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
30
45
|
(uint256 syIndex, uint256 pyIndex) = getSYandPYIndexCurrent(market);
|
|
@@ -35,6 +50,16 @@ library PendlePtOracleLib {
|
|
|
35
50
|
}
|
|
36
51
|
}
|
|
37
52
|
|
|
53
|
+
/// @notice Similar to getPtToAsset but returns the rate in SY instead
|
|
54
|
+
function getYtToSyRate(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
55
|
+
(uint256 syIndex, uint256 pyIndex) = getSYandPYIndexCurrent(market);
|
|
56
|
+
if (syIndex >= pyIndex) {
|
|
57
|
+
return getYtToAssetRateRaw(market, duration).divDown(syIndex);
|
|
58
|
+
} else {
|
|
59
|
+
return getYtToAssetRateRaw(market, duration).divDown(pyIndex);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
38
63
|
/// @notice returns the raw rate without taking into account whether SY is solvent
|
|
39
64
|
function getPtToAssetRateRaw(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
40
65
|
uint256 expiry = market.expiry();
|
|
@@ -49,6 +74,11 @@ library PendlePtOracleLib {
|
|
|
49
74
|
}
|
|
50
75
|
}
|
|
51
76
|
|
|
77
|
+
/// @notice returns the raw rate without taking into account whether SY is solvent
|
|
78
|
+
function getYtToAssetRateRaw(IPMarket market, uint32 duration) internal view returns (uint256) {
|
|
79
|
+
return PMath.ONE - getPtToAssetRateRaw(market, duration);
|
|
80
|
+
}
|
|
81
|
+
|
|
52
82
|
function getSYandPYIndexCurrent(IPMarket market) internal view returns (uint256 syIndex, uint256 pyIndex) {
|
|
53
83
|
(IStandardizedYield SY, , IPYieldToken YT) = market.readTokens();
|
|
54
84
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../PendleLpOracleLib.sol";
|
|
5
|
-
import "../../interfaces/
|
|
5
|
+
import "../../interfaces/IPPYLpOracle.sol";
|
|
6
6
|
import "../../interfaces/GMX/IGlpManager.sol";
|
|
7
7
|
import "../../core/libraries/math/PMath.sol";
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ contract BoringLpGlpOracle {
|
|
|
23
23
|
market = _market;
|
|
24
24
|
glpManager = _glpManager;
|
|
25
25
|
|
|
26
|
-
(bool increaseCardinalityRequired, , bool oldestObservationSatisfied) =
|
|
26
|
+
(bool increaseCardinalityRequired, , bool oldestObservationSatisfied) = IPPYLpOracle(_ptOracle).getOracleState(
|
|
27
27
|
market,
|
|
28
28
|
twapDuration
|
|
29
29
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "../../interfaces/
|
|
4
|
+
import "../../interfaces/IPPYLpOracle.sol";
|
|
5
5
|
import "../../interfaces/IPMarket.sol";
|
|
6
6
|
import "../../core/libraries/math/PMath.sol";
|
|
7
7
|
import "../PendleLpOracleLib.sol";
|
|
@@ -9,29 +9,41 @@ import "../PendleLpOracleLib.sol";
|
|
|
9
9
|
import {AggregatorV2V3Interface as IChainlinkAggregator} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* @notice The returned price from this contract is multiplied by the default USD price of the
|
|
13
|
-
*
|
|
12
|
+
* @notice The returned price from this contract is multiplied by the default USD price of the
|
|
13
|
+
* underlying asset, as read from a Chainlink-interface oracle.
|
|
14
|
+
*
|
|
15
|
+
* Example of this usage:
|
|
16
|
+
* - PT-wstETH = ptToAssetRate * stETH price
|
|
17
|
+
* - PT-silo-crvUSD = ptToAssetRate * crvUSD price
|
|
18
|
+
*
|
|
19
|
+
* For more details into how the oracle is implemented, refer to PendlePYLpOracle & PendlePYOracleLib.
|
|
14
20
|
*/
|
|
15
|
-
contract
|
|
16
|
-
using
|
|
21
|
+
contract BoringPYUsdChainlinkAssetOracle {
|
|
22
|
+
using PendlePYOracleLib for IPMarket;
|
|
17
23
|
|
|
18
24
|
uint32 public immutable twapDuration;
|
|
19
25
|
address public immutable market;
|
|
20
26
|
address public immutable feed;
|
|
21
27
|
uint8 public immutable feedDecimals;
|
|
22
|
-
address public immutable
|
|
28
|
+
address public immutable pyLpOracle;
|
|
23
29
|
|
|
24
|
-
constructor(uint32 _twapDuration, address _market, address _feed, address
|
|
30
|
+
constructor(uint32 _twapDuration, address _market, address _feed, address _pyLpOracle) {
|
|
25
31
|
twapDuration = _twapDuration;
|
|
26
32
|
market = _market;
|
|
27
33
|
feed = _feed;
|
|
28
34
|
feedDecimals = IChainlinkAggregator(feed).decimals();
|
|
29
35
|
|
|
30
36
|
// required only for sample2
|
|
31
|
-
|
|
37
|
+
pyLpOracle = _pyLpOracle;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @notice All pricing functions in this contract should only be used after checkOracleState() is ran successfully without reverting.
|
|
41
|
+
* This equals to calling checkOracleState() in your oracle constructor.
|
|
42
|
+
*/
|
|
43
|
+
// checkOracleState();
|
|
32
44
|
}
|
|
33
45
|
|
|
34
|
-
/// @notice direct integration with
|
|
46
|
+
/// @notice direct integration with PendlePYOracleLib, which optimizes gas efficiency.
|
|
35
47
|
/// @notice please checkOracleState() before use
|
|
36
48
|
function getPtPriceSample1() external view virtual returns (uint256) {
|
|
37
49
|
uint256 ptRate = IPMarket(market).getPtToAssetRate(twapDuration);
|
|
@@ -43,11 +55,23 @@ contract BoringPtUsdChainlinkOracle {
|
|
|
43
55
|
/// but slightly higher gas usage (~ 4000 gas, 2 external calls & 1 cold code load)
|
|
44
56
|
/// @notice please checkOracleState() before use
|
|
45
57
|
function getPtPriceSample2() external view virtual returns (uint256) {
|
|
46
|
-
uint256 ptRate =
|
|
58
|
+
uint256 ptRate = IPPYLpOracle(pyLpOracle).getPtToAssetRate(market, twapDuration);
|
|
47
59
|
uint256 assetPrice = _getUnderlyingAssetPrice();
|
|
48
60
|
return (assetPrice * ptRate) / PMath.ONE;
|
|
49
61
|
}
|
|
50
62
|
|
|
63
|
+
function getYtPriceSample1() external view virtual returns (uint256) {
|
|
64
|
+
uint256 ytRate = IPMarket(market).getYtToAssetRate(twapDuration);
|
|
65
|
+
uint256 assetPrice = _getUnderlyingAssetPrice();
|
|
66
|
+
return (assetPrice * ytRate) / PMath.ONE;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getYtPriceSample2() external view virtual returns (uint256) {
|
|
70
|
+
uint256 ytRate = IPPYLpOracle(pyLpOracle).getYtToAssetRate(market, twapDuration);
|
|
71
|
+
uint256 assetPrice = _getUnderlyingAssetPrice();
|
|
72
|
+
return (assetPrice * ytRate) / PMath.ONE;
|
|
73
|
+
}
|
|
74
|
+
|
|
51
75
|
function _getUnderlyingAssetPrice() internal view virtual returns (uint256) {
|
|
52
76
|
uint256 rawPrice = uint256(IChainlinkAggregator(feed).latestAnswer());
|
|
53
77
|
return feedDecimals < 18 ? rawPrice * 10 ** (18 - feedDecimals) : rawPrice / 10 ** (feedDecimals - 18);
|
|
@@ -60,8 +84,8 @@ contract BoringPtUsdChainlinkOracle {
|
|
|
60
84
|
|
|
61
85
|
/// @notice Call only once for each (market, duration). Once successful, it's permanently valid (also for any shorter duration).
|
|
62
86
|
function checkOracleState() external view {
|
|
63
|
-
(bool increaseCardinalityRequired, uint16 cardinalityRequired, bool oldestObservationSatisfied) =
|
|
64
|
-
|
|
87
|
+
(bool increaseCardinalityRequired, uint16 cardinalityRequired, bool oldestObservationSatisfied) = IPPYLpOracle(
|
|
88
|
+
pyLpOracle
|
|
65
89
|
).getOracleState(market, twapDuration);
|
|
66
90
|
|
|
67
91
|
if (increaseCardinalityRequired) {
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../interfaces/IPPYLpOracle.sol";
|
|
5
|
+
import "../../interfaces/IPMarket.sol";
|
|
6
|
+
import "../../core/libraries/math/PMath.sol";
|
|
7
|
+
import "../PendleLpOracleLib.sol";
|
|
8
|
+
|
|
9
|
+
import {AggregatorV2V3Interface as IChainlinkAggregator} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @notice The returned price from this contract is multiplied by the default USD price of the
|
|
13
|
+
* SY-equivalent token, as read from a Chainlink-interface oracle.
|
|
14
|
+
*
|
|
15
|
+
* Example of this usage:
|
|
16
|
+
* - PT-weETH = ptToSyRate * weETH price
|
|
17
|
+
* - PT-ezETH = ptToSyRate * ezETH price
|
|
18
|
+
*
|
|
19
|
+
* For more details into how the oracle is implemented, refer to PendlePYLpOracle & PendlePYOracleLib.
|
|
20
|
+
*/
|
|
21
|
+
contract BoringPYUsdChainlinkSYOracle {
|
|
22
|
+
using PendlePYOracleLib for IPMarket;
|
|
23
|
+
|
|
24
|
+
uint32 public immutable twapDuration;
|
|
25
|
+
address public immutable market;
|
|
26
|
+
address public immutable feed;
|
|
27
|
+
uint8 public immutable feedDecimals;
|
|
28
|
+
address public immutable pyLpOracle;
|
|
29
|
+
|
|
30
|
+
constructor(uint32 _twapDuration, address _market, address _feed, address _pyLpOracle) {
|
|
31
|
+
twapDuration = _twapDuration;
|
|
32
|
+
market = _market;
|
|
33
|
+
feed = _feed;
|
|
34
|
+
feedDecimals = IChainlinkAggregator(feed).decimals();
|
|
35
|
+
|
|
36
|
+
// required only for sample2
|
|
37
|
+
pyLpOracle = _pyLpOracle;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @notice All pricing functions in this contract should only be used after checkOracleState() is ran successfully without reverting.
|
|
41
|
+
* This equals to calling checkOracleState() in your oracle constructor.
|
|
42
|
+
*/
|
|
43
|
+
// checkOracleState();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// @notice direct integration with PendlePYOracleLib, which optimizes gas efficiency.
|
|
47
|
+
/// @notice please checkOracleState() before use
|
|
48
|
+
function getPtPriceSample1() external view virtual returns (uint256) {
|
|
49
|
+
uint256 ptRate = IPMarket(market).getPtToSyRate(twapDuration);
|
|
50
|
+
uint256 syEquivalentTokenPrice = _getSYEquivalentTokenPrice();
|
|
51
|
+
return (syEquivalentTokenPrice * ptRate) / PMath.ONE;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// @notice integration with the PendlePtOracle contract, resulting in a smaller bytecode size and simpler structure
|
|
55
|
+
/// but slightly higher gas usage (~ 4000 gas, 2 external calls & 1 cold code load)
|
|
56
|
+
/// @notice please checkOracleState() before use
|
|
57
|
+
function getPtPriceSample2() external view virtual returns (uint256) {
|
|
58
|
+
uint256 ptRate = IPPYLpOracle(pyLpOracle).getPtToSyRate(market, twapDuration);
|
|
59
|
+
uint256 syEquivalentTokenPrice = _getSYEquivalentTokenPrice();
|
|
60
|
+
return (syEquivalentTokenPrice * ptRate) / PMath.ONE;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getYtPriceSample1() external view virtual returns (uint256) {
|
|
64
|
+
uint256 ytRate = IPMarket(market).getYtToSyRate(twapDuration);
|
|
65
|
+
uint256 syEquivalentTokenPrice = _getSYEquivalentTokenPrice();
|
|
66
|
+
return (syEquivalentTokenPrice * ytRate) / PMath.ONE;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getYtPriceSample2() external view virtual returns (uint256) {
|
|
70
|
+
uint256 ytRate = IPPYLpOracle(pyLpOracle).getYtToSyRate(market, twapDuration);
|
|
71
|
+
uint256 syEquivalentTokenPrice = _getSYEquivalentTokenPrice();
|
|
72
|
+
return (syEquivalentTokenPrice * ytRate) / PMath.ONE;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _getSYEquivalentTokenPrice() internal view virtual returns (uint256) {
|
|
76
|
+
uint256 rawPrice = uint256(IChainlinkAggregator(feed).latestAnswer());
|
|
77
|
+
return feedDecimals < 18 ? rawPrice * 10 ** (18 - feedDecimals) : rawPrice / 10 ** (feedDecimals - 18);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// ------------------ NOT TO INCLUDE IN PRODUCTION CODE ------------------
|
|
81
|
+
|
|
82
|
+
error IncreaseCardinalityRequired(uint16 cardinalityRequired);
|
|
83
|
+
error AdditionalWaitRequired(uint32 duration);
|
|
84
|
+
|
|
85
|
+
/// @notice Call only once for each (market, duration). Once successful, it's permanently valid (also for any shorter duration).
|
|
86
|
+
function checkOracleState() external view {
|
|
87
|
+
(bool increaseCardinalityRequired, uint16 cardinalityRequired, bool oldestObservationSatisfied) = IPPYLpOracle(
|
|
88
|
+
pyLpOracle
|
|
89
|
+
).getOracleState(market, twapDuration);
|
|
90
|
+
|
|
91
|
+
if (increaseCardinalityRequired) {
|
|
92
|
+
// It's required to call IPMarket(market).increaseObservationsCardinalityNext(cardinalityRequired) and wait for
|
|
93
|
+
// at least the twapDuration, to allow data population.
|
|
94
|
+
revert IncreaseCardinalityRequired(cardinalityRequired);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!oldestObservationSatisfied) {
|
|
98
|
+
// It's necessary to wait for at least the twapDuration, to allow data population.
|
|
99
|
+
revert AdditionalWaitRequired(twapDuration);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
package/deployments/1-core.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"routerStatic": "0x263833d47eA3fA4a30f269323aba6a107f9eB14C",
|
|
33
33
|
"pendleSwap": "0x1e8b6Ac39f8A33f46a6Eb2D1aCD1047B99180AD1",
|
|
34
34
|
"routerHelper": "0x462206b11d185ef6F64B41D344325401C37EC335",
|
|
35
|
-
"
|
|
35
|
+
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
36
36
|
"yieldContractFactoryV3": "0xdF3601014686674e53d1Fa52F7602525483F9122",
|
|
37
37
|
"marketFactoryV3": "0x1A6fCc85557BC4fB7B534ed835a03EF056552D52",
|
|
38
38
|
"poolDeployHelper": "0x1E4c3DE54DecbD51F1F9a6b4eaFd265FAc04e831",
|
package/deployments/10-core.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"routerStatic": "0x704478Dd72FD7F9B83d1F1e0fc18C14B54F034d0",
|
|
32
32
|
"pendleSwap": "0x9B9f96786B1051F5c72c517e7DEB189CF66E704F",
|
|
33
33
|
"routerHelper": "0x462206b11d185ef6F64B41D344325401C37EC335",
|
|
34
|
-
"
|
|
34
|
+
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
35
35
|
"yieldContractFactoryV3": "0xfa6B22FC4c3Ad88B68c16b3061a16b1714F6Bd57",
|
|
36
36
|
"marketFactoryV3": "0x4A2B38b9cBd83c86F261a4d64c243795D4d44aBC",
|
|
37
37
|
"poolDeployHelper": "0xc4A9d8b486f388CC0E4168d2904277e8C8372FA3",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"routerStatic": "0xAdB09F65bd90d19e3148D9ccb693F3161C6DB3E8",
|
|
32
32
|
"pendleSwap": "0x63a45E0B2686F7be77Bb85735c35704D1046459a",
|
|
33
33
|
"routerHelper": "0x462206b11d185ef6F64B41D344325401C37EC335",
|
|
34
|
-
"
|
|
34
|
+
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
35
35
|
"yieldContractFactoryV3": "0xEb38531db128EcA928aea1B1CE9E5609B15ba146",
|
|
36
36
|
"marketFactoryV3": "0x2FCb47B58350cD377f94d3821e7373Df60bD9Ced",
|
|
37
37
|
"poolDeployHelper": "0x644f83C584E9B109518726d5bEa3FF615548f88b",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY Camelot",
|
|
3
|
+
"SY": "0xc79d8a2aa6d769138e599d4dbc30569c9870a6ee",
|
|
4
|
+
"YT": "0x6382276be546b4816a72a9ef08c52575e569dda0",
|
|
5
|
+
"PT": "0xcef75d0914d183c8eadfafaea9dfef688aaffcf3",
|
|
6
|
+
"market": "0xe9e114d1b119bbdeb7a35e1ce3c82db01622ada2",
|
|
7
|
+
"expiry": 1750896000,
|
|
8
|
+
"scalarRoot": "13559889929000000000",
|
|
9
|
+
"initAnchor": "1206279539000000000",
|
|
10
|
+
"lnFeeRateRoot": "999500333000000",
|
|
11
|
+
"deployTxHash": "0x3da72680ebb07a420f9e62854769dff7391abd72448916014bc95ef120a65b51",
|
|
12
|
+
"deployBlockNumber": 217875356,
|
|
13
|
+
"reversedFee": 0.09999999999164011
|
|
14
|
+
}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"routerStatic": "0xCAd502Bb55d1A3F79952F969BFF3f011CF30a94a",
|
|
29
29
|
"pendleSwap": "0x30d1dBD3CC0bD3217fA048596a7cd6932D205438",
|
|
30
|
-
"
|
|
30
|
+
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
31
31
|
"yieldContractFactoryV3": "0x964840644B88C583500F473E4B829Ab629aF96A8",
|
|
32
32
|
"marketFactoryV3": "0xD228EC1f7D4313fe321fab511A872475D07F5bA6",
|
|
33
33
|
"poolDeployHelper": "0x01D0A833C3aD951e37E6f9bf5ecE86e519fF8a0c",
|
package/deployments/56-core.json
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"routerStatic": "0x2700ADB035F82a11899ce1D3f1BF8451c296eABb",
|
|
32
32
|
"pendleSwap": "0x439B4d66255eFf74e621FBacb00D7162b588Ff4b",
|
|
33
33
|
"routerHelper": "0x09D65812dCD0f276e052583d41885cA5C7Dd0086",
|
|
34
|
-
"
|
|
34
|
+
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
35
35
|
"yieldContractFactoryV3": "0x40Ae6da2d92aa3DCb7f8d7a7209FD12BDfcb7C85",
|
|
36
36
|
"marketFactoryV3": "0xC40fEbF5A33b8C92B187d9be0fD3fe0ac2E4B07c",
|
|
37
37
|
"poolDeployHelper": "0x73Be47237F12F36203823BAc9A4d80dC798B7015",
|
package/package.json
CHANGED
|
@@ -35,7 +35,7 @@ export interface PendlePYLpOracleInterface extends utils.Interface {
|
|
|
35
35
|
"getPtToSyRate(address,uint32)": FunctionFragment;
|
|
36
36
|
"getYtToAssetRate(address,uint32)": FunctionFragment;
|
|
37
37
|
"getYtToSyRate(address,uint32)": FunctionFragment;
|
|
38
|
-
"initialize()": FunctionFragment;
|
|
38
|
+
"initialize(uint16)": FunctionFragment;
|
|
39
39
|
"owner()": FunctionFragment;
|
|
40
40
|
"pendingOwner()": FunctionFragment;
|
|
41
41
|
"setBlockCycleNumerator(uint16)": FunctionFragment;
|
|
@@ -84,7 +84,7 @@ export interface PendlePYLpOracleInterface extends utils.Interface {
|
|
|
84
84
|
): string;
|
|
85
85
|
encodeFunctionData(
|
|
86
86
|
functionFragment: "initialize",
|
|
87
|
-
values
|
|
87
|
+
values: [BigNumberish]
|
|
88
88
|
): string;
|
|
89
89
|
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
|
90
90
|
encodeFunctionData(
|
|
@@ -271,6 +271,7 @@ export interface PendlePYLpOracle extends BaseContract {
|
|
|
271
271
|
): Promise<[BigNumber]>;
|
|
272
272
|
|
|
273
273
|
initialize(
|
|
274
|
+
_blockCycleNumerator: BigNumberish,
|
|
274
275
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
275
276
|
): Promise<ContractTransaction>;
|
|
276
277
|
|
|
@@ -348,6 +349,7 @@ export interface PendlePYLpOracle extends BaseContract {
|
|
|
348
349
|
): Promise<BigNumber>;
|
|
349
350
|
|
|
350
351
|
initialize(
|
|
352
|
+
_blockCycleNumerator: BigNumberish,
|
|
351
353
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
352
354
|
): Promise<ContractTransaction>;
|
|
353
355
|
|
|
@@ -422,7 +424,10 @@ export interface PendlePYLpOracle extends BaseContract {
|
|
|
422
424
|
overrides?: CallOverrides
|
|
423
425
|
): Promise<BigNumber>;
|
|
424
426
|
|
|
425
|
-
initialize(
|
|
427
|
+
initialize(
|
|
428
|
+
_blockCycleNumerator: BigNumberish,
|
|
429
|
+
overrides?: CallOverrides
|
|
430
|
+
): Promise<void>;
|
|
426
431
|
|
|
427
432
|
owner(overrides?: CallOverrides): Promise<string>;
|
|
428
433
|
|
|
@@ -514,6 +519,7 @@ export interface PendlePYLpOracle extends BaseContract {
|
|
|
514
519
|
): Promise<BigNumber>;
|
|
515
520
|
|
|
516
521
|
initialize(
|
|
522
|
+
_blockCycleNumerator: BigNumberish,
|
|
517
523
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
518
524
|
): Promise<BigNumber>;
|
|
519
525
|
|
|
@@ -590,6 +596,7 @@ export interface PendlePYLpOracle extends BaseContract {
|
|
|
590
596
|
): Promise<PopulatedTransaction>;
|
|
591
597
|
|
|
592
598
|
initialize(
|
|
599
|
+
_blockCycleNumerator: BigNumberish,
|
|
593
600
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
594
601
|
): Promise<PopulatedTransaction>;
|
|
595
602
|
|
|
@@ -174,7 +174,7 @@ const _abi = [
|
|
|
174
174
|
];
|
|
175
175
|
|
|
176
176
|
const _bytecode =
|
|
177
|
-
"0x60e06040523480156200001157600080fd5b5060405162001c8738038062001c8783398101604081905262000034916200012f565b63ffffffff831660808190526001600160a01b0383811660a081905283821660c05260405162439f4b60e91b815260048101919091526024810192909252600091829187169063873e960090604401606060405180830381865afa158015620000a1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000c79190620001a7565b92505091508180620000d7575080155b15620001065760405163685ddbe760e11b81528215156004820152811515602482015260440160405180910390fd5b505050505050620001f9565b80516001600160a01b03811681146200012a57600080fd5b919050565b600080600080608085870312156200014657600080fd5b620001518562000112565b9350602085015163ffffffff811681146200016b57600080fd5b92506200017b6040860162000112565b91506200018b6060860162000112565b905092959194509250565b805180151581146200012a57600080fd5b600080600060608486031215620001bd57600080fd5b620001c88462000196565b9250602084015161ffff81168114620001e057600080fd5b9150620001f06040850162000196565b90509250925092565b60805160a05160c051611a4c6200023b6000396000818160fb015261019701526000818160c7015261012d0152600081816061015261014f0152611a4c6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806326d895451461005c578063313ce5671461009d5780634c7198f4146100ac57806380f55605146100c2578063fa6db1bc146100f6575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b60405160128152602001610094565b6100b461011d565b604051908152602001610094565b6100e97f000000000000000000000000000000000000000000000000000000000000000081565b60405161009491906115ad565b6100e97f000000000000000000000000000000000000000000000000000000000000000081565b6000806101736001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000061022c565b60405163e245b5af60e01b8152600160048201529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e245b5af90602401602060405180830381865afa1580156101de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020291906115c1565b905068327cb2734119d3b7a9601e1b61021b83836115f0565b610225919061161d565b9250505090565b600080600061023a8561027f565b91509150600061024b8686846104af565b905081831061025e579250610279915050565b8161026984836115f0565b610273919061161d565b93505050505b92915050565b600080600080846001600160a01b0316632c8ce6bc6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156102c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e79190611649565b9250509150816001600160a01b0316633ba0b9a96040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034e91906115c1565b93506000816001600160a01b031663d2a3584e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b491906115c1565b9050816001600160a01b031663516399df6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104189190611696565b801561048d575043826001600160a01b03166360e0a9e16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561045e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048291906116b8565b6001600160801b0316145b1561049a578093506104a7565b6104a48582610646565b93505b505050915091565b600080846001600160a01b031663794052f360006040518263ffffffff1660e01b81526004016104df91906115ad565b61012060405180830381865afa1580156104fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610521919061175b565b90506000428260a00151116105515761053e84836020015161065e565b825161054a91906117dd565b905061061d565b600061055e8386426106a2565b905060008061056e89868a6107a8565b91509150600061059761059285604001518561058a9190611805565b865190610818565b61083b565b905060006105dc6105a88385610c50565b6105ba90670de0b6b3a76400006117dd565b885160208801516105cc908690610818565b6105d69190611805565b90610c50565b90506105f2848289600001516105d691906117dd565b6105fc8285610c50565b866020015161060b9190611805565b61061591906117dd565b955050505050505b61063c610637836040015183610c5090919063ffffffff16565b610c76565b9695505050505050565b60008183116106555781610657565b825b9392505050565b60008060008312610670576001610674565b6000195b905061069061068b8561068686610c89565b610c9b565b610cba565b61069a9082611825565b949350505050565b6106cd6040518060800160405280600081526020016000815260200160008152602001600081525090565b60a084015182106106f15760405163b2094b5960e01b815260040160405180910390fd5b6000828560a001516107039190611855565b905061070f8582610cd0565b8252602085015161072190859061065e565b60208301528451158061073657506020820151155b15610769578451602083015160405163b1c4aefb60e01b8152600481019290925260248201526044015b60405180910390fd5b61078785600001518661010001518460200151856000015185610d2c565b604083015260c085015161079b9082610dad565b6060830152509392505050565b6000806107d36107c461068b6001600160a01b03881686610de1565b670de0b6b3a764000090610c50565b915060006107f5856101000151428760a001516107f09190611855565b610dad565b9050600261080384836117dd565b61080d9190611868565b915050935093915050565b6000806108258385611825565b9050670de0b6b3a7640000815b05949350505050565b6000680238fd42c5cf03ffff198212158015610860575068070c1cc73b00c800008213155b61089f5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a5908195e1c1bdb995b9d60821b6044820152606401610760565b60008212156108d7576108b48260000361083b565b6a0c097ce7bc90715b34b9f160241b816108d0576108d0611607565b0592915050565b60006806f05b59d3b2000000831261091557506806f05b59d3b1ffffff199091019072195e54c5dd42177f53a27172fa9ec63026282760241b61094b565b6803782dace9d9000000831261094757506803782dace9d8ffffff19909101906b1425982cf597cd205cef738061094b565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac62000000841261099b5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d63100000084126109d7576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412610a1157682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412610a4b576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412610a8457680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412610abd5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412610af6576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412610b2f5768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b600080610c65670de0b6b3a764000085611825565b905082818161083257610832611607565b600080821215610c8557600080fd5b5090565b6000808213610c855761027982611896565b6000670de0b6b3a7640000610cb084846115f0565b610657919061161d565b60006001600160ff1b03821115610c8557600080fd5b6000610cdb82610cba565b610ced61068b6201518061016d6115f0565b8460800151610cfc9190611825565b610d069190611868565b90506000811361027957604051630e520c3b60e11b815260048101829052602401610760565b600080610d398684610dad565b9050670de0b6b3a7640000811215610d675760405163329e322960e21b815260048101829052602401610760565b6000610d7d610d76878a6117dd565b8990610c50565b90506000610d8a82610eb1565b9050610d968187610c50565b610da09084611805565b9998505050505050505050565b600080610dbf6201518061016d6115f0565b610dc984866115f0565b610dd3919061161d565b905061069a61059282610cba565b600080836001600160a01b031663e184c9be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4691906115c1565b9050428111610e6057670de0b6b3a7640000915050610279565b6000610e6c8585610f04565b90506000610e7a4284611855565b90506000610e8b6106378484610dad565b9050610e9f670de0b6b3a76400008261102b565b945050505050610279565b5092915050565b6000670de0b6b3a76400008203610edb5760405163a9c8b14d60e01b815260040160405180910390fd5b6000610ef9610ef284670de0b6b3a7640000611805565b8490610c50565b90506106578161105a565b604080516002808252606082018352600092839291906020830190803683370190505090508281600081518110610f3d57610f3d6118b2565b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0386169063883bdbfd90610f819085906004016118c8565b600060405180830381865afa158015610f9e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc69190810190611912565b90508363ffffffff1681600081518110610fe257610fe26118b2565b602002602001015182600181518110610ffd57610ffd6118b2565b602002602001015161100f91906119d0565b61101991906119f0565b6001600160d81b031695945050505050565b600080611040670de0b6b3a7640000856115f0565b905082818161105157611051611607565b04949350505050565b600080821361109b5760405162461bcd60e51b815260206004820152600d60248201526c6f7574206f6620626f756e647360981b6044820152606401610760565b670c7d713b49da0000821380156110b95750670f43fc2c04ee000082125b156110dd57670de0b6b3a76400006110d0836110eb565b816108d0576108d0611607565b6102798261120a565b919050565b670de0b6b3a7640000026000806a0c097ce7bc90715b34b9f160241b808401906ec097ce7bc90715b34b9f0fffffffff198501028161112c5761112c611607565b05905060006a0c097ce7bc90715b34b9f160241b82800205905081806a0c097ce7bc90715b34b9f160241b81840205915060038205016a0c097ce7bc90715b34b9f160241b82840205915060058205016a0c097ce7bc90715b34b9f160241b82840205915060078205016a0c097ce7bc90715b34b9f160241b82840205915060098205016a0c097ce7bc90715b34b9f160241b828402059150600b8205016a0c097ce7bc90715b34b9f160241b828402059150600d8205016a0c097ce7bc90715b34b9f160241b828402059150600f82050160020295945050505050565b6000670de0b6b3a764000082121561124b57611242826a0c097ce7bc90715b34b9f160241b8161123c5761123c611607565b0561120a565b60000392915050565b6000775803bcc5cb9634ba4cfb2213f784019318ed4dcb6017880f60361b83126112965772195e54c5dd42177f53a27172fa9ec63026282760241b830592506806f05b59d3b2000000015b6f8bcc0026baae9e45e470190267a230cf60191b83126112cd576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff00840008312611315576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a7008312611350576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf850831261138757693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e283126113be57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d0383126113f35768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb41746121110831261141e57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d8312611453576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312611488576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b28660383126114bc576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac83126114f0576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d63100000808603028161151957611519611607565b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6001600160a01b0391909116815260200190565b6000602082840312156115d357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610279576102796115da565b634e487b7160e01b600052601260045260246000fd5b60008261162c5761162c611607565b500490565b6001600160a01b038116811461164657600080fd5b50565b60008060006060848603121561165e57600080fd5b835161166981611631565b602085015190935061167a81611631565b604085015190925061168b81611631565b809150509250925092565b6000602082840312156116a857600080fd5b8151801515811461065757600080fd5b6000602082840312156116ca57600080fd5b81516001600160801b038116811461065757600080fd5b634e487b7160e01b600052604160045260246000fd5b60405161012081016001600160401b038111828210171561171a5761171a6116e1565b60405290565b604051601f8201601f191681016001600160401b0381118282101715611748576117486116e1565b604052919050565b80516110e681611631565b6000610120828403121561176e57600080fd5b6117766116f7565b82518152602083015160208201526040830151604082015261179a60608401611750565b60608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b80820182811260008312801582168215821617156117fd576117fd6115da565b505092915050565b8181036000831280158383131683831282161715610eaa57610eaa6115da565b80820260008212600160ff1b84141615611841576118416115da565b8181058314821517610279576102796115da565b81810381811115610279576102796115da565b60008261187757611877611607565b600160ff1b821460001984141615611891576118916115da565b500590565b6000600160ff1b82016118ab576118ab6115da565b5060000390565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561190657835163ffffffff16835292840192918401916001016118e4565b50909695505050505050565b6000602080838503121561192557600080fd5b82516001600160401b038082111561193c57600080fd5b818501915085601f83011261195057600080fd5b815181811115611962576119626116e1565b8060051b9150611973848301611720565b818152918301840191848101908884111561198d57600080fd5b938501935b838510156119c457845192506001600160d81b03831683146119b45760008081fd5b8282529385019390850190611992565b98975050505050505050565b6001600160d81b03828116828216039080821115610eaa57610eaa6115da565b60006001600160d81b0383811680611a0a57611a0a611607565b9216919091049291505056fea26469706673582212201b1d20c6b62e1bd1c1e9c2141efc4e7fc9619937e7683ea8c3f397244f4a2e0c64736f6c63430008170033";
|
|
177
|
+
"0x60e06040523480156200001157600080fd5b5060405162001c8738038062001c8783398101604081905262000034916200012f565b63ffffffff831660808190526001600160a01b0383811660a081905283821660c05260405162439f4b60e91b815260048101919091526024810192909252600091829187169063873e960090604401606060405180830381865afa158015620000a1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000c79190620001a7565b92505091508180620000d7575080155b15620001065760405163685ddbe760e11b81528215156004820152811515602482015260440160405180910390fd5b505050505050620001f9565b80516001600160a01b03811681146200012a57600080fd5b919050565b600080600080608085870312156200014657600080fd5b620001518562000112565b9350602085015163ffffffff811681146200016b57600080fd5b92506200017b6040860162000112565b91506200018b6060860162000112565b905092959194509250565b805180151581146200012a57600080fd5b600080600060608486031215620001bd57600080fd5b620001c88462000196565b9250602084015161ffff81168114620001e057600080fd5b9150620001f06040850162000196565b90509250925092565b60805160a05160c051611a4c6200023b6000396000818160fb015261019701526000818160c7015261012d0152600081816061015261014f0152611a4c6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806326d895451461005c578063313ce5671461009d5780634c7198f4146100ac57806380f55605146100c2578063fa6db1bc146100f6575b600080fd5b6100837f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff90911681526020015b60405180910390f35b60405160128152602001610094565b6100b461011d565b604051908152602001610094565b6100e97f000000000000000000000000000000000000000000000000000000000000000081565b60405161009491906115ad565b6100e97f000000000000000000000000000000000000000000000000000000000000000081565b6000806101736001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000167f000000000000000000000000000000000000000000000000000000000000000061022c565b60405163e245b5af60e01b8152600160048201529091506000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e245b5af90602401602060405180830381865afa1580156101de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061020291906115c1565b905068327cb2734119d3b7a9601e1b61021b83836115f0565b610225919061161d565b9250505090565b600080600061023a8561027f565b91509150600061024b8686846104af565b905081831061025e579250610279915050565b8161026984836115f0565b610273919061161d565b93505050505b92915050565b600080600080846001600160a01b0316632c8ce6bc6040518163ffffffff1660e01b8152600401606060405180830381865afa1580156102c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e79190611649565b9250509150816001600160a01b0316633ba0b9a96040518163ffffffff1660e01b8152600401602060405180830381865afa15801561032a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061034e91906115c1565b93506000816001600160a01b031663d2a3584e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610390573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b491906115c1565b9050816001600160a01b031663516399df6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104189190611696565b801561048d575043826001600160a01b03166360e0a9e16040518163ffffffff1660e01b8152600401602060405180830381865afa15801561045e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048291906116b8565b6001600160801b0316145b1561049a578093506104a7565b6104a48582610646565b93505b505050915091565b600080846001600160a01b031663794052f360006040518263ffffffff1660e01b81526004016104df91906115ad565b61012060405180830381865afa1580156104fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610521919061175b565b90506000428260a00151116105515761053e84836020015161065e565b825161054a91906117dd565b905061061d565b600061055e8386426106a2565b905060008061056e89868a6107a8565b91509150600061059761059285604001518561058a9190611805565b865190610818565b61083b565b905060006105dc6105a88385610c50565b6105ba90670de0b6b3a76400006117dd565b885160208801516105cc908690610818565b6105d69190611805565b90610c50565b90506105f2848289600001516105d691906117dd565b6105fc8285610c50565b866020015161060b9190611805565b61061591906117dd565b955050505050505b61063c610637836040015183610c5090919063ffffffff16565b610c76565b9695505050505050565b60008183116106555781610657565b825b9392505050565b60008060008312610670576001610674565b6000195b905061069061068b8561068686610c89565b610c9b565b610cba565b61069a9082611825565b949350505050565b6106cd6040518060800160405280600081526020016000815260200160008152602001600081525090565b60a084015182106106f15760405163b2094b5960e01b815260040160405180910390fd5b6000828560a001516107039190611855565b905061070f8582610cd0565b8252602085015161072190859061065e565b60208301528451158061073657506020820151155b15610769578451602083015160405163b1c4aefb60e01b8152600481019290925260248201526044015b60405180910390fd5b61078785600001518661010001518460200151856000015185610d2c565b604083015260c085015161079b9082610dad565b6060830152509392505050565b6000806107d36107c461068b6001600160a01b03881686610de1565b670de0b6b3a764000090610c50565b915060006107f5856101000151428760a001516107f09190611855565b610dad565b9050600261080384836117dd565b61080d9190611868565b915050935093915050565b6000806108258385611825565b9050670de0b6b3a7640000815b05949350505050565b6000680238fd42c5cf03ffff198212158015610860575068070c1cc73b00c800008213155b61089f5760405162461bcd60e51b815260206004820152601060248201526f125b9d985b1a5908195e1c1bdb995b9d60821b6044820152606401610760565b60008212156108d7576108b48260000361083b565b6a0c097ce7bc90715b34b9f160241b816108d0576108d0611607565b0592915050565b60006806f05b59d3b2000000831261091557506806f05b59d3b1ffffff199091019072195e54c5dd42177f53a27172fa9ec63026282760241b61094b565b6803782dace9d9000000831261094757506803782dace9d8ffffff19909101906b1425982cf597cd205cef738061094b565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac62000000841261099b5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d63100000084126109d7576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412610a1157682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412610a4b576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412610a8457680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412610abd5768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412610af6576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412610b2f5768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b600080610c65670de0b6b3a764000085611825565b905082818161083257610832611607565b600080821215610c8557600080fd5b5090565b6000808213610c855761027982611896565b6000670de0b6b3a7640000610cb084846115f0565b610657919061161d565b60006001600160ff1b03821115610c8557600080fd5b6000610cdb82610cba565b610ced61068b6201518061016d6115f0565b8460800151610cfc9190611825565b610d069190611868565b90506000811361027957604051630e520c3b60e11b815260048101829052602401610760565b600080610d398684610dad565b9050670de0b6b3a7640000811215610d675760405163329e322960e21b815260048101829052602401610760565b6000610d7d610d76878a6117dd565b8990610c50565b90506000610d8a82610eb1565b9050610d968187610c50565b610da09084611805565b9998505050505050505050565b600080610dbf6201518061016d6115f0565b610dc984866115f0565b610dd3919061161d565b905061069a61059282610cba565b600080836001600160a01b031663e184c9be6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4691906115c1565b9050428111610e6057670de0b6b3a7640000915050610279565b6000610e6c8585610f04565b90506000610e7a4284611855565b90506000610e8b6106378484610dad565b9050610e9f670de0b6b3a76400008261102b565b945050505050610279565b5092915050565b6000670de0b6b3a76400008203610edb5760405163a9c8b14d60e01b815260040160405180910390fd5b6000610ef9610ef284670de0b6b3a7640000611805565b8490610c50565b90506106578161105a565b604080516002808252606082018352600092839291906020830190803683370190505090508281600081518110610f3d57610f3d6118b2565b63ffffffff9092166020928302919091019091015260405163883bdbfd60e01b81526000906001600160a01b0386169063883bdbfd90610f819085906004016118c8565b600060405180830381865afa158015610f9e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc69190810190611912565b90508363ffffffff1681600081518110610fe257610fe26118b2565b602002602001015182600181518110610ffd57610ffd6118b2565b602002602001015161100f91906119d0565b61101991906119f0565b6001600160d81b031695945050505050565b600080611040670de0b6b3a7640000856115f0565b905082818161105157611051611607565b04949350505050565b600080821361109b5760405162461bcd60e51b815260206004820152600d60248201526c6f7574206f6620626f756e647360981b6044820152606401610760565b670c7d713b49da0000821380156110b95750670f43fc2c04ee000082125b156110dd57670de0b6b3a76400006110d0836110eb565b816108d0576108d0611607565b6102798261120a565b919050565b670de0b6b3a7640000026000806a0c097ce7bc90715b34b9f160241b808401906ec097ce7bc90715b34b9f0fffffffff198501028161112c5761112c611607565b05905060006a0c097ce7bc90715b34b9f160241b82800205905081806a0c097ce7bc90715b34b9f160241b81840205915060038205016a0c097ce7bc90715b34b9f160241b82840205915060058205016a0c097ce7bc90715b34b9f160241b82840205915060078205016a0c097ce7bc90715b34b9f160241b82840205915060098205016a0c097ce7bc90715b34b9f160241b828402059150600b8205016a0c097ce7bc90715b34b9f160241b828402059150600d8205016a0c097ce7bc90715b34b9f160241b828402059150600f82050160020295945050505050565b6000670de0b6b3a764000082121561124b57611242826a0c097ce7bc90715b34b9f160241b8161123c5761123c611607565b0561120a565b60000392915050565b6000775803bcc5cb9634ba4cfb2213f784019318ed4dcb6017880f60361b83126112965772195e54c5dd42177f53a27172fa9ec63026282760241b830592506806f05b59d3b2000000015b6f8bcc0026baae9e45e470190267a230cf60191b83126112cd576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff00840008312611315576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a7008312611350576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf850831261138757693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e283126113be57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d0383126113f35768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb41746121110831261141e57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d8312611453576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312611488576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b28660383126114bc576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac83126114f0576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d63100000808603028161151957611519611607565b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6001600160a01b0391909116815260200190565b6000602082840312156115d357600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082028115828204841417610279576102796115da565b634e487b7160e01b600052601260045260246000fd5b60008261162c5761162c611607565b500490565b6001600160a01b038116811461164657600080fd5b50565b60008060006060848603121561165e57600080fd5b835161166981611631565b602085015190935061167a81611631565b604085015190925061168b81611631565b809150509250925092565b6000602082840312156116a857600080fd5b8151801515811461065757600080fd5b6000602082840312156116ca57600080fd5b81516001600160801b038116811461065757600080fd5b634e487b7160e01b600052604160045260246000fd5b60405161012081016001600160401b038111828210171561171a5761171a6116e1565b60405290565b604051601f8201601f191681016001600160401b0381118282101715611748576117486116e1565b604052919050565b80516110e681611631565b6000610120828403121561176e57600080fd5b6117766116f7565b82518152602083015160208201526040830151604082015261179a60608401611750565b60608201526080830151608082015260a083015160a082015260c083015160c082015260e083015160e08201526101008084015181830152508091505092915050565b80820182811260008312801582168215821617156117fd576117fd6115da565b505092915050565b8181036000831280158383131683831282161715610eaa57610eaa6115da565b80820260008212600160ff1b84141615611841576118416115da565b8181058314821517610279576102796115da565b81810381811115610279576102796115da565b60008261187757611877611607565b600160ff1b821460001984141615611891576118916115da565b500590565b6000600160ff1b82016118ab576118ab6115da565b5060000390565b634e487b7160e01b600052603260045260246000fd5b6020808252825182820181905260009190848201906040850190845b8181101561190657835163ffffffff16835292840192918401916001016118e4565b50909695505050505050565b6000602080838503121561192557600080fd5b82516001600160401b038082111561193c57600080fd5b818501915085601f83011261195057600080fd5b815181811115611962576119626116e1565b8060051b9150611973848301611720565b818152918301840191848101908884111561198d57600080fd5b938501935b838510156119c457845192506001600160d81b03831683146119b45760008081fd5b8282529385019390850190611992565b98975050505050505050565b6001600160d81b03828116828216039080821115610eaa57610eaa6115da565b60006001600160d81b0383811680611a0a57611a0a611607565b9216919091049291505056fea2646970667358221220fa47ab8ac91376d35ff4d4843c32dc9ed4c7dd405243e1a5d3190843cdce525964736f6c63430008170033";
|
|
178
178
|
|
|
179
179
|
type BoringLpGlpOracleConstructorParams =
|
|
180
180
|
| [signer?: Signer]
|