@pendle/core-v2 5.2.1-beta-1 → 5.2.2
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/core/StandardizedYield/implementations/Lombard/PendleLBTCBaseSY.sol/PendleLBTCBaseSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Lombard/PendleLBTCBaseSY.sol/PendleLBTCBaseSY.json +1111 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.json +78 -196
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.json +16 -1188
- 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/IPAllEventsV3.sol/IPAllEventsV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.json +122 -0
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.json +91 -0
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.json +262 -0
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.json +96 -0
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.json +13 -0
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +0 -196
- package/build/artifacts/contracts/interfaces/Lombard/ILBTCMinterBase.sol/ILBTCMinterBase.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Lombard/ILBTCMinterBase.sol/ILBTCMinterBase.json +63 -0
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelper.sol/LimitBackendHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelper.sol/LimitBackendHelper.json +2 -2
- 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/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 +2 -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 -198
- 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/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendleLpOracleLib.sol → PtYtLpOracle/PendleLpOracleLib.sol}/PendleLpOracleLib.json +3 -3
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendlePYLpOracle.sol → PtYtLpOracle/PendlePYLpOracle.sol}/PendlePYLpOracle.json +3 -3
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendlePYOracleLib.sol → PtYtLpOracle/PendlePYOracleLib.sol}/PendlePYOracleLib.json +3 -3
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.json +226 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.json +343 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.json +257 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpGlpOracle.sol/BoringLpGlpOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringLpGlpOracle.sol/BoringLpGlpOracle.json +3 -3
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringLpSeller.sol/BoringLpSeller.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.json +3 -3
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.json +3 -3
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPtSeller.sol/BoringPtSeller.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendleBoringOneracle.sol → internal/PendleBoringOneracle.sol}/PendleBoringOneracle.json +3 -3
- package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendleBoringSolvBTCOneracle.sol → internal/PendleBoringSolvBTCOneracle.sol}/PendleBoringSolvBTCOneracle.json +3 -3
- package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendleRedStoneRateOracleAdapter.sol → internal/PendleRedStoneRateOracleAdapter.sol}/PendleRedStoneRateOracleAdapter.json +3 -3
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendleSparkLinearDiscountOracle.sol → internal/PendleSparkLinearDiscountOracle.sol}/PTExpiry.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/{PendleSparkLinearDiscountOracle.sol → internal/PendleSparkLinearDiscountOracle.sol}/PendleSparkLinearDiscountOracle.json +3 -3
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -198
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +80 -198
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -198
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -198
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -198
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -198
- 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/contracts/core/StandardizedYield/implementations/Lombard/PendleLBTCBaseSY.sol +121 -0
- package/contracts/interfaces/IPActionAddRemoveLiqV3.sol +6 -6
- package/contracts/interfaces/IPActionMiscV3.sol +8 -2
- package/contracts/interfaces/IPActionSwapPTV3.sol +4 -4
- package/contracts/interfaces/IPActionSwapYTV3.sol +4 -4
- package/contracts/interfaces/IPAllActionTypeV3.sol +0 -4
- package/contracts/interfaces/IPAllActionV3.sol +1 -3
- package/contracts/interfaces/IPAllEventsV3.sol +1 -44
- package/contracts/interfaces/IPChainlinkOracle.sol +11 -0
- package/contracts/interfaces/IPChainlinkOracleFactory.sol +22 -0
- package/contracts/interfaces/IPChainlinkOracleWithQuote.sol +8 -0
- package/contracts/interfaces/IPLimitRouter.sol +22 -12
- package/contracts/interfaces/IPPYLpOracle.sol +3 -4
- package/contracts/interfaces/Lombard/ILBTCMinterBase.sol +12 -0
- package/contracts/oracles/{PendlePYLpOracle.sol → PtYtLpOracle/PendlePYLpOracle.sol} +2 -2
- package/contracts/oracles/{PendlePYOracleLib.sol → PtYtLpOracle/PendlePYOracleLib.sol} +2 -2
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol +134 -0
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol +121 -0
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol +50 -0
- package/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringLpGlpOracle.sol +3 -3
- package/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringLpSeller.sol +1 -1
- package/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPYUsdChainlinkAssetOracle.sol +3 -3
- package/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPYUsdChainlinkSYOracle.sol +3 -3
- package/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPtSeller.sol +1 -1
- package/contracts/oracles/{PendleBoringOneracle.sol → internal/PendleBoringOneracle.sol} +2 -2
- package/contracts/oracles/{PendleBoringSolvBTCOneracle.sol → internal/PendleBoringSolvBTCOneracle.sol} +2 -2
- package/contracts/oracles/{PendleRedStoneRateOracleAdapter.sol → internal/PendleRedStoneRateOracleAdapter.sol} +3 -3
- package/contracts/router/ActionAddRemoveLiqV3.sol +9 -9
- package/contracts/router/ActionMiscV3.sol +17 -3
- package/contracts/router/ActionSwapPTV3.sol +4 -4
- package/contracts/router/ActionSwapYTV3.sol +4 -4
- package/contracts/router/base/ActionBase.sol +12 -35
- package/contracts/router/base/ActionDelegateBase.sol +1 -1
- package/deployments/1-core.json +1 -1
- package/deployments/1-markets/MORPHO-PWBTC-JUN2025.json +14 -0
- package/deployments/8453-markets/CBETH-BASE-DEC2025.json +14 -0
- package/deployments/8453-markets/LBTC-BASE-MAY2025.json +14 -0
- package/package.json +1 -1
- package/typechain-types/ActionAddRemoveLiqV3.ts +0 -148
- package/typechain-types/ActionMiscV3.ts +44 -148
- package/typechain-types/ActionSimple.ts +0 -148
- package/typechain-types/ActionStorageStatic.ts +0 -148
- package/typechain-types/ActionStorageV4.ts +0 -148
- package/typechain-types/ActionSwapPTV3.ts +0 -148
- package/typechain-types/ActionSwapYTV3.ts +0 -148
- package/typechain-types/ILBTCMinterBase.ts +159 -0
- package/typechain-types/IPActionAddRemoveLiqV3.ts +0 -148
- package/typechain-types/IPActionMiscV3.ts +44 -148
- package/typechain-types/IPActionSimple.ts +0 -148
- package/typechain-types/IPActionStorageStatic.ts +0 -148
- package/typechain-types/IPActionStorageV4.ts +0 -148
- package/typechain-types/IPActionSwapPTV3.ts +0 -148
- package/typechain-types/IPActionSwapYTV3.ts +0 -148
- package/typechain-types/IPAllActionV3.ts +20 -390
- package/typechain-types/IPAllEventsV3.ts +0 -148
- package/typechain-types/IPLimitRouter.ts +36 -0
- package/typechain-types/IPPYLpOracle.ts +21 -0
- package/typechain-types/IPRouterStatic.ts +0 -148
- package/typechain-types/PendleLBTCBaseSY.ts +1470 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -197
- package/typechain-types/factories/ActionCallbackV3__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 +1 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +79 -197
- package/typechain-types/factories/ActionSimple__factory.ts +1 -197
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -197
- package/typechain-types/factories/ActionStorageV4__factory.ts +1 -197
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -197
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -197
- 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/ILBTCMinterBase__factory.ts +78 -0
- package/typechain-types/factories/IPActionAddRemoveLiqV3__factory.ts +0 -196
- package/typechain-types/factories/IPActionMiscV3__factory.ts +78 -196
- package/typechain-types/factories/IPActionSimple__factory.ts +0 -196
- package/typechain-types/factories/IPActionStorageStatic__factory.ts +0 -196
- package/typechain-types/factories/IPActionStorageV4__factory.ts +0 -196
- package/typechain-types/factories/IPActionSwapPTV3__factory.ts +0 -196
- package/typechain-types/factories/IPActionSwapYTV3__factory.ts +0 -196
- package/typechain-types/factories/IPAllActionV3__factory.ts +16 -1188
- package/typechain-types/factories/IPAllEventsV3__factory.ts +0 -196
- package/typechain-types/factories/IPLimitRouter__factory.ts +96 -0
- package/typechain-types/factories/IPPYLpOracle__factory.ts +13 -0
- package/typechain-types/factories/IPRouterStatic__factory.ts +0 -196
- package/typechain-types/factories/LimitBackendHelper__factory.ts +1 -1
- 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 +1 -1
- package/typechain-types/factories/PendleChainlinkOracleWithQuote__factory.ts +1 -49
- package/typechain-types/factories/PendleChainlinkOracle__factory.ts +1 -49
- package/typechain-types/factories/PendleLBTCBaseSY__factory.ts +1164 -0
- package/typechain-types/factories/PendleLimitRouter__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/PendleSparkLinearDiscountOracle__factory.ts +1 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +180 -27
- package/typechain-types/index.ts +18 -8
- package/build/artifacts/contracts/interfaces/IPActionSwapLimitV3.sol/IPActionSwapLimitV3.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPActionSwapLimitV3.sol/IPActionSwapLimitV3.json +0 -2638
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapLimitV3Events.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapLimitV3Events.json +0 -207
- package/build/artifacts/contracts/oracles/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringLpGlpOracle.sol/BoringLpGlpOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +0 -4
- package/build/artifacts/contracts/oracles/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionSwapLimitV3.sol/ActionSwapLimitV3.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionSwapLimitV3.sol/ActionSwapLimitV3.json +0 -2638
- package/contracts/interfaces/IPActionSwapLimitV3.sol +0 -42
- package/contracts/router/ActionSwapLimitV3.sol +0 -126
- /package/contracts/oracles/{PendleLpOracleLib.sol → PtYtLpOracle/PendleLpOracleLib.sol} +0 -0
- /package/contracts/oracles/{PendleSparkLinearDiscountOracle.sol → internal/PendleSparkLinearDiscountOracle.sol} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import "./IPChainlinkOracle.sol";
|
|
5
|
+
|
|
6
|
+
interface IPChainlinkOracleFactory {
|
|
7
|
+
event OracleCreated(
|
|
8
|
+
address indexed market,
|
|
9
|
+
uint32 indexed twapDuration,
|
|
10
|
+
PendleOracleType indexed baseOracleType,
|
|
11
|
+
address oracle,
|
|
12
|
+
bytes32 oracleId
|
|
13
|
+
);
|
|
14
|
+
event OracleWithQuoteCreated(
|
|
15
|
+
address indexed market,
|
|
16
|
+
uint32 indexed twapDuration,
|
|
17
|
+
PendleOracleType indexed baseOracleType,
|
|
18
|
+
address quoteOracle,
|
|
19
|
+
address oracle,
|
|
20
|
+
bytes32 oracleId
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
5
|
+
|
|
6
|
+
interface IPChainlinkOracleWithQuote is AggregatorV2V3Interface {
|
|
7
|
+
function quoteOracle() external view returns (address);
|
|
8
|
+
}
|
|
@@ -60,12 +60,9 @@ struct FillOrderParams {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
interface IPLimitRouterCallback is IPLimitOrderType {
|
|
63
|
-
function limitRouterCallback(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
uint256 totalFee,
|
|
67
|
-
bytes memory data
|
|
68
|
-
) external returns (bytes memory);
|
|
63
|
+
function limitRouterCallback(uint256 actualMaking, uint256 actualTaking, uint256 totalFee, bytes memory data)
|
|
64
|
+
external
|
|
65
|
+
returns (bytes memory);
|
|
69
66
|
}
|
|
70
67
|
|
|
71
68
|
interface IPLimitRouter is IPLimitOrderType {
|
|
@@ -106,18 +103,31 @@ interface IPLimitRouter is IPLimitOrderType {
|
|
|
106
103
|
|
|
107
104
|
function cancelBatch(Order[] calldata orders) external;
|
|
108
105
|
|
|
109
|
-
function orderStatusesRaw(
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
function orderStatusesRaw(bytes32[] memory orderHashes)
|
|
107
|
+
external
|
|
108
|
+
view
|
|
109
|
+
returns (uint256[] memory remainingsRaw, uint256[] memory filledAmounts);
|
|
112
110
|
|
|
113
|
-
function orderStatuses(
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
function orderStatuses(bytes32[] memory orderHashes)
|
|
112
|
+
external
|
|
113
|
+
view
|
|
114
|
+
returns (uint256[] memory remainings, uint256[] memory filledAmounts);
|
|
116
115
|
|
|
117
116
|
function DOMAIN_SEPARATOR() external view returns (bytes32);
|
|
118
117
|
|
|
119
118
|
function simulate(address target, bytes calldata data) external payable;
|
|
120
119
|
|
|
120
|
+
function _checkSig(Order memory order, bytes memory signature)
|
|
121
|
+
external
|
|
122
|
+
view
|
|
123
|
+
returns (
|
|
124
|
+
bytes32,
|
|
125
|
+
/*orderHash*/
|
|
126
|
+
uint256,
|
|
127
|
+
/*remainingMakerAmount*/
|
|
128
|
+
uint256
|
|
129
|
+
); /*filledMakerAmount*/
|
|
130
|
+
|
|
121
131
|
/* --- Deprecated events --- */
|
|
122
132
|
|
|
123
133
|
// deprecate on 7/1/2024, prior to official launch
|
|
@@ -16,11 +16,10 @@ interface IPPYLpOracle {
|
|
|
16
16
|
|
|
17
17
|
function getLpToSyRate(address market, uint32 duration) external view returns (uint256);
|
|
18
18
|
|
|
19
|
-
function getOracleState(
|
|
20
|
-
address market,
|
|
21
|
-
uint32 duration
|
|
22
|
-
)
|
|
19
|
+
function getOracleState(address market, uint32 duration)
|
|
23
20
|
external
|
|
24
21
|
view
|
|
25
22
|
returns (bool increaseCardinalityRequired, uint16 cardinalityRequired, bool oldestObservationSatisfied);
|
|
23
|
+
|
|
24
|
+
function blockCycleNumerator() external view returns (uint16);
|
|
26
25
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
interface ILBTCMinterBase {
|
|
5
|
+
function swapCBBTCToLBTC(uint256 amount) external;
|
|
6
|
+
|
|
7
|
+
function relativeFee() external view returns (uint16);
|
|
8
|
+
|
|
9
|
+
function remainingStake() external view returns (uint256);
|
|
10
|
+
|
|
11
|
+
function stakeLimit() external view returns (uint256);
|
|
12
|
+
}
|
|
@@ -3,8 +3,8 @@ pragma solidity ^0.8.17;
|
|
|
3
3
|
|
|
4
4
|
import "./PendlePYOracleLib.sol";
|
|
5
5
|
import "./PendleLpOracleLib.sol";
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
6
|
+
import "../../interfaces/IPPYLpOracle.sol";
|
|
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
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
4
|
+
import "../../interfaces/IPMarket.sol";
|
|
5
|
+
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.
|
|
@@ -0,0 +1,134 @@
|
|
|
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
|
+
contract PendleChainlinkOracle is IPChainlinkOracle {
|
|
13
|
+
error InvalidRoundId();
|
|
14
|
+
|
|
15
|
+
// solhint-disable immutable-vars-naming
|
|
16
|
+
address public immutable factory;
|
|
17
|
+
|
|
18
|
+
address public immutable market;
|
|
19
|
+
uint32 public immutable twapDuration;
|
|
20
|
+
PendleOracleType public immutable baseOracleType;
|
|
21
|
+
|
|
22
|
+
uint256 public immutable fromTokenScale;
|
|
23
|
+
uint256 public immutable toTokenScale;
|
|
24
|
+
|
|
25
|
+
function(IPMarket, uint32) internal view returns (uint256) private immutable _getRawPendlePrice;
|
|
26
|
+
|
|
27
|
+
modifier roundIdIsZero(uint80 roundId) {
|
|
28
|
+
if (roundId != 0) {
|
|
29
|
+
revert InvalidRoundId();
|
|
30
|
+
}
|
|
31
|
+
_;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
constructor(address _market, uint32 _twapDuration, PendleOracleType _baseOracleType) {
|
|
35
|
+
factory = msg.sender;
|
|
36
|
+
market = _market;
|
|
37
|
+
twapDuration = _twapDuration;
|
|
38
|
+
baseOracleType = _baseOracleType;
|
|
39
|
+
(uint256 fromTokenDecimals, uint256 toTokenDecimals) = _readDecimals(_market, _baseOracleType);
|
|
40
|
+
(fromTokenScale, toTokenScale) = (10 ** fromTokenDecimals, 10 ** toTokenDecimals);
|
|
41
|
+
_getRawPendlePrice = _getRawPendlePriceFunc();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// =================================================================
|
|
45
|
+
// CHAINLINK INTERFACE
|
|
46
|
+
// =================================================================
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @notice The round data returned from this contract will follow:
|
|
50
|
+
* - answer will satisfy 1 natural unit of PendleToken = (answer/1e18) natural unit of OutputToken
|
|
51
|
+
* - In other words, 10**(PendleToken.decimals) = (answer/1e18) * 10**(OutputToken.decimals)
|
|
52
|
+
* @param roundId always 0 for this contract
|
|
53
|
+
* @param answer The answer (in 18 decimals)
|
|
54
|
+
* @param startedAt always 0 for this contract
|
|
55
|
+
* @param updatedAt always block.timestamp for this contract
|
|
56
|
+
* @param answeredInRound always 0 for this contract
|
|
57
|
+
*/
|
|
58
|
+
function latestRoundData()
|
|
59
|
+
public
|
|
60
|
+
view
|
|
61
|
+
virtual
|
|
62
|
+
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
|
|
63
|
+
{
|
|
64
|
+
roundId = 0;
|
|
65
|
+
answer = _getPendleTokenPrice();
|
|
66
|
+
startedAt = 0;
|
|
67
|
+
updatedAt = block.timestamp;
|
|
68
|
+
answeredInRound = 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function getRoundData(
|
|
72
|
+
uint80 roundId
|
|
73
|
+
) external view roundIdIsZero(roundId) returns (uint80, int256, uint256, uint256, uint80) {
|
|
74
|
+
return latestRoundData();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function decimals() external pure returns (uint8) {
|
|
78
|
+
return 18;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function description() external pure returns (string memory) {
|
|
82
|
+
return "Pendle Chainlink-compatible Oracle";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function version() external pure returns (uint256) {
|
|
86
|
+
return 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// =================================================================
|
|
90
|
+
// PRICING FUNCTIONS
|
|
91
|
+
// =================================================================
|
|
92
|
+
|
|
93
|
+
function _getPendleTokenPrice() internal view returns (int256) {
|
|
94
|
+
return _descalePrice(_getRawPendlePrice(IPMarket(market), twapDuration));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function _descalePrice(uint256 price) private view returns (int256 unwrappedPrice) {
|
|
98
|
+
return PMath.Int((price * fromTokenScale) / toTokenScale);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// =================================================================
|
|
102
|
+
// USE ONLY AT INITIALIZATION
|
|
103
|
+
// =================================================================
|
|
104
|
+
|
|
105
|
+
function _getRawPendlePriceFunc()
|
|
106
|
+
internal
|
|
107
|
+
view
|
|
108
|
+
returns (function(IPMarket, uint32) internal view returns (uint256))
|
|
109
|
+
{
|
|
110
|
+
if (baseOracleType == PendleOracleType.PT_TO_SY) {
|
|
111
|
+
return PendlePYOracleLib.getPtToSyRate;
|
|
112
|
+
} else if (baseOracleType == PendleOracleType.PT_TO_ASSET) {
|
|
113
|
+
return PendlePYOracleLib.getPtToAssetRate;
|
|
114
|
+
} else {
|
|
115
|
+
revert("not supported");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function _readDecimals(
|
|
120
|
+
address _market,
|
|
121
|
+
PendleOracleType _oracleType
|
|
122
|
+
) internal view returns (uint8 _fromDecimals, uint8 _toDecimals) {
|
|
123
|
+
(IStandardizedYield SY, , ) = IPMarket(_market).readTokens();
|
|
124
|
+
|
|
125
|
+
uint8 syDecimals = SY.decimals();
|
|
126
|
+
(, , uint8 assetDecimals) = SY.assetInfo();
|
|
127
|
+
|
|
128
|
+
if (_oracleType == PendleOracleType.PT_TO_ASSET) {
|
|
129
|
+
return (assetDecimals, assetDecimals);
|
|
130
|
+
} else if (_oracleType == PendleOracleType.PT_TO_SY) {
|
|
131
|
+
return (assetDecimals, syDecimals);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
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) internal oracles;
|
|
17
|
+
|
|
18
|
+
// [keccak256(market, duration, baseOracleType, quoteOracle)]
|
|
19
|
+
mapping(bytes32 oracleId => address oracleAddr) internal oraclesWithQuote;
|
|
20
|
+
|
|
21
|
+
address public immutable pyLpOracle;
|
|
22
|
+
|
|
23
|
+
constructor(address _pyLpOracle) {
|
|
24
|
+
pyLpOracle = _pyLpOracle;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// =================================================================
|
|
28
|
+
// CREATE ORACLE
|
|
29
|
+
// =================================================================
|
|
30
|
+
|
|
31
|
+
function createOracle(
|
|
32
|
+
address market,
|
|
33
|
+
uint32 twapDuration,
|
|
34
|
+
PendleOracleType baseOracleType
|
|
35
|
+
) external returns (address oracle) {
|
|
36
|
+
bytes32 oracleId = getOracleId(market, twapDuration, baseOracleType);
|
|
37
|
+
if (oracles[oracleId] != address(0)) revert OracleAlreadyExists();
|
|
38
|
+
|
|
39
|
+
checkMarketOracleState(market, twapDuration);
|
|
40
|
+
|
|
41
|
+
oracle = address(new PendleChainlinkOracle(market, twapDuration, baseOracleType));
|
|
42
|
+
oracles[oracleId] = oracle;
|
|
43
|
+
emit OracleCreated(market, twapDuration, baseOracleType, oracle, oracleId);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @dev quoteOracle must has Chainlink-compatible interface
|
|
48
|
+
*/
|
|
49
|
+
function createOracleWithQuote(
|
|
50
|
+
address market,
|
|
51
|
+
uint32 twapDuration,
|
|
52
|
+
PendleOracleType baseOracleType,
|
|
53
|
+
address quoteOracle
|
|
54
|
+
) external returns (address oracle) {
|
|
55
|
+
bytes32 oracleId = getOracleWithQuoteId(market, twapDuration, baseOracleType, quoteOracle);
|
|
56
|
+
if (oraclesWithQuote[oracleId] != address(0)) revert OracleAlreadyExists();
|
|
57
|
+
|
|
58
|
+
checkMarketOracleState(market, twapDuration);
|
|
59
|
+
|
|
60
|
+
oracle = address(new PendleChainlinkOracleWithQuote(market, twapDuration, baseOracleType, quoteOracle));
|
|
61
|
+
oraclesWithQuote[oracleId] = oracle;
|
|
62
|
+
emit OracleWithQuoteCreated(market, twapDuration, baseOracleType, quoteOracle, oracle, oracleId);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// =================================================================
|
|
66
|
+
// GET ORACLE
|
|
67
|
+
// =================================================================
|
|
68
|
+
|
|
69
|
+
function getOracle(
|
|
70
|
+
address market,
|
|
71
|
+
uint32 twapDuration,
|
|
72
|
+
PendleOracleType baseOracleType
|
|
73
|
+
) public view returns (address) {
|
|
74
|
+
return oracles[getOracleId(market, twapDuration, baseOracleType)];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function getOracleWithQuote(
|
|
78
|
+
address market,
|
|
79
|
+
uint32 twapDuration,
|
|
80
|
+
PendleOracleType baseOracleType,
|
|
81
|
+
address quoteOracle
|
|
82
|
+
) public view returns (address) {
|
|
83
|
+
return oraclesWithQuote[getOracleWithQuoteId(market, twapDuration, baseOracleType, quoteOracle)];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function getOracleId(
|
|
87
|
+
address market,
|
|
88
|
+
uint32 twapDuration,
|
|
89
|
+
PendleOracleType baseOracleType
|
|
90
|
+
) public pure returns (bytes32) {
|
|
91
|
+
return keccak256(abi.encode(market, twapDuration, baseOracleType));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function getOracleWithQuoteId(
|
|
95
|
+
address market,
|
|
96
|
+
uint32 twapDuration,
|
|
97
|
+
PendleOracleType baseOracleType,
|
|
98
|
+
address quoteOracle
|
|
99
|
+
) public pure returns (bytes32) {
|
|
100
|
+
return keccak256(abi.encode(market, twapDuration, baseOracleType, quoteOracle));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// =================================================================
|
|
104
|
+
// CHECK ORACLE STATE
|
|
105
|
+
// =================================================================
|
|
106
|
+
|
|
107
|
+
function checkMarketOracleState(address market, uint32 twapDuration) public view {
|
|
108
|
+
(bool increaseCardinalityRequired, uint32 cardinalityRequired, bool oldestObservationSatisfied) = IPPYLpOracle(
|
|
109
|
+
pyLpOracle
|
|
110
|
+
).getOracleState(market, twapDuration);
|
|
111
|
+
|
|
112
|
+
if (increaseCardinalityRequired) {
|
|
113
|
+
// call IPMarket(market).increaseObservationsCardinalityNext(cardinalityRequired) then wait for twapDuration seconds
|
|
114
|
+
revert OracleIncreaseCardinalityRequired(cardinalityRequired);
|
|
115
|
+
}
|
|
116
|
+
if (!oldestObservationSatisfied) {
|
|
117
|
+
// wait for twapDuration seconds
|
|
118
|
+
revert OracleOldestObservationNotSatisfied();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "./PendleChainlinkOracle.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 PendleChainlinkOracle {
|
|
12
|
+
// solhint-disable immutable-vars-naming
|
|
13
|
+
address public immutable quoteOracle;
|
|
14
|
+
int256 public immutable quoteScale;
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
address _market,
|
|
18
|
+
uint32 _twapDuration,
|
|
19
|
+
PendleOracleType _baseOracleType,
|
|
20
|
+
address _quoteOracle
|
|
21
|
+
) PendleChainlinkOracle(_market, _twapDuration, _baseOracleType) {
|
|
22
|
+
quoteOracle = _quoteOracle;
|
|
23
|
+
quoteScale = PMath.Int(10 ** AggregatorV3Interface(_quoteOracle).decimals());
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @notice The round data returned from this contract will follow:
|
|
28
|
+
* - answer will satisfy 1 natural unit of PendleToken = (answer/1e18) natural unit of quoteToken
|
|
29
|
+
* - In other words, 10**(PendleToken.decimals) = (answer/1e18) * 10**(quoteToken.decimals)
|
|
30
|
+
* @return roundId always 0 for this contract
|
|
31
|
+
* @return answer The answer (in 18 decimals)
|
|
32
|
+
* @return startedAt always 0 for this contract
|
|
33
|
+
* @return updatedAt will be the same as quoteOracle.updatedAt()
|
|
34
|
+
* @return answeredInRound always 0 for this contract
|
|
35
|
+
*/
|
|
36
|
+
function latestRoundData()
|
|
37
|
+
public
|
|
38
|
+
view
|
|
39
|
+
override
|
|
40
|
+
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
|
|
41
|
+
{
|
|
42
|
+
(, int256 quoteAnswer, , uint256 quoteUpdatedAt, ) = AggregatorV3Interface(quoteOracle).latestRoundData();
|
|
43
|
+
|
|
44
|
+
roundId = 0;
|
|
45
|
+
answer = (_getPendleTokenPrice() * quoteAnswer) / quoteScale;
|
|
46
|
+
updatedAt = quoteUpdatedAt;
|
|
47
|
+
startedAt = 0;
|
|
48
|
+
answeredInRound = 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../PendleLpOracleLib.sol";
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
5
|
+
import "../../../interfaces/IPPYLpOracle.sol";
|
|
6
|
+
import "../../../interfaces/GMX/IGlpManager.sol";
|
|
7
|
+
import "../../../core/libraries/math/PMath.sol";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @notice The LP/GLP price gotten from the market using the LpOracleLib is multiplied with the USD price of GLP read from
|
package/contracts/oracles/{samples → PtYtLpOracle/samples}/BoringPYUsdChainlinkAssetOracle.sol
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
4
|
+
import "../../../interfaces/IPPYLpOracle.sol";
|
|
5
|
+
import "../../../interfaces/IPMarket.sol";
|
|
6
|
+
import "../../../core/libraries/math/PMath.sol";
|
|
7
7
|
import "../PendleLpOracleLib.sol";
|
|
8
8
|
|
|
9
9
|
import {AggregatorV2V3Interface as IChainlinkAggregator} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
4
|
+
import "../../../interfaces/IPPYLpOracle.sol";
|
|
5
|
+
import "../../../interfaces/IPMarket.sol";
|
|
6
|
+
import "../../../core/libraries/math/PMath.sol";
|
|
7
7
|
import "../PendleLpOracleLib.sol";
|
|
8
8
|
|
|
9
9
|
import {AggregatorV2V3Interface as IChainlinkAggregator} from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
4
|
+
import "../../core/libraries/math/PMath.sol";
|
|
5
|
+
import "../../interfaces/IPExchangeRateOracle.sol";
|
|
6
6
|
|
|
7
7
|
contract PendleBoringOneracle is IPExchangeRateOracle {
|
|
8
8
|
function getExchangeRate() external pure returns (uint256) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
4
|
+
import "../../core/libraries/math/PMath.sol";
|
|
5
|
+
import "../../interfaces/IPExchangeRateOracle.sol";
|
|
6
6
|
|
|
7
7
|
contract PendleBoringSolvBTCOneracle is IPExchangeRateOracle {
|
|
8
8
|
function getExchangeRate() external pure returns (uint256) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
4
|
+
import "../../core/libraries/math/PMath.sol";
|
|
5
|
+
import "../../interfaces/IPExchangeRateOracle.sol";
|
|
6
|
+
import "../../interfaces/IRedstonePriceFeed.sol";
|
|
7
7
|
|
|
8
8
|
contract PendleRedStoneRateOracleAdapter is IPExchangeRateOracle {
|
|
9
9
|
using PMath for int256;
|
|
@@ -88,7 +88,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
88
88
|
uint256 netPtIn,
|
|
89
89
|
uint256 minLpOut,
|
|
90
90
|
ApproxParams calldata guessPtSwapToSy,
|
|
91
|
-
LimitOrderData
|
|
91
|
+
LimitOrderData calldata limit
|
|
92
92
|
) external returns (uint256 netLpOut, uint256 netSyFee) {
|
|
93
93
|
if (canUseOnchainApproximation(guessPtSwapToSy, limit)) {
|
|
94
94
|
return delegateToAddLiquiditySinglePtSimple(receiver, market, netPtIn, minLpOut);
|
|
@@ -140,7 +140,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
140
140
|
uint256 minLpOut,
|
|
141
141
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
142
142
|
TokenInput calldata input,
|
|
143
|
-
LimitOrderData
|
|
143
|
+
LimitOrderData calldata limit
|
|
144
144
|
) external payable returns (uint256 netLpOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
145
145
|
if (canUseOnchainApproximation(guessPtReceivedFromSy, limit)) {
|
|
146
146
|
return delegateToAddLiquiditySingleTokenSimple(receiver, market, minLpOut, input);
|
|
@@ -179,7 +179,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
179
179
|
uint256 netSyIn,
|
|
180
180
|
uint256 minLpOut,
|
|
181
181
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
182
|
-
LimitOrderData
|
|
182
|
+
LimitOrderData calldata limit
|
|
183
183
|
) external returns (uint256 netLpOut, uint256 netSyFee) {
|
|
184
184
|
if (canUseOnchainApproximation(guessPtReceivedFromSy, limit)) {
|
|
185
185
|
return delegateToAddLiquiditySingleSySimple(receiver, market, netSyIn, minLpOut);
|
|
@@ -211,7 +211,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
211
211
|
uint256 netSyIn,
|
|
212
212
|
uint256 minLpOut,
|
|
213
213
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
214
|
-
LimitOrderData
|
|
214
|
+
LimitOrderData calldata limit
|
|
215
215
|
) internal returns (uint256 netLpOut, uint256 netSyFee) {
|
|
216
216
|
uint256 netSyLeft = netSyIn;
|
|
217
217
|
uint256 netPtReceived;
|
|
@@ -397,7 +397,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
397
397
|
uint256 netLpToRemove,
|
|
398
398
|
uint256 minPtOut,
|
|
399
399
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
400
|
-
LimitOrderData
|
|
400
|
+
LimitOrderData calldata limit
|
|
401
401
|
) external returns (uint256 netPtOut, uint256 netSyFee) {
|
|
402
402
|
if (canUseOnchainApproximation(guessPtReceivedFromSy, limit)) {
|
|
403
403
|
return delegateToRemoveLiquiditySinglePtSimple(receiver, market, netLpToRemove, minPtOut);
|
|
@@ -439,7 +439,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
439
439
|
address market,
|
|
440
440
|
uint256 netLpToRemove,
|
|
441
441
|
TokenOutput calldata output,
|
|
442
|
-
LimitOrderData
|
|
442
|
+
LimitOrderData calldata limit
|
|
443
443
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
444
444
|
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
445
445
|
|
|
@@ -466,7 +466,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
466
466
|
address market,
|
|
467
467
|
uint256 netLpToRemove,
|
|
468
468
|
uint256 minSyOut,
|
|
469
|
-
LimitOrderData
|
|
469
|
+
LimitOrderData calldata limit
|
|
470
470
|
) external returns (uint256 netSyOut, uint256 netSyFee) {
|
|
471
471
|
_transferFrom(IERC20(market), msg.sender, market, netLpToRemove);
|
|
472
472
|
|
|
@@ -481,7 +481,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
481
481
|
address market,
|
|
482
482
|
uint256 netLpToRemove,
|
|
483
483
|
uint256 minSyOut,
|
|
484
|
-
LimitOrderData
|
|
484
|
+
LimitOrderData calldata limit
|
|
485
485
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
486
486
|
if (IPMarket(market).isExpired()) {
|
|
487
487
|
netSyOut = __removeLpToSyAfterExpiry(receiver, market, netLpToRemove);
|
|
@@ -505,7 +505,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
505
505
|
address receiver,
|
|
506
506
|
address market,
|
|
507
507
|
uint256 netLpToRemove,
|
|
508
|
-
LimitOrderData
|
|
508
|
+
LimitOrderData calldata limit
|
|
509
509
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
510
510
|
uint256 netPtLeft;
|
|
511
511
|
|