@pendle/core-v2 5.2.0-beta-4 → 5.2.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/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +67 -23
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.json +19 -6
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/SYBaseWithoutPermitUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/{SYBaseUpg.json → SYBaseWithoutPermitUpg.json} +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSYUpg.sol/PendleAaveV3WithRewardsSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSYUpg.sol/PendleAaveV3WithRewardsSYUpg.json +1169 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol/PendleStkGHOSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol/PendleStkGHOSY.json +1160 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol/PendleChainlinkReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol/PendleChainlinkReceiver.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol/PendleChainlinkRelayer.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol/PendleChainlinkRelayer.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol/PendleCMETHSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol/PendleCMETHSY.json +1049 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveNonBorrowableSY.sol/PendleSiloWithIncentiveNonBorrowableSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveNonBorrowableSY.sol/PendleSiloWithIncentiveNonBorrowableSY.json +1222 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Solv/PendleSolvBTCBBNBaseSYUpg.sol/PendleSolvBTCBBNBaseSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Solv/PendleSolvBTCBBNBaseSYUpg.sol/PendleSolvBTCBBNBaseSYUpg.json +1072 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Solv/PendleSolvHelperBase.sol/PendleSolvHelperBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Solv/PendleSolvHelperBase.sol/PendleSolvHelperBase.json +115 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol/PendleZerolendEBTCSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol/PendleZerolendEBTCSYUpg.json +1337 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendLBTCSYUpg.sol/PendleZerolendLBTCSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendLBTCSYUpg.sol/PendleZerolendLBTCSYUpg.json +1226 -0
- package/build/artifacts/contracts/interfaces/AaveV3/IAaveStkGHO.sol/IAaveStkGHO.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/AaveV3/IAaveStkGHO.sol/IAaveStkGHO.json +116 -0
- package/build/artifacts/contracts/interfaces/Angle/IAngleDistributor.sol/IAngleDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Angle/IAngleDistributor.sol/IAngleDistributor.json +39 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.json +66 -0
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +66 -0
- package/build/artifacts/contracts/interfaces/Zerolend/IZerolendPool.sol/IZerolendPool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Zerolend/IZerolendPool.sol/IZerolendPool.json +37 -0
- package/build/artifacts/contracts/interfaces/Zerolend/IZerolendZ0Token.sol/IZerolendZ0Token.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Zerolend/IZerolendZ0Token.sol/IZerolendZ0Token.json +24 -0
- package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.json +27 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +68 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{internal/PendleBoringOneracle.sol → PendleBoringOneracle.sol}/PendleBoringOneracle.json +3 -3
- package/build/artifacts/contracts/oracles/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{internal/PendleBoringSolvBTCOneracle.sol → PendleBoringSolvBTCOneracle.sol}/PendleBoringSolvBTCOneracle.json +3 -3
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/PendleLpOracleLib.sol → PendleLpOracleLib.sol}/PendleLpOracleLib.json +3 -3
- package/build/artifacts/contracts/oracles/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/PendlePYLpOracle.sol → PendlePYLpOracle.sol}/PendlePYLpOracle.json +3 -3
- package/build/artifacts/contracts/oracles/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/PendlePYOracleLib.sol → PendlePYOracleLib.sol}/PendlePYOracleLib.json +3 -3
- package/build/artifacts/contracts/oracles/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{internal/PendleRedStoneRateOracleAdapter.sol → PendleRedStoneRateOracleAdapter.sol}/PendleRedStoneRateOracleAdapter.json +3 -3
- package/build/artifacts/contracts/oracles/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{internal/PendleSparkLinearDiscountOracle.sol → PendleSparkLinearDiscountOracle.sol}/PTExpiry.json +1 -1
- package/build/artifacts/contracts/oracles/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{internal/PendleSparkLinearDiscountOracle.sol → PendleSparkLinearDiscountOracle.sol}/PendleSparkLinearDiscountOracle.json +3 -3
- package/build/artifacts/contracts/oracles/samples/BoringLpGlpOracle.sol/BoringLpGlpOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringLpGlpOracle.sol/BoringLpGlpOracle.json +3 -3
- package/build/artifacts/contracts/oracles/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringLpSeller.sol/BoringLpSeller.json +1 -1
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.json +3 -3
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.json +3 -3
- package/build/artifacts/contracts/oracles/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringPtSeller.sol/BoringPtSeller.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.json +65 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.json +82 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +67 -2
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +16 -10
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +27 -6
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +3 -2
- package/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol +7 -1
- package/contracts/core/StandardizedYield/implementations/AaveV3/{PendleAaveV3WithRewardsSY.sol → PendleAaveV3WithRewardsSYUpg.sol} +27 -45
- package/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol +130 -0
- package/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol +1 -2
- package/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol +82 -0
- package/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveNonBorrowableSY.sol +154 -0
- package/contracts/core/StandardizedYield/implementations/Solv/PendleSolvBTCBBNBaseSYUpg.sol +103 -0
- package/contracts/core/StandardizedYield/implementations/Solv/PendleSolvHelperBase.sol +47 -0
- package/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol +101 -0
- package/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendLBTCSYUpg.sol +32 -0
- package/contracts/interfaces/AaveV3/IAaveStkGHO.sol +17 -0
- package/contracts/interfaces/Angle/IAngleDistributor.sol +12 -0
- package/contracts/interfaces/IPActionMarketCoreStatic.sol +4 -0
- package/contracts/interfaces/Zerolend/IZerolendPool.sol +31 -0
- package/contracts/interfaces/Zerolend/IZerolendZ0Token.sol +6 -0
- package/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol +5 -0
- package/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol +1 -1
- package/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol +1 -1
- package/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol +10 -4
- package/contracts/oracles/{internal/PendleBoringOneracle.sol → PendleBoringOneracle.sol} +2 -2
- package/contracts/oracles/{internal/PendleBoringSolvBTCOneracle.sol → PendleBoringSolvBTCOneracle.sol} +2 -2
- package/contracts/oracles/{PtYtLpOracle/PendlePYLpOracle.sol → PendlePYLpOracle.sol} +2 -2
- package/contracts/oracles/{PtYtLpOracle/PendlePYOracleLib.sol → PendlePYOracleLib.sol} +2 -2
- package/contracts/oracles/{internal/PendleRedStoneRateOracleAdapter.sol → PendleRedStoneRateOracleAdapter.sol} +3 -3
- package/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringLpGlpOracle.sol +3 -3
- package/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringLpSeller.sol +1 -1
- package/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringPYUsdChainlinkAssetOracle.sol +3 -3
- package/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringPYUsdChainlinkSYOracle.sol +3 -3
- package/contracts/oracles/{PtYtLpOracle/samples → samples}/BoringPtSeller.sol +1 -1
- package/contracts/router/swap-aggregator/IPSwapAggregator.sol +5 -1
- package/contracts/router/swap-aggregator/PendleSwap.sol +52 -0
- package/deployments/1-core.json +1 -1
- package/deployments/1-markets/AGETH-MAINNET-JUN2025.json +14 -0
- package/deployments/1-markets/PUFETH-MAINNET-JUN2025.json +14 -0
- package/deployments/1-markets/RSETH-MAINNET-JUN2025.json +14 -0
- package/deployments/1-markets/RSWETH-MAINNET-JUN2025.json +14 -0
- package/deployments/1-markets/STKGHO-MAINNET-APR2025.json +14 -0
- package/deployments/1-markets/SUSDE-MAINNET-MAY2025.json +14 -0
- package/deployments/1-markets/UNIETH-MAINNET-JUN2025.json +14 -0
- package/deployments/1-markets/USD0++-MAINNET-JAN2025.json +14 -0
- package/deployments/1-markets/WEETH-MAINNET-JUN2025.json +14 -0
- package/deployments/1-markets/ZEROLEND-EBTC-MAINNET-MAR2025.json +14 -0
- package/deployments/10-core.json +1 -1
- package/deployments/42161-core.json +1 -1
- package/deployments/42161-markets/DOLOMITE-USDC-ARBITRUM-JUN2025.json +14 -0
- package/deployments/42161-markets/DOLOMITE-WBTC-ARBITRUM-JUN2025.json +14 -0
- package/deployments/42161-markets/RSETH-ARBITRUM-JUN2025.json +14 -0
- package/deployments/42161-markets/SPSILO-ARBITRUM-MAR2025.json +14 -0
- package/deployments/42161-markets/UNIETH-ARBITRUM-JUN2025.json +14 -0
- package/deployments/42161-markets/WEETH-ARBITRUM-JUN2025.json +14 -0
- package/deployments/5000-core.json +1 -1
- package/deployments/5000-markets/CMETH-MANTLE-FEB2025.json +14 -0
- package/deployments/56-core.json +2 -2
- package/deployments/56-markets/VENUS-BNB-BSC-JUN2025.json +14 -0
- package/deployments/8453-core.json +41 -0
- package/deployments/8453-offchain-helper.json +6 -0
- package/package.json +1 -1
- package/typechain-types/ActionMarketCoreStatic.ts +68 -0
- package/typechain-types/ActionSwapLimitV3.ts +1667 -0
- package/typechain-types/IPActionMarketCoreStatic.ts +68 -0
- package/typechain-types/IPActionSwapLimitV3.ts +1667 -0
- package/typechain-types/IPActionSwapLimitV3Events.ts +207 -0
- package/typechain-types/IPChainlinkOracleFactory.ts +6 -9
- package/typechain-types/IPRouterStatic.ts +34 -0
- package/typechain-types/IPSwapAggregator.ts +64 -3
- package/typechain-types/IZerolendPool.ts +111 -0
- package/typechain-types/IZerolendZ0Token.ts +87 -0
- package/typechain-types/PendleAaveV3WithRewardsSYUpg.ts +1498 -0
- package/typechain-types/PendleChainlinkOracle.ts +16 -16
- package/typechain-types/PendleChainlinkOracleFactory.ts +130 -64
- package/typechain-types/PendleChainlinkOracleWithQuote.ts +32 -73
- package/typechain-types/PendleSiloWithIncentiveNonBorrowableSY.ts +1543 -0
- package/typechain-types/PendleSolvBTCBBNBaseSYUpg.ts +1409 -0
- package/typechain-types/PendleSolvHelperBase.ts +220 -0
- package/typechain-types/PendleSwap.ts +64 -3
- package/typechain-types/PendleVotingControllerUpg.ts +135 -43
- package/typechain-types/PendleZerolendEBTCSYUpg.ts +1754 -0
- package/typechain-types/PendleZerolendLBTCSYUpg.ts +1598 -0
- package/typechain-types/VotingControllerStorageUpg.ts +34 -15
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
- package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +67 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSimple__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapLimitV3__factory.ts +2691 -0
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/BoringLpGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/BoringPYUsdChainlinkAssetOracle__factory.ts +1 -1
- package/typechain-types/factories/BoringPYUsdChainlinkSYOracle__factory.ts +1 -1
- package/typechain-types/factories/IPActionMarketCoreStatic__factory.ts +66 -0
- package/typechain-types/factories/IPActionSwapLimitV3Events__factory.ts +226 -0
- package/typechain-types/factories/IPActionSwapLimitV3__factory.ts +2653 -0
- package/typechain-types/factories/IPChainlinkOracleFactory__factory.ts +1 -7
- package/typechain-types/factories/IPRouterStatic__factory.ts +66 -0
- package/typechain-types/factories/IPSwapAggregator__factory.ts +65 -0
- package/typechain-types/factories/IZerolendPool__factory.ts +49 -0
- package/typechain-types/factories/IZerolendZ0Token__factory.ts +39 -0
- package/typechain-types/factories/PendleAaveV3WithRewardsSYUpg__factory.ts +1246 -0
- package/typechain-types/factories/PendleBoringOneracle__factory.ts +1 -1
- package/typechain-types/factories/PendleBoringSolvBTCOneracle__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkOracleFactory__factory.ts +65 -38
- package/typechain-types/factories/PendleChainlinkOracleWithQuote__factory.ts +14 -54
- package/typechain-types/factories/PendleChainlinkOracle__factory.ts +7 -7
- package/typechain-types/factories/PendleChainlinkReceiver__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkRelayer__factory.ts +1 -1
- package/typechain-types/factories/PendleGlpSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePYLpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleRedStoneRateOracleAdapter__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
- package/typechain-types/factories/PendleSiloWithIncentiveNonBorrowableSY__factory.ts +1317 -0
- package/typechain-types/factories/PendleSolvBTCBBNBaseSYUpg__factory.ts +1129 -0
- package/typechain-types/factories/PendleSolvHelperBase__factory.ts +172 -0
- package/typechain-types/factories/PendleSparkLinearDiscountOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleStkGHOSY__factory.ts +1 -1
- package/typechain-types/factories/PendleSwap__factory.ts +66 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +66 -22
- package/typechain-types/factories/PendleZerolendEBTCSYUpg__factory.ts +1394 -0
- package/typechain-types/factories/PendleZerolendLBTCSYUpg__factory.ts +1283 -0
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/factories/SDKErrorsDirectory__factory.ts +26 -1
- package/typechain-types/factories/VotingControllerStorageUpg__factory.ts +19 -6
- package/typechain-types/hardhat.d.ts +125 -80
- package/typechain-types/index.ts +30 -18
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/SYBaseUpg.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSY.sol/PendleAaveV3WithRewardsSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSY.sol/PendleAaveV3WithRewardsSY.json +0 -1198
- package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.json +0 -122
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.json +0 -97
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.json +0 -262
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.json +0 -10
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.json +0 -274
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleBase.sol/PendleChainlinkOracleBase.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleBase.sol/PendleChainlinkOracleBase.json +0 -253
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.json +0 -316
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.json +0 -341
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpGlpOracle.sol/BoringLpGlpOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +0 -4
- package/contracts/interfaces/IPChainlinkOracle.sol +0 -15
- package/contracts/interfaces/IPChainlinkOracleFactory.sol +0 -23
- package/contracts/interfaces/IPChainlinkOracleWithQuote.sol +0 -8
- package/contracts/offchain-helpers/MarketExchangeRateLib.sol +0 -32
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol +0 -40
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleBase.sol +0 -129
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol +0 -117
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol +0 -80
- /package/contracts/oracles/{PtYtLpOracle/PendleLpOracleLib.sol → PendleLpOracleLib.sol} +0 -0
- /package/contracts/oracles/{internal/PendleSparkLinearDiscountOracle.sol → PendleSparkLinearDiscountOracle.sol} +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "../../../interfaces/IPChainlinkOracle.sol";
|
|
5
|
-
import "../PendleLpOracleLib.sol";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @dev The round data returned from this contract will follow:
|
|
9
|
-
* - There will be only one round (roundId=0)
|
|
10
|
-
* - startedAt=0, updatedAt=block.timestamp
|
|
11
|
-
*/
|
|
12
|
-
abstract contract PendleChainlinkOracleBase is IPChainlinkOracle {
|
|
13
|
-
using PendlePYOracleLib for IPMarket;
|
|
14
|
-
using PendleLpOracleLib for IPMarket;
|
|
15
|
-
|
|
16
|
-
error InvalidRoundId();
|
|
17
|
-
|
|
18
|
-
uint8 internal constant LP_DECIMALS = 18;
|
|
19
|
-
|
|
20
|
-
// solhint-disable immutable-vars-naming
|
|
21
|
-
address public immutable factory;
|
|
22
|
-
address public immutable market;
|
|
23
|
-
uint32 public immutable twapDuration;
|
|
24
|
-
|
|
25
|
-
uint8 public immutable fromTokenDecimals;
|
|
26
|
-
uint8 public immutable toTokenDecimals;
|
|
27
|
-
|
|
28
|
-
PendleOracleType public immutable baseOracleType;
|
|
29
|
-
|
|
30
|
-
function(IPMarket, uint32) internal view returns (uint256) internal immutable getPendlePrice;
|
|
31
|
-
|
|
32
|
-
modifier validateRoundId(uint80 roundId) {
|
|
33
|
-
if (roundId != 0) {
|
|
34
|
-
revert InvalidRoundId();
|
|
35
|
-
}
|
|
36
|
-
_;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
constructor(address _market, uint32 _twapDuration, PendleOracleType _baseOracleType) {
|
|
40
|
-
factory = msg.sender;
|
|
41
|
-
market = _market;
|
|
42
|
-
twapDuration = _twapDuration;
|
|
43
|
-
baseOracleType = _baseOracleType;
|
|
44
|
-
(fromTokenDecimals, toTokenDecimals) = _readDecimals(_market, _baseOracleType);
|
|
45
|
-
getPendlePrice = _getPendlePriceFunc();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// =================================================================
|
|
49
|
-
// CHAINLINK INTERFACE
|
|
50
|
-
// =================================================================
|
|
51
|
-
|
|
52
|
-
function latestRoundData()
|
|
53
|
-
public
|
|
54
|
-
view
|
|
55
|
-
virtual
|
|
56
|
-
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
|
|
57
|
-
|
|
58
|
-
function getRoundData(
|
|
59
|
-
uint80 roundId
|
|
60
|
-
) external view validateRoundId(roundId) returns (uint80, int256, uint256, uint256, uint80) {
|
|
61
|
-
return latestRoundData();
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function decimals() external pure returns (uint8) {
|
|
65
|
-
return 18;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function description() external pure returns (string memory) {
|
|
69
|
-
return "Pendle Chainlink-compatible Oracle";
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function version() external pure returns (uint256) {
|
|
73
|
-
return 1;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// =================================================================
|
|
77
|
-
// PRICING FUNCTIONS
|
|
78
|
-
// =================================================================
|
|
79
|
-
|
|
80
|
-
function _getPendleTokenPrice() internal view returns (int256) {
|
|
81
|
-
return _descalePrice(getPendlePrice(IPMarket(market), twapDuration));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function _descalePrice(uint256 price) internal view returns (int256 unwrappedPrice) {
|
|
85
|
-
return PMath.Int((price * (10 ** fromTokenDecimals)) / (10 ** toTokenDecimals));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// =================================================================
|
|
89
|
-
// USE ONLY AT INITIALIZATION
|
|
90
|
-
// =================================================================
|
|
91
|
-
|
|
92
|
-
function _getPendlePriceFunc() internal view returns (function(IPMarket, uint32) internal view returns (uint256)) {
|
|
93
|
-
if (baseOracleType == PendleOracleType.PT_TO_SY) {
|
|
94
|
-
return PendlePYOracleLib.getPtToSyRate;
|
|
95
|
-
} else if (baseOracleType == PendleOracleType.PT_TO_ASSET) {
|
|
96
|
-
return PendlePYOracleLib.getPtToAssetRate;
|
|
97
|
-
} else if (baseOracleType == PendleOracleType.YT_TO_SY) {
|
|
98
|
-
return PendlePYOracleLib.getYtToSyRate;
|
|
99
|
-
} else if (baseOracleType == PendleOracleType.YT_TO_ASSET) {
|
|
100
|
-
return PendlePYOracleLib.getYtToAssetRate;
|
|
101
|
-
} else if (baseOracleType == PendleOracleType.LP_TO_SY) {
|
|
102
|
-
return PendleLpOracleLib.getLpToSyRate;
|
|
103
|
-
} else if (baseOracleType == PendleOracleType.LP_TO_ASSET) {
|
|
104
|
-
return PendleLpOracleLib.getLpToAssetRate;
|
|
105
|
-
} else {
|
|
106
|
-
revert("not supported");
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function _readDecimals(
|
|
111
|
-
address _market,
|
|
112
|
-
PendleOracleType _oracleType
|
|
113
|
-
) internal view returns (uint8 _fromDecimals, uint8 _toDecimals) {
|
|
114
|
-
(IStandardizedYield SY, , ) = IPMarket(_market).readTokens();
|
|
115
|
-
|
|
116
|
-
uint8 syDecimals = SY.decimals();
|
|
117
|
-
(, , uint8 assetDecimals) = SY.assetInfo();
|
|
118
|
-
|
|
119
|
-
if (_oracleType == PendleOracleType.LP_TO_ASSET) {
|
|
120
|
-
return (LP_DECIMALS, assetDecimals);
|
|
121
|
-
} else if (_oracleType == PendleOracleType.LP_TO_SY) {
|
|
122
|
-
return (LP_DECIMALS, syDecimals);
|
|
123
|
-
} else if (_oracleType == PendleOracleType.PT_TO_ASSET || _oracleType == PendleOracleType.YT_TO_ASSET) {
|
|
124
|
-
return (assetDecimals, assetDecimals);
|
|
125
|
-
} else if (_oracleType == PendleOracleType.PT_TO_SY || _oracleType == PendleOracleType.YT_TO_SY) {
|
|
126
|
-
return (assetDecimals, syDecimals);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "./PendleChainlinkOracle.sol";
|
|
5
|
-
import "./PendleChainlinkOracleWithQuote.sol";
|
|
6
|
-
import "../../../interfaces/IPChainlinkOracleFactory.sol";
|
|
7
|
-
import "../../../interfaces/IPPYLpOracle.sol";
|
|
8
|
-
|
|
9
|
-
contract PendleChainlinkOracleFactory is IPChainlinkOracleFactory {
|
|
10
|
-
error OracleAlreadyExists();
|
|
11
|
-
|
|
12
|
-
error OracleIncreaseCardinalityRequired(uint32 cardinalityRequired);
|
|
13
|
-
error OracleOldestObservationNotSatisfied();
|
|
14
|
-
|
|
15
|
-
// [keccak256(market, duration, baseOracleType)]
|
|
16
|
-
mapping(bytes32 oracleId => address oracleAddr) public oracles;
|
|
17
|
-
|
|
18
|
-
// [keccak256(market, duration, baseOracleType, quoteOracle)]
|
|
19
|
-
mapping(bytes32 oracleId => address oracleAddr) public oraclesWithQuote;
|
|
20
|
-
|
|
21
|
-
address public immutable pyLpOracle;
|
|
22
|
-
|
|
23
|
-
constructor(address _pyLpOracle) {
|
|
24
|
-
pyLpOracle = _pyLpOracle;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function createOracle(
|
|
28
|
-
address market,
|
|
29
|
-
uint32 twapDuration,
|
|
30
|
-
PendleOracleType baseOracleType
|
|
31
|
-
) external returns (address oracle) {
|
|
32
|
-
bytes32 oracleId = _getOracleId(market, twapDuration, baseOracleType);
|
|
33
|
-
if (oracles[oracleId] != address(0)) revert OracleAlreadyExists();
|
|
34
|
-
|
|
35
|
-
_checkOracleState(market, twapDuration);
|
|
36
|
-
|
|
37
|
-
oracle = address(new PendleChainlinkOracle(market, twapDuration, baseOracleType));
|
|
38
|
-
oracles[oracleId] = oracle;
|
|
39
|
-
emit OracleCreated(market, twapDuration, baseOracleType, oracle, oracleId);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/// @dev quoteOracle must has Chainlink-compatible interface
|
|
43
|
-
/**
|
|
44
|
-
* @dev quoteOracle must has Chainlink-compatible interface
|
|
45
|
-
* @dev quoteOracle2 should be address(0) if unused
|
|
46
|
-
*/
|
|
47
|
-
function createOracleWithQuote(
|
|
48
|
-
address market,
|
|
49
|
-
uint32 twapDuration,
|
|
50
|
-
PendleOracleType baseOracleType,
|
|
51
|
-
address quoteOracle1,
|
|
52
|
-
address quoteOracle2
|
|
53
|
-
) external returns (address oracle) {
|
|
54
|
-
bytes32 oracleId = _getOracleWithQuoteId(market, twapDuration, baseOracleType, quoteOracle1, quoteOracle2);
|
|
55
|
-
if (oraclesWithQuote[oracleId] != address(0)) revert OracleAlreadyExists();
|
|
56
|
-
|
|
57
|
-
_checkOracleState(market, twapDuration);
|
|
58
|
-
|
|
59
|
-
oracle = address(
|
|
60
|
-
new PendleChainlinkOracleWithQuote(market, twapDuration, baseOracleType, quoteOracle1, quoteOracle2)
|
|
61
|
-
);
|
|
62
|
-
oraclesWithQuote[oracleId] = oracle;
|
|
63
|
-
emit OracleWithQuoteCreated(market, twapDuration, baseOracleType, quoteOracle1, quoteOracle2, oracle, oracleId);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getOracle(
|
|
67
|
-
address market,
|
|
68
|
-
uint32 twapDuration,
|
|
69
|
-
PendleOracleType baseOracleType
|
|
70
|
-
) public view returns (address) {
|
|
71
|
-
return oracles[_getOracleId(market, twapDuration, baseOracleType)];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function getOracleWithQuote(
|
|
75
|
-
address market,
|
|
76
|
-
uint32 twapDuration,
|
|
77
|
-
PendleOracleType baseOracleType,
|
|
78
|
-
address quoteOracle1,
|
|
79
|
-
address quoteOracle2
|
|
80
|
-
) public view returns (address) {
|
|
81
|
-
return
|
|
82
|
-
oraclesWithQuote[_getOracleWithQuoteId(market, twapDuration, baseOracleType, quoteOracle1, quoteOracle2)];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function _getOracleId(
|
|
86
|
-
address market,
|
|
87
|
-
uint32 twapDuration,
|
|
88
|
-
PendleOracleType baseOracleType
|
|
89
|
-
) internal pure returns (bytes32) {
|
|
90
|
-
return keccak256(abi.encode(market, twapDuration, baseOracleType));
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function _getOracleWithQuoteId(
|
|
94
|
-
address market,
|
|
95
|
-
uint32 twapDuration,
|
|
96
|
-
PendleOracleType baseOracleType,
|
|
97
|
-
address quoteOracle1,
|
|
98
|
-
address quoteOracle2
|
|
99
|
-
) internal pure returns (bytes32) {
|
|
100
|
-
return keccak256(abi.encode(market, twapDuration, baseOracleType, quoteOracle1, quoteOracle2));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function _checkOracleState(address market, uint32 twapDuration) internal view {
|
|
104
|
-
(bool increaseCardinalityRequired, uint32 cardinalityRequired, bool oldestObservationSatisfied) = IPPYLpOracle(
|
|
105
|
-
pyLpOracle
|
|
106
|
-
).getOracleState(market, twapDuration);
|
|
107
|
-
|
|
108
|
-
if (increaseCardinalityRequired) {
|
|
109
|
-
// call IPMarket(market).increaseObservationsCardinalityNext(cardinalityRequired) then wait for twapDuration seconds
|
|
110
|
-
revert OracleIncreaseCardinalityRequired(cardinalityRequired);
|
|
111
|
-
}
|
|
112
|
-
if (!oldestObservationSatisfied) {
|
|
113
|
-
// wait for twapDuration seconds
|
|
114
|
-
revert OracleOldestObservationNotSatisfied();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.17;
|
|
3
|
-
|
|
4
|
-
import "./PendleChainlinkOracleBase.sol";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @dev The round data returned from this contract will follow:
|
|
8
|
-
* - There will be only one round (roundId=0)
|
|
9
|
-
* - startedAt=0, updatedAt=quoteOracle.updatedAt()
|
|
10
|
-
*/
|
|
11
|
-
contract PendleChainlinkOracleWithQuote is PendleChainlinkOracleBase {
|
|
12
|
-
error QuoteOracle1CannotBeZero();
|
|
13
|
-
|
|
14
|
-
// solhint-disable immutable-vars-naming
|
|
15
|
-
address public immutable quoteOracle1;
|
|
16
|
-
address public immutable quoteOracle2;
|
|
17
|
-
int256 public immutable quoteScale1;
|
|
18
|
-
int256 public immutable quoteScale2;
|
|
19
|
-
int256 internal immutable quoteScaleProduct;
|
|
20
|
-
|
|
21
|
-
function() internal view returns (int256, uint256) internal immutable getPriceWithQuote;
|
|
22
|
-
|
|
23
|
-
constructor(
|
|
24
|
-
address _market,
|
|
25
|
-
uint32 _twapDuration,
|
|
26
|
-
PendleOracleType _baseOracleType,
|
|
27
|
-
address _quoteOracle1,
|
|
28
|
-
address _quoteOracle2
|
|
29
|
-
) PendleChainlinkOracleBase(_market, _twapDuration, _baseOracleType) {
|
|
30
|
-
if (_quoteOracle1 == address(0)) revert QuoteOracle1CannotBeZero();
|
|
31
|
-
|
|
32
|
-
quoteOracle1 = _quoteOracle1;
|
|
33
|
-
quoteScale1 = PMath.Int(10 ** AggregatorV3Interface(_quoteOracle1).decimals());
|
|
34
|
-
|
|
35
|
-
quoteOracle2 = _quoteOracle2;
|
|
36
|
-
quoteScale2 = quoteOracle2 == address(0)
|
|
37
|
-
? PMath.Int(1)
|
|
38
|
-
: PMath.Int(10 ** AggregatorV3Interface(_quoteOracle2).decimals());
|
|
39
|
-
|
|
40
|
-
quoteScaleProduct = quoteScale1 * quoteScale2;
|
|
41
|
-
getPriceWithQuote = quoteOracle2 == address(0) ? _getPriceOneQuote : _getPriceTwoQuotes;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @notice The round data returned from this contract will follow:
|
|
46
|
-
* - answer will satisfy 1 natural unit of PendleToken = (answer/1e18) natural unit of quoteToken
|
|
47
|
-
* - In other words, 10**(PendleToken.decimals) = (answer/1e18) * 10**(quoteToken.decimals)
|
|
48
|
-
* @return roundId always 0 for this contract
|
|
49
|
-
* @return answer The answer (in 18 decimals)
|
|
50
|
-
* @return startedAt always 0 for this contract
|
|
51
|
-
* @return updatedAt will be the same as quoteOracle.updatedAt()
|
|
52
|
-
* @return answeredInRound always 0 for this contract
|
|
53
|
-
*/
|
|
54
|
-
function latestRoundData()
|
|
55
|
-
public
|
|
56
|
-
view
|
|
57
|
-
virtual
|
|
58
|
-
override
|
|
59
|
-
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
|
|
60
|
-
{
|
|
61
|
-
(answer, updatedAt) = quoteOracle2 == address(0) ? _getPriceOneQuote() : _getPriceTwoQuotes();
|
|
62
|
-
roundId = 0;
|
|
63
|
-
startedAt = 0;
|
|
64
|
-
answeredInRound = 0;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function _getPriceOneQuote() internal view returns (int256 answer, uint256 updatedAt) {
|
|
68
|
-
(, int256 quoteAnswer1, , uint256 quoteUpdatedAt1, ) = AggregatorV3Interface(quoteOracle1).latestRoundData();
|
|
69
|
-
answer = (_getPendleTokenPrice() * quoteAnswer1) / quoteScale1;
|
|
70
|
-
updatedAt = quoteUpdatedAt1;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _getPriceTwoQuotes() internal view returns (int256 answer, uint256 updatedAt) {
|
|
74
|
-
(, int256 quoteAnswer1, , uint256 quoteUpdatedAt1, ) = AggregatorV3Interface(quoteOracle1).latestRoundData();
|
|
75
|
-
(, int256 quoteAnswer2, , uint256 quoteUpdatedAt2, ) = AggregatorV3Interface(quoteOracle2).latestRoundData();
|
|
76
|
-
|
|
77
|
-
answer = (_getPendleTokenPrice() * quoteAnswer1 * quoteAnswer2) / quoteScaleProduct;
|
|
78
|
-
updatedAt = quoteUpdatedAt1 < quoteUpdatedAt2 ? quoteUpdatedAt1 : quoteUpdatedAt2;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
File without changes
|
|
File without changes
|