@pendle/core-v2 6.11.0 → 6.12.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.
Files changed (445) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol/PendleGaugeControllerUpg.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
  10. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  12. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  14. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  16. package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/sPendle/StakedPendle.sol/StakedPendle.dbg.json +1 -1
  18. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  19. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  20. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  21. package/build/artifacts/contracts/core/Market/PendleMarketFactoryV7Upg.sol/PendleMarketFactoryV7Upg.dbg.json +1 -1
  22. package/build/artifacts/contracts/core/Market/PendleMarketV7.sol/PendleMarketV7.dbg.json +1 -1
  23. package/build/artifacts/contracts/core/Market/PendleMarketV7.sol/PendleMarketV7.json +2 -2
  24. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  25. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  26. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
  27. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
  28. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  29. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  30. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.json +2 -2
  32. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
  34. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  36. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
  37. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableV2.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.dbg.json +1 -1
  48. package/build/artifacts/contracts/cross-chain/FixedPricePTAMMV2.sol/FixedPricePTAMMV2.dbg.json +1 -1
  49. package/build/artifacts/contracts/cross-chain/OFTPTSwapper.sol/OFTPTSwapper.dbg.json +1 -1
  50. package/build/artifacts/contracts/cross-chain/OFTPTSwapper.sol/OFTPTSwapper.json +2 -2
  51. package/build/artifacts/contracts/cross-chain/deposit-box/DepositBox.sol/DepositBox.dbg.json +1 -1
  52. package/build/artifacts/contracts/cross-chain/deposit-box/DepositBoxFactory.sol/DepositBoxFactory.dbg.json +1 -1
  53. package/build/artifacts/contracts/cross-chain/funder/BridgeFunder.sol/BridgeFunder.dbg.json +1 -1
  54. package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol/OFTAdapterAltImpl.dbg.json +1 -1
  55. package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.dbg.json +1 -1
  56. package/build/artifacts/contracts/cross-chain/oftImpl/pendleOft/PendleOFT.sol/PendleOFT.dbg.json +1 -1
  57. package/build/artifacts/contracts/cross-chain/oftImpl/pendleOft/PendleOFTAlt.sol/PendleOFTAlt.dbg.json +1 -1
  58. package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.dbg.json +1 -1
  59. package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol/PendleBridgedPrincipalTokenAlt.dbg.json +1 -1
  60. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +1 -1
  61. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +1 -1
  62. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  63. package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
  64. package/build/artifacts/contracts/interfaces/ILPWrapper.sol/ILPWrapper.dbg.json +1 -1
  65. package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
  66. package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
  67. package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +1 -1
  68. package/build/artifacts/contracts/interfaces/IMoneyMarket.sol/IMoneyMarket.dbg.json +1 -1
  69. package/build/artifacts/contracts/interfaces/IMoneyMarket.sol/IMoneyMarketEvents.dbg.json +1 -1
  70. package/build/artifacts/contracts/interfaces/IMoneyMarketView.sol/IMoneyMarketView.dbg.json +1 -1
  71. package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.json +13 -0
  73. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  77. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  79. package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
  81. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPBridgeDataVerifier.sol/IPBridgeDataVerifier.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPBridgeFunder.sol/IPBridgeFunder.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPBridgePTFactory.sol/IPBridgePTFactory.dbg.json +1 -1
  96. package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
  99. package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.json +6 -172
  103. package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
  104. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPDepositBoxFactory.sol/IPDepositBoxFactory.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
  108. package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  110. package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMSwapCallback.dbg.json +1 -1
  112. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMV2.dbg.json +1 -1
  113. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  114. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  115. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
  116. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  117. package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
  119. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
  121. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
  122. package/build/artifacts/contracts/interfaces/IPLoopPositionBox.sol/IPLoopPositionBox.dbg.json +1 -1
  123. package/build/artifacts/contracts/interfaces/IPLoopPositionBox.sol/IPLoopPositionBox.json +13 -8
  124. package/build/artifacts/contracts/interfaces/IPLoopPositionBoxFactory.sol/IPLoopPositionBoxFactory.dbg.json +1 -1
  125. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  126. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  127. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  128. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
  129. package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
  130. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  131. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  132. package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
  133. package/build/artifacts/contracts/interfaces/IPOFTPTSwapper.sol/IPOFTPTSwapper.dbg.json +1 -1
  134. package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
  135. package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
  136. package/build/artifacts/contracts/interfaces/IPPTLooper.sol/IPPTLooper.dbg.json +1 -1
  137. package/build/artifacts/contracts/interfaces/IPPTLooper.sol/IPPTLooper.json +215 -102
  138. package/build/artifacts/contracts/interfaces/IPPTLooper.sol/IPPTLooperEIP712Types.dbg.json +1 -1
  139. package/build/artifacts/contracts/interfaces/IPPTLooperView.sol/IPPTLooperView.dbg.json +1 -1
  140. package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
  141. package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
  142. package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
  143. package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
  144. package/build/artifacts/contracts/interfaces/IPPostPtLoopStateChecker.sol/IPPostPtLoopStateChecker.dbg.json +1 -1
  145. package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
  146. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  147. package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
  148. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  149. package/build/artifacts/contracts/interfaces/IPStakedPendle.sol/IPStakedPendle.dbg.json +1 -1
  150. package/build/artifacts/contracts/interfaces/IPStaticQuoter.sol/IPStaticQuoter.dbg.json +1 -1
  151. package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
  152. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  153. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  154. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  155. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  156. package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
  157. package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
  158. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  159. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  160. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  161. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  162. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
  163. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
  164. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
  165. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
  166. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
  167. package/build/artifacts/contracts/limit/helpers/MintSyHelper.sol/MintSyHelper.dbg.json +1 -1
  168. package/build/artifacts/contracts/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
  169. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
  170. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
  171. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
  172. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
  173. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
  174. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
  175. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/ILegacyMarket.dbg.json +1 -1
  176. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  177. package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
  178. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
  179. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
  180. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.json +2 -2
  181. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
  182. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
  183. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
  184. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.json +2 -2
  185. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +1 -1
  186. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +2 -2
  187. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
  188. package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.dbg.json +1 -1
  189. package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
  190. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
  191. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.json +2 -2
  192. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
  193. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
  194. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
  195. package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.dbg.json +1 -1
  196. package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
  197. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
  198. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
  199. package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
  200. package/build/artifacts/contracts/offchain-helpers/PendleProxyAdmin.sol/PendleProxyAdmin.dbg.json +1 -1
  201. package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
  202. package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
  203. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
  204. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
  205. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
  206. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +6 -547
  207. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
  208. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.json +2 -2
  209. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
  210. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
  211. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
  212. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.json +2 -2
  213. package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
  214. package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
  215. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  216. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
  217. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  218. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
  219. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  220. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
  221. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  222. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
  223. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  224. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
  225. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  226. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
  227. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  228. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
  229. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
  230. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.json +2 -2
  231. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
  232. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.json +2 -2
  233. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  234. package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +1 -1
  235. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
  236. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
  237. package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
  238. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  239. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
  240. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
  241. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
  242. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
  243. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
  244. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  245. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
  246. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
  247. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  248. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleLinearDiscountOracleWrapper.sol/PendleLinearDiscountOracleWrapper.dbg.json +1 -1
  249. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
  250. package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
  251. package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
  252. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
  253. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
  254. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
  255. package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
  256. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
  257. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
  258. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
  259. package/build/artifacts/contracts/pt-looping/BridgeDataVerifier.sol/BridgeDataVerifier.dbg.json +1 -1
  260. package/build/artifacts/contracts/pt-looping/PTLooperBase.sol/PTLooperBase.dbg.json +1 -1
  261. package/build/artifacts/contracts/pt-looping/PTLooperBase.sol/PTLooperBase.json +213 -100
  262. package/build/artifacts/contracts/pt-looping/PTLooperEIP712TypesEncodeDataLib.sol/PTLooperEIP712TypesEncodeDataLib.dbg.json +1 -1
  263. package/build/artifacts/contracts/pt-looping/PTLooperEIP712TypesEncodeDataLib.sol/PTLooperEIP712TypesEncodeDataLib.json +2 -2
  264. package/build/artifacts/contracts/pt-looping/PendlePTLooper.sol/PendlePTLooper.dbg.json +1 -1
  265. package/build/artifacts/contracts/pt-looping/PendlePTLooper.sol/PendlePTLooper.json +215 -102
  266. package/build/artifacts/contracts/pt-looping/PendlePTLooperView.sol/PendlePTLooperView.dbg.json +1 -1
  267. package/build/artifacts/contracts/pt-looping/PendlePTLooperView.sol/PendlePTLooperView.json +2 -2
  268. package/build/artifacts/contracts/pt-looping/PostPtLoopStateChecker.sol/PostPtLoopStateChecker.dbg.json +1 -1
  269. package/build/artifacts/contracts/pt-looping/PostPtLoopStateChecker.sol/PostPtLoopStateChecker.json +2 -2
  270. package/build/artifacts/contracts/pt-looping/StaticStableQuoter.sol/StaticStableQuoter.dbg.json +1 -1
  271. package/build/artifacts/contracts/pt-looping/loop-position-box/LoopPositionBox.sol/LoopPositionBox.dbg.json +1 -1
  272. package/build/artifacts/contracts/pt-looping/loop-position-box/LoopPositionBox.sol/LoopPositionBox.json +15 -10
  273. package/build/artifacts/contracts/pt-looping/loop-position-box/LoopPositionBoxFactory.sol/LoopPositionBoxFactory.dbg.json +1 -1
  274. package/build/artifacts/contracts/pt-looping/loop-position-box/LoopPositionBoxFactory.sol/LoopPositionBoxFactory.json +2 -2
  275. package/build/artifacts/contracts/pt-looping/money-market/BaseMoneyMarket.sol/BaseMoneyMarket.dbg.json +1 -1
  276. package/build/artifacts/contracts/pt-looping/money-market/BaseMoneyMarketView.sol/BaseMoneyMarketView.dbg.json +1 -1
  277. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/AaveMMPayloadLib.sol/AaveMMPayloadLib.dbg.json +1 -1
  278. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/AaveMMPayloadLib.sol/AaveMMPayloadLib.json +2 -2
  279. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/AaveMoneyMarket.sol/AaveMoneyMarket.dbg.json +1 -1
  280. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/AaveMoneyMarket.sol/AaveMoneyMarket.json +2 -2
  281. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/AaveMoneyMarketView.sol/AaveMoneyMarketView.dbg.json +1 -1
  282. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/AaveMoneyMarketView.sol/AaveMoneyMarketView.json +2 -2
  283. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/AaveDataTypes.sol/AaveDataTypes.dbg.json +1 -1
  284. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IAToken.sol/IAToken.dbg.json +1 -1
  285. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IAaveOracle.sol/IAaveOracle.dbg.json +1 -1
  286. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
  287. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IPool.sol/IPool.dbg.json +1 -1
  288. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IPool.sol/IPool.json +38 -0
  289. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IPoolAddressesProvider.sol/IPoolAddressesProvider.dbg.json +1 -1
  290. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IPoolDataProviderV3.sol/IPoolDataProviderV3.dbg.json +1 -1
  291. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave/dependencies/IPriceOracleGetter.sol/IPriceOracleGetter.dbg.json +1 -1
  292. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/AaveV4MMPayloadLib.sol/AaveV4MMPayloadLib.dbg.json +1 -1
  293. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/AaveV4MoneyMarket.sol/AaveV4MoneyMarket.dbg.json +1 -1
  294. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/AaveV4MoneyMarket.sol/AaveV4MoneyMarket.json +2 -2
  295. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/AaveV4MoneyMarketView.sol/AaveV4MoneyMarketView.dbg.json +1 -1
  296. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/AaveV4MoneyMarketView.sol/AaveV4MoneyMarketView.json +2 -2
  297. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/dependencies/IAaveOracle.sol/IAaveOracle.dbg.json +1 -1
  298. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/dependencies/IHubBase.sol/IHubBase.dbg.json +1 -1
  299. package/build/artifacts/contracts/pt-looping/money-market/implementations/aave-v4/dependencies/ISpoke.sol/ISpoke.dbg.json +1 -1
  300. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/EulerMMPayloadLib.sol/EulerMMPayloadLib.dbg.json +1 -1
  301. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/EulerMoneyMarket.sol/EulerMoneyMarket.dbg.json +1 -1
  302. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/EulerMoneyMarket.sol/EulerMoneyMarket.json +2 -2
  303. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/EulerMoneyMarketView.sol/EulerMoneyMarketView.dbg.json +1 -1
  304. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/EulerMoneyMarketView.sol/EulerMoneyMarketView.json +2 -2
  305. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/dependencies/IEthereumVaultConnector.sol/IEVC.dbg.json +1 -1
  306. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/dependencies/IEulerFactory.sol/IEulerFactory.dbg.json +1 -1
  307. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/dependencies/IEulerPriceOracle.sol/IEulerPriceOracle.dbg.json +1 -1
  308. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/dependencies/IEulerVault.sol/AmountCapLib.dbg.json +1 -1
  309. package/build/artifacts/contracts/pt-looping/money-market/implementations/euler/dependencies/IEulerVault.sol/IEulerVault.dbg.json +1 -1
  310. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/MorphoBlueMoneyMarket.sol/MorphoBlueMoneyMarket.dbg.json +1 -1
  311. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/MorphoBlueMoneyMarket.sol/MorphoBlueMoneyMarket.json +2 -2
  312. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/MorphoBlueMoneyMarketView.sol/MorphoBlueMoneyMarketView.dbg.json +1 -1
  313. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/MorphoBlueMoneyMarketView.sol/MorphoBlueMoneyMarketView.json +2 -2
  314. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/dependencies/IMorpho.sol/IIrm.dbg.json +1 -1
  315. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/dependencies/IMorpho.sol/IMorpho.dbg.json +1 -1
  316. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/dependencies/IMorphoOracle.sol/IMorphoOracle.dbg.json +1 -1
  317. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/dependencies/MathLib.sol/MathLib.dbg.json +1 -1
  318. package/build/artifacts/contracts/pt-looping/money-market/implementations/morpho/dependencies/SharesMathLib.sol/SharesMathLib.dbg.json +1 -1
  319. package/build/artifacts/contracts/pt-looping/vendor/bungee/IBungeeInbox.sol/IBungeeSORInbox.dbg.json +1 -1
  320. package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
  321. package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
  322. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
  323. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
  324. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
  325. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
  326. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
  327. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
  328. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
  329. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
  330. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
  331. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
  332. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
  333. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
  334. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
  335. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
  336. package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
  337. package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
  338. package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +1 -1
  339. package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
  340. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
  341. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
  342. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  343. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
  344. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
  345. package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
  346. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
  347. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
  348. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
  349. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
  350. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
  351. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json +2 -2
  352. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
  353. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json +2 -2
  354. package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
  355. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
  356. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
  357. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
  358. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -1
  359. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
  360. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  361. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +2 -2
  362. package/contracts/core/libraries/ArrayLib.sol +6 -0
  363. package/contracts/interfaces/IOwnable.sol +1 -0
  364. package/contracts/interfaces/IPCommonPoolDeployHelperV2.sol +3 -17
  365. package/contracts/interfaces/IPLoopPositionBox.sol +12 -2
  366. package/contracts/interfaces/IPPTLooper.sol +37 -6
  367. package/contracts/limit/LimitRouterBase.sol +0 -2
  368. package/contracts/offchain-helpers/PendleFeeSetter.sol +5 -6
  369. package/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol +4 -75
  370. package/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol +8 -2
  371. package/contracts/pt-looping/PTLooperBase.sol +13 -1
  372. package/contracts/pt-looping/PTLooperEIP712TypesEncodeDataLib.sol +4 -3
  373. package/contracts/pt-looping/PendlePTLooper.sol +77 -29
  374. package/contracts/pt-looping/loop-position-box/LoopPositionBox.sol +20 -14
  375. package/contracts/pt-looping/money-market/implementations/aave/AaveMMPayloadLib.sol +1 -5
  376. package/contracts/pt-looping/money-market/implementations/aave/AaveMoneyMarket.sol +24 -8
  377. package/contracts/pt-looping/money-market/implementations/aave/AaveMoneyMarketView.sol +1 -1
  378. package/contracts/pt-looping/money-market/implementations/aave/dependencies/IPool.sol +16 -7
  379. package/contracts/router/swap-aggregator/IPSwapAggregator.sol +2 -2
  380. package/contracts/router/swap-aggregator/PendleSwap.sol +27 -47
  381. package/package.json +1 -1
  382. package/typechain-types/IOwnable.ts +21 -0
  383. package/typechain-types/IPCommonPoolDeployHelperV2.ts +21 -145
  384. package/typechain-types/IPLoopPositionBox.ts +23 -20
  385. package/typechain-types/IPPTLooper.ts +196 -67
  386. package/typechain-types/IPool.ts +62 -0
  387. package/typechain-types/LoopPositionBox.ts +23 -20
  388. package/typechain-types/PTLooperBase.ts +196 -67
  389. package/typechain-types/PendleCommonPoolDeployHelperV2.ts +15 -498
  390. package/typechain-types/PendlePTLooper.ts +196 -67
  391. package/typechain-types/factories/AaveMoneyMarketView__factory.ts +1 -1
  392. package/typechain-types/factories/AaveMoneyMarket__factory.ts +1 -1
  393. package/typechain-types/factories/AaveV4MoneyMarketView__factory.ts +1 -1
  394. package/typechain-types/factories/AaveV4MoneyMarket__factory.ts +1 -1
  395. package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
  396. package/typechain-types/factories/ActionCallbackV3__factory.ts +1 -1
  397. package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
  398. package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
  399. package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
  400. package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
  401. package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
  402. package/typechain-types/factories/ActionSimple__factory.ts +1 -1
  403. package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
  404. package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
  405. package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
  406. package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
  407. package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
  408. package/typechain-types/factories/EulerMoneyMarketView__factory.ts +1 -1
  409. package/typechain-types/factories/EulerMoneyMarket__factory.ts +1 -1
  410. package/typechain-types/factories/ExpiredLpPtRedeemer__factory.ts +1 -1
  411. package/typechain-types/factories/IOwnable__factory.ts +13 -0
  412. package/typechain-types/factories/IPCommonPoolDeployHelperV2__factory.ts +6 -172
  413. package/typechain-types/factories/IPLoopPositionBox__factory.ts +13 -8
  414. package/typechain-types/factories/IPPTLooper__factory.ts +215 -102
  415. package/typechain-types/factories/IPool__factory.ts +38 -0
  416. package/typechain-types/factories/LimitBackendHelperV2__factory.ts +1 -1
  417. package/typechain-types/factories/LoopPositionBoxFactory__factory.ts +1 -1
  418. package/typechain-types/factories/LoopPositionBox__factory.ts +14 -9
  419. package/typechain-types/factories/MarketSweed__factory.ts +1 -1
  420. package/typechain-types/factories/MorphoBlueMoneyMarketView__factory.ts +1 -1
  421. package/typechain-types/factories/MorphoBlueMoneyMarket__factory.ts +1 -1
  422. package/typechain-types/factories/OFTPTSwapper__factory.ts +1 -1
  423. package/typechain-types/factories/PTLooperBase__factory.ts +213 -100
  424. package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +5 -546
  425. package/typechain-types/factories/PendleCommonSYFactory__factory.ts +1 -1
  426. package/typechain-types/factories/PendleFeeSetter__factory.ts +1 -1
  427. package/typechain-types/factories/PendleLimitRouter__factory.ts +1 -1
  428. package/typechain-types/factories/PendleMarketV7__factory.ts +1 -1
  429. package/typechain-types/factories/PendlePTLooperView__factory.ts +1 -1
  430. package/typechain-types/factories/PendlePTLooper__factory.ts +214 -101
  431. package/typechain-types/factories/PendlePoolDeployHelperV2__factory.ts +1 -1
  432. package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
  433. package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
  434. package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
  435. package/typechain-types/factories/PendleSwap__factory.ts +1 -1
  436. package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +1 -1
  437. package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
  438. package/typechain-types/factories/PostPtLoopStateChecker__factory.ts +1 -1
  439. package/typechain-types/factories/Reflector__factory.ts +1 -1
  440. package/typechain-types/hardhat.d.ts +0 -9
  441. package/typechain-types/index.ts +0 -2
  442. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +0 -4
  443. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.json +0 -82
  444. package/typechain-types/IOdosRouterV2.ts +0 -147
  445. package/typechain-types/factories/IOdosRouterV2__factory.ts +0 -94
@@ -77,12 +77,17 @@ interface IPPTLooperEIP712Types {
77
77
  RequestHeader header;
78
78
  uint256 minPtToDebtSwapRate;
79
79
  uint256 postWithdrawMaxLTV;
80
+ /// @notice Hub-only. If true, YT held by the box is approved alongside PT so the router can redeem
81
+ /// PT + YT -> SY -> Token instead of swapping PT. YT must be consumed 1:1 with PT.
82
+ /// Amount redeemed is min(PT, YT) held by the box; any PT above the YT balance stays in
83
+ /// the box. The owner transfers YT in beforehand (the looper never acquires YT itself).
84
+ bool redeemWithPY;
80
85
  }
81
86
 
82
87
  struct DecreasePositionMessage {
83
88
  BoxPermit permit;
84
89
  // Hub-only: swap PT→debtToken.
85
- /// @notice Set extRouter to address(0) to disable swapping.
90
+ /// @notice Set extRouter to address(0) to disable swapping. See `DecreasePositionRequest.redeemWithPY`.
86
91
  BoxApprovedCall swap;
87
92
  // Cross-chain only: hub bridges debt to spoke; spoke bridges PT back to hub.
88
93
  BridgeData bridge;
@@ -132,11 +137,19 @@ interface IPPTLooper is IPPTLooperEIP712Types {
132
137
  uint32 sessionNonce;
133
138
  }
134
139
 
140
+ enum RequestStatus {
141
+ DEFAULT,
142
+ PRE_APPROVED
143
+ /* CANCELLED */
144
+ }
145
+
135
146
  /// @notice Emitted on the first iteration call of a session, when the implicit init branch
136
147
  /// runs (owner signature verified, `userReq.requestHash` set). `sessionNonce` is the
137
148
  /// pre-increment value the session was opened with.
138
149
  event SessionInitiated(address indexed owner, bytes32 indexed boxId, bytes32 requestHash, uint32 sessionNonce);
139
150
 
151
+ event RequestPreApproved(address indexed owner, bytes32 requestHash);
152
+
140
153
  /// @notice Emitted by `terminateSession`. `sessionNonce` is the post-increment value that
141
154
  /// the next user request must match.
142
155
  event SessionTerminated(address indexed owner, bytes32 indexed boxId, bytes32 requestHash, uint32 sessionNonce);
@@ -153,6 +166,14 @@ interface IPPTLooper is IPPTLooperEIP712Types {
153
166
  uint256 netSwappedOut
154
167
  );
155
168
 
169
+ event PYRedeemed(
170
+ IPLoopPositionBox indexed box,
171
+ address indexed pt,
172
+ uint256 netPyIn,
173
+ address indexed tokenOut,
174
+ uint256 netSwappedOut
175
+ );
176
+
156
177
  event TokenBridged(IPLoopPositionBox indexed box, address indexed token, uint256 amount);
157
178
 
158
179
  event MoneyMarketLentThenBorrowed(IPLoopPositionBox indexed box, uint256 ptLent, uint256 debtBorrowed);
@@ -216,6 +237,8 @@ interface IPPTLooper is IPPTLooperEIP712Types {
216
237
 
217
238
  function userRequest(address owner, bytes32 boxId) external view returns (UserRequestInfo memory);
218
239
 
240
+ function requestStatus(address owner, bytes32 requestHash) external view returns (RequestStatus);
241
+
219
242
  // ========== Hash functions (exposed for off-chain typed-data tooling) ==========
220
243
 
221
244
  function hashRaw(BoxPermit memory permit) external pure returns (bytes32);
@@ -256,28 +279,36 @@ interface IPPTLooper is IPPTLooperEIP712Types {
256
279
 
257
280
  /// @notice One increase iteration. The first call for a `(owner, boxId)` slot also opens
258
281
  /// the session — pass the owner's typed-data signature over `req` in
259
- /// `ownerSigIfFirstCall`. Subsequent iterations within the same session can pass
260
- /// empty bytes for that arg (it is ignored once the session is open).
282
+ /// `ownerSigIfFirstCall` (if not pre-approved).
283
+ /// @notice `ownerSigIfFirstCall` can be passed as empty bytes:
284
+ /// - at subsequent iterations within the same session (it is ignored once the session is open).
285
+ /// - when the request is pre-approved (see `preApproveRequest`).
261
286
  function increaseLoopPosition(
262
287
  IncreasePositionMessage memory ms,
263
288
  bytes memory proposerSig,
264
289
  IncreasePositionRequest memory req,
265
290
  bytes memory ownerSigIfFirstCall
266
- ) external payable;
291
+ ) external;
267
292
 
268
293
  function decreaseLoopPosition(
269
294
  DecreasePositionMessage memory ms,
270
295
  bytes memory proposerSig,
271
296
  DecreasePositionRequest memory req,
272
297
  bytes memory ownerSigIfFirstCall
273
- ) external payable;
298
+ ) external;
274
299
 
275
300
  function swapBridgeWithdrawAll(
276
301
  SwapBridgeWithdrawAllMessage memory ms,
277
302
  bytes memory proposerSig,
278
303
  SwapBridgeWithdrawAllRequest memory req,
279
304
  bytes memory ownerSigIfFirstCall
280
- ) external payable;
305
+ ) external;
306
+
307
+ /// @notice `msg.sender` call this function to approve a request instead of
308
+ /// signing it with `ownerSigIfFirstCall`.
309
+ /// The proposer signs the request hash.
310
+ /// `ownerSigIfFirstCall` can then be left empty when a session is created.
311
+ function preApproveRequest(bytes32 requestHash, bytes memory proposerSig) external;
281
312
 
282
313
  /// @notice Closes the open session at `(owner, boxId)`. `requestHash` must equal the
283
314
  /// currently-stored `userReq.requestHash` (proves the caller identifies which
@@ -28,7 +28,6 @@ abstract contract LimitRouterBase is
28
28
 
29
29
  uint128 internal constant _ORDER_DOES_NOT_EXIST = 0;
30
30
  uint128 internal constant _ORDER_FILLED = 1;
31
- uint256 internal constant MAX_LN_FEE_RATE_ROOT = 48_790_164_169_432_003; // ln(1.05)
32
31
 
33
32
  address public feeRecipient;
34
33
 
@@ -519,7 +518,6 @@ abstract contract LimitRouterBase is
519
518
 
520
519
  for (uint256 i = 0; i < len; i++) {
521
520
  require(lnFeeRateRoots[i] > 0 || allowZeroFees, "LOP: zero fee must be allowed explicitly");
522
- require(lnFeeRateRoots[i] <= MAX_LN_FEE_RATE_ROOT, "LOP: fee too high");
523
521
 
524
522
  __lnFeeRateRoot[YTs[i]] = lnFeeRateRoots[i];
525
523
  }
@@ -9,13 +9,11 @@ import {IPYieldToken} from "../interfaces/IPYieldToken.sol";
9
9
 
10
10
  import {BoringOwnableUpgradeableV2} from "../core/libraries/BoringOwnableUpgradeableV2.sol";
11
11
  import {Errors} from "../core/libraries/Errors.sol";
12
- import {LogExpMath} from "../core/libraries/math/LogExpMath.sol";
13
12
  import {PMath} from "../core/libraries/math/PMath.sol";
14
13
 
15
14
  contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
16
15
  using PMath for uint256;
17
16
  using PMath for int256;
18
- using LogExpMath for int256;
19
17
 
20
18
  event FeeFactorSet(uint128 impliedRateToFeeFactor, uint128 routerLnFeeToLimitLnFeeFactor);
21
19
  event SetterSet(address indexed setter);
@@ -106,13 +104,14 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
106
104
  {
107
105
  uint256 marketLnFee = IPMarket(market).getNonOverrideLnFeeRateRoot();
108
106
  MarketState memory state = IPMarket(market).readState(router);
109
- uint256 impliedRate = state.lastLnImpliedRate.Int().exp().Uint();
110
107
 
111
- uint256 newFee = (impliedRate - PMath.ONE).mulDown(_impliedRateToFeeFactor) + PMath.ONE;
112
- uint256 newLnFeeRateRoot = newFee.Int().ln().Uint();
108
+ // Fee root scales the ln implied rate, so fee / yield = (e^{phi*t} - 1) / (e^{r*t} - 1), which is at most
109
+ // `factor` and converges to `factor` as expiry approaches. Scaling the annual APY instead
110
+ // (ln(1 + factor * APY)) overcharges for t < 1 year and blows up at high rates (15000% -> 300% fee root).
111
+ uint256 newLnFeeRateRoot = state.lastLnImpliedRate.mulDown(_impliedRateToFeeFactor);
113
112
 
114
113
  routerLnFeeRateRoot = marketLnFee.min(newLnFeeRateRoot);
115
- limitLnFeeRateRoot = LIMIT_MAX_LN_FEE_RATE_ROOT.min(routerLnFeeRateRoot.mulDown(_routerLnFeeToLimitLnFeeFactor));
114
+ limitLnFeeRateRoot = newLnFeeRateRoot.mulDown(_routerLnFeeToLimitLnFeeFactor);
116
115
 
117
116
  // Fix up `routerLnFeeRateRoot` for this case:
118
117
  // https://github.com/pendle-finance/pendle-core-v2/blob/6169376d0a8c12030307e3d64d02e84b07ffe4f9/contracts/core/Market/v3/PendleMarketFactoryV3.sol#L131-L135
@@ -7,15 +7,6 @@ import "../../interfaces/IPCommonSYFactory.sol";
7
7
  import "./PendlePoolDeployHelperV2.sol";
8
8
 
9
9
  contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnableUpgradeableV2 {
10
- bytes32 public constant ERC4626_DEPLOY_ID = keccak256("PendleERC4626SYV2"); // 0x1278efc0e6754cd30fef2df25ff5ced072ebb194d348b0b1b9548166d24352ef
11
- bytes32 public constant ERC4626_NOT_REDEEMABLE_DEPLOY_ID = keccak256("PendleERC4626NotRedeemableToAssetSYV2"); // 0x6f089cd4afdd945c5c26b3f4542d0c294d19ec0e339c6ce4f8eafa94d700d05d
12
- bytes32 public constant ERC20_DEPLOY_ID = keccak256("PendleERC20SY"); // 0xfcf22a9a515753d83e4f2a81cf368c7226408c64f52411ae95241ebf5ed53304
13
-
14
- bytes32 public constant ERC4626_WITH_ADAPTER_ID = keccak256("PendleERC4626WithAdapterSY"); // 0x73f41560741d6765943d3c955034291fe23d9141e3a4719bc97422d5bf019adc
15
- bytes32 public constant ERC4626_NO_REDEEM_WITH_ADAPTER_ID = keccak256("PendleERC4626NoRedeemWithAdapterSY"); // 0x3b8dd2b992f773444e5422ba1db289c4657c57110d740dca7975dc095632ef23
16
- bytes32 public constant ERC20_WITH_ADAPTER_ID = keccak256("PendleERC20WithAdapterSY"); // 0xe5cce2b1999bf8c2cc4cf6d96d0569a24d8b782ba1647c09a8e1aa8bbfb98996
17
- bytes32 public constant ERC4626_NO_DEPOSIT_NO_REDEEM = keccak256("PendleERC4626NoRedeemNoDepositUpgSY"); // 0x5c1cddc0128e0b02bb711f84a022bf1c13177d4ab028830b702f3a77280025ea
18
-
19
10
  address public immutable syFactory;
20
11
 
21
12
  constructor(address _syFactory, address _router, address _yieldContractFactory, address _marketFactory)
@@ -31,79 +22,18 @@ contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnab
31
22
 
32
23
  function deployCommonMarketById(
33
24
  bytes32 id,
34
- bytes memory constructorParams,
35
- bytes memory initData,
36
- PoolConfig memory config,
37
- address tokenToSeedLiqudity,
38
- uint256 amountToSeed,
39
- address syOwner
40
- ) external returns (PoolDeploymentAddrs memory) {
41
- address SY = IPCommonSYFactory(syFactory).deployUpgradableSY(id, constructorParams, initData, syOwner);
42
- return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
43
- }
44
-
45
- // Those 3 are all not payable as they should not accept tokenIn as native
46
-
47
- function deployERC4626Market(
48
25
  bytes memory constructorParams,
49
26
  PoolConfig memory config,
50
27
  address tokenToSeedLiqudity,
51
28
  uint256 amountToSeed,
52
29
  address syOwner
53
30
  ) external returns (PoolDeploymentAddrs memory) {
54
- address SY = IPCommonSYFactory(syFactory).deploySY(ERC4626_DEPLOY_ID, constructorParams, syOwner);
31
+ address SY = IPCommonSYFactory(syFactory).deploySY(id, constructorParams, syOwner);
55
32
  return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
56
33
  }
57
34
 
58
- function deployERC4626NotRedeemableMarket(
59
- bytes memory constructorParams,
60
- PoolConfig memory config,
61
- address tokenToSeedLiqudity,
62
- uint256 amountToSeed,
63
- address syOwner
64
- ) external returns (PoolDeploymentAddrs memory) {
65
- address SY = IPCommonSYFactory(syFactory).deploySY(ERC4626_NOT_REDEEMABLE_DEPLOY_ID, constructorParams, syOwner);
66
- return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
67
- }
68
-
69
- function deployERC20Market(
70
- bytes memory constructorParams,
71
- PoolConfig memory config,
72
- address tokenToSeedLiqudity,
73
- uint256 amountToSeed,
74
- address syOwner
75
- ) external returns (PoolDeploymentAddrs memory) {
76
- address SY = IPCommonSYFactory(syFactory).deploySY(ERC20_DEPLOY_ID, constructorParams, syOwner);
77
- return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
78
- }
79
-
80
- function deployERC4626WithAdapterMarket(
81
- bytes memory constructorParams,
82
- bytes memory initData,
83
- PoolConfig memory config,
84
- address tokenToSeedLiqudity,
85
- uint256 amountToSeed,
86
- address syOwner
87
- ) external returns (PoolDeploymentAddrs memory) {
88
- address SY = IPCommonSYFactory(syFactory)
89
- .deployUpgradableSY(ERC4626_WITH_ADAPTER_ID, constructorParams, initData, syOwner);
90
- return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
91
- }
92
-
93
- function deployERC4626NoRedeemWithAdapterMarket(
94
- bytes memory constructorParams,
95
- bytes memory initData,
96
- PoolConfig memory config,
97
- address tokenToSeedLiqudity,
98
- uint256 amountToSeed,
99
- address syOwner
100
- ) external returns (PoolDeploymentAddrs memory) {
101
- address SY = IPCommonSYFactory(syFactory)
102
- .deployUpgradableSY(ERC4626_NO_REDEEM_WITH_ADAPTER_ID, constructorParams, initData, syOwner);
103
- return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
104
- }
105
-
106
- function deployERC20WithAdapterMarket(
35
+ function deployCommonMarketById(
36
+ bytes32 id,
107
37
  bytes memory constructorParams,
108
38
  bytes memory initData,
109
39
  PoolConfig memory config,
@@ -111,8 +41,7 @@ contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnab
111
41
  uint256 amountToSeed,
112
42
  address syOwner
113
43
  ) external returns (PoolDeploymentAddrs memory) {
114
- address SY = IPCommonSYFactory(syFactory)
115
- .deployUpgradableSY(ERC20_WITH_ADAPTER_ID, constructorParams, initData, syOwner);
44
+ address SY = IPCommonSYFactory(syFactory).deployUpgradableSY(id, constructorParams, initData, syOwner);
116
45
  return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
117
46
  }
118
47
  }
@@ -68,7 +68,10 @@ contract PendleCommonSYFactory is BoringOwnableUpgradeableV2 {
68
68
  );
69
69
 
70
70
  emit DeployedSY(id, constructorParams, SY);
71
- IOwnable(SY).transferOwnership(syOwner, true, false);
71
+
72
+ if (IOwnable(SY).owner() != syOwner) {
73
+ IOwnable(SY).transferOwnership(syOwner, true, false);
74
+ }
72
75
  }
73
76
 
74
77
  function deployUpgradableSY(bytes32 id, bytes memory constructorParams, bytes memory initData, address syOwner)
@@ -94,7 +97,10 @@ contract PendleCommonSYFactory is BoringOwnableUpgradeableV2 {
94
97
 
95
98
  emit DeployedSY(id, constructorParams, proxy);
96
99
 
97
- IOwnable(proxy).transferOwnership(syOwner, true, false);
100
+ if (IOwnable(proxy).owner() != syOwner) {
101
+ IOwnable(proxy).transferOwnership(syOwner, true, false);
102
+ }
103
+
98
104
  return proxy;
99
105
  }
100
106
  }
@@ -21,6 +21,7 @@ abstract contract PTLooperBase is IPPTLooper, EIP712Upgradeable, BoringOwnableUp
21
21
  address public proposer;
22
22
  mapping(address owner => mapping(bytes32 requestHash => uint256 nonce)) public proposerNonce;
23
23
  mapping(address owner => mapping(bytes32 boxId => UserRequestInfo)) internal _userRequest;
24
+ mapping(address owner => mapping(bytes32 requestHash => RequestStatus)) public requestStatus;
24
25
 
25
26
  constructor(address treasury_, address positionBoxFactory_) {
26
27
  TREASURY = treasury_;
@@ -182,6 +183,16 @@ abstract contract PTLooperBase is IPPTLooper, EIP712Upgradeable, BoringOwnableUp
182
183
  );
183
184
  }
184
185
 
186
+ function preApproveRequest(bytes32 requestHash, bytes memory proposerSig) external {
187
+ require(
188
+ SignatureChecker.isValidSignatureNow(proposer, requestHash, proposerSig),
189
+ "PTLooper: invalid proposer signature"
190
+ );
191
+ require(requestStatus[msg.sender][requestHash] == RequestStatus.DEFAULT, "PTLooper: invalid request status");
192
+ requestStatus[msg.sender][requestHash] = RequestStatus.PRE_APPROVED;
193
+ emit RequestPreApproved(msg.sender, requestHash);
194
+ }
195
+
185
196
  /// @dev Per-iteration auth + implicit session init. First call for a slot
186
197
  /// (`userReq.requestHash == 0`) opens the session — checks `boxId`/`sessionNonce` agree and
187
198
  /// verifies the owner sig. Subsequent calls just match `userReq.requestHash`;
@@ -206,7 +217,8 @@ abstract contract PTLooperBase is IPPTLooper, EIP712Upgradeable, BoringOwnableUp
206
217
  require(header.boxId == permit.boxId, "PTLooper: req/permit boxId mismatch");
207
218
  require(header.sessionNonce == userReq.sessionNonce, "PTLooper: invalid session nonce");
208
219
  require(
209
- SignatureChecker.isValidSignatureNow(permit.owner, requestHash, ownerSigIfFirstCall),
220
+ SignatureChecker.isValidSignatureNow(permit.owner, requestHash, ownerSigIfFirstCall)
221
+ || requestStatus[permit.owner][requestHash] == RequestStatus.PRE_APPROVED,
210
222
  "PTLooper: invalid owner signature"
211
223
  );
212
224
  userReq.requestHash = requestHash;
@@ -112,15 +112,16 @@ library PTLooperEIP712TypesEncodeDataLib {
112
112
  // IPPTLooper.sol > IPPTLooperEIP712Types > DecreasePositionRequest
113
113
  function encodeData(IPPTLooperEIP712Types.DecreasePositionRequest memory data) internal pure returns (bytes32) {
114
114
  /* bytes32 typeHash = keccak256(
115
- "DecreasePositionRequest(RequestHeader header,uint256 minPtToDebtSwapRate,uint256 postWithdrawMaxLTV)"
115
+ "DecreasePositionRequest(RequestHeader header,uint256 minPtToDebtSwapRate,uint256 postWithdrawMaxLTV,bool redeemWithPY)"
116
116
  "RequestHeader(bytes32 boxId,uint256 expiry,uint32 sessionNonce,uint32 permitNonceCap,uint256 swapBridgeSlippage,bytes offchainMetadata)"
117
117
  ); */
118
- bytes32 typeHash = 0xf2fd81fd04f9cee0ece251f806445c3b1d5103fcd06f31002a34371094102b59;
118
+ bytes32 typeHash = 0xcef8ce2150dc900a3944ee876f241e8fdc5f7f7e3c93a83a807ca2f6df6dcef6;
119
119
  return keccak256(abi.encode(
120
120
  typeHash,
121
121
  encodeData(data.header),
122
122
  data.minPtToDebtSwapRate,
123
- data.postWithdrawMaxLTV
123
+ data.postWithdrawMaxLTV,
124
+ data.redeemWithPY
124
125
  ));
125
126
  }
126
127
 
@@ -2,8 +2,9 @@
2
2
  pragma solidity ^0.8.30;
3
3
 
4
4
  import {PMath} from "../core/libraries/math/PMath.sol";
5
+ import {ArrayLib} from "../core/libraries/ArrayLib.sol";
5
6
  import {MarketCtx, createMarketCtx} from "../interfaces/IMoneyMarket.sol";
6
- import {ApprovedCall, BoxData, IPLoopPositionBox} from "../interfaces/IPLoopPositionBox.sol";
7
+ import {BoxCall, BoxData, IPLoopPositionBox} from "../interfaces/IPLoopPositionBox.sol";
7
8
  import {PTLooperBase} from "./PTLooperBase.sol";
8
9
  import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
9
10
  import {IPPrincipalToken} from "../interfaces/IPPrincipalToken.sol";
@@ -47,7 +48,7 @@ contract PendlePTLooper is PTLooperBase {
47
48
  bytes memory proposerSig,
48
49
  IncreasePositionRequest memory req,
49
50
  bytes memory ownerSigIfFirstCall
50
- ) external payable onlyExecutor {
51
+ ) external onlyExecutor {
51
52
  (Session memory s, bytes32 requestHash) = _ensureSessionAndAuth(ms, req, proposerSig, ownerSigIfFirstCall);
52
53
 
53
54
  uint256 preInBalance;
@@ -117,7 +118,7 @@ contract PendlePTLooper is PTLooperBase {
117
118
  bytes memory proposerSig,
118
119
  DecreasePositionRequest memory req,
119
120
  bytes memory ownerSigIfFirstCall
120
- ) external payable onlyExecutor {
121
+ ) external onlyExecutor {
121
122
  (Session memory s, bytes32 requestHash) = _ensureSessionAndAuth(ms, req, proposerSig, ownerSigIfFirstCall);
122
123
 
123
124
  uint256 preDebtBal;
@@ -160,9 +161,9 @@ contract PendlePTLooper is PTLooperBase {
160
161
  Session memory s,
161
162
  uint256 netPtToSwap
162
163
  ) internal returns (uint256 postDebtBal) {
163
- (uint256 preFeeDebtBal,) = _boxSwapToken(
164
- s.box, s.bd.hubPt, netPtToSwap, s.bd.hubDebtToken, req.minPtToDebtSwapRate, ms.swap
165
- );
164
+ (uint256 preFeeDebtBal,) = req.redeemWithPY
165
+ ? _boxRedeemPYToToken(s.box, s.bd.hubPt, netPtToSwap, s.bd.hubDebtToken, req.minPtToDebtSwapRate, ms.swap)
166
+ : _boxSwapToken(s.box, s.bd.hubPt, netPtToSwap, s.bd.hubDebtToken, req.minPtToDebtSwapRate, ms.swap);
166
167
 
167
168
  _boxWithdraw(s.box, TREASURY, s.bd.hubDebtToken, ms.fee);
168
169
  postDebtBal = preFeeDebtBal - ms.fee;
@@ -179,7 +180,7 @@ contract PendlePTLooper is PTLooperBase {
179
180
  bytes memory proposerSig,
180
181
  SwapBridgeWithdrawAllRequest memory req,
181
182
  bytes memory ownerSigIfFirstCall
182
- ) external payable onlyExecutor {
183
+ ) external onlyExecutor {
183
184
  (Session memory s, bytes32 requestHash) = _ensureSessionAndAuth(ms, req, proposerSig, ownerSigIfFirstCall);
184
185
 
185
186
  address tokenOutHere = _onHub(s.bd) ? req.hubTokenOut : req.dstTokenOut;
@@ -214,33 +215,80 @@ contract PendlePTLooper is PTLooperBase {
214
215
  uint256 minSwapRate,
215
216
  BoxApprovedCall memory swap
216
217
  ) internal returns (uint256 postTokenOutBal, uint256 netSwappedOut) {
217
- if (tokenIn == tokenOut) {
218
- return (tokenInBal, 0);
219
- }
218
+ if (tokenIn == tokenOut) return (tokenInBal, 0);
219
+
220
+ BoxCall memory call = tokenIn == NATIVE
221
+ ? _toBoxCall(swap, new address[](0), new uint256[](0), tokenInBal)
222
+ : _toBoxCall(swap, ArrayLib.create(tokenIn), ArrayLib.create(tokenInBal), 0);
223
+
224
+ (postTokenOutBal, netSwappedOut) = _boxExecSwap(box, tokenInBal, tokenOut, minSwapRate, call);
220
225
 
226
+ if (netSwappedOut > 0) emit TokenSwapped(box, tokenIn, tokenInBal, tokenOut, netSwappedOut);
227
+ }
228
+
229
+ /// @dev PT -> `tokenOut`. The box's YT is approved
230
+ /// alongside PT (amount = min of the two) so the router can redeem PT + YT -> SY -> Token;
231
+ /// YT must be consumed 1:1 with PT. PT is never `tokenOut`, so no same-token short-circuit.
232
+ /// @param ptBal the box's `pt` whole balance (`_boxBal(box, pt)`) right **before** this function is
233
+ /// called — it is the minuend of the 1:1 check below, not just the approval size.
234
+ function _boxRedeemPYToToken(
235
+ IPLoopPositionBox box,
236
+ address pt,
237
+ uint256 ptBal,
238
+ address tokenOut,
239
+ uint256 minSwapRate,
240
+ BoxApprovedCall memory swap
241
+ ) internal returns (uint256 postTokenOutBal, uint256 netSwappedOut) {
242
+ address yt = IPPrincipalToken(pt).YT();
243
+ uint256 ytBal = _boxBal(box, yt);
244
+ uint256 netPyIn = PMath.min(ytBal, ptBal);
245
+
246
+ BoxCall memory call = _toBoxCall(swap, ArrayLib.create(pt, yt), ArrayLib.create(netPyIn, netPyIn), 0);
247
+ (postTokenOutBal, netSwappedOut) = _boxExecSwap(box, netPyIn, tokenOut, minSwapRate, call);
248
+
249
+ // Underflow (router returned PT/YT to the box) is an intended revert.
250
+ require(ytBal - _boxBal(box, yt) == ptBal - _boxBal(box, pt), "PTLooper: PY redeem mismatch");
251
+
252
+ if (netSwappedOut > 0) emit PYRedeemed(box, pt, netPyIn, tokenOut, netSwappedOut);
253
+ }
254
+
255
+ /// @dev Shared body of `_boxSwapToken` / `_boxRedeemPYToToken`. No-op (returns the current
256
+ /// `tokenOut` balance) when `call.extRouter == address(0)`; `minSwapRate` is checked against
257
+ /// `netIn` only when a swap occurs. Emitting is left to the callers, which report different events.
258
+ function _boxExecSwap(
259
+ IPLoopPositionBox box,
260
+ uint256 netIn,
261
+ address tokenOut,
262
+ uint256 minSwapRate,
263
+ BoxCall memory call
264
+ ) internal returns (uint256 postTokenOutBal, uint256 netSwappedOut) {
221
265
  uint256 preTokenOutBal = _boxBal(box, tokenOut);
222
- if (swap.extRouter == address(0)) {
223
- return (preTokenOutBal, 0);
224
- }
266
+ if (call.extRouter == address(0)) return (preTokenOutBal, 0);
225
267
 
226
- box.approveAndCall(
227
- ApprovedCall({ //
228
- token: tokenIn,
229
- amount: tokenInBal,
230
- approveTo: swap.approve,
231
- callTo: swap.extRouter,
232
- data: swap.callData
233
- }),
234
- address(box)
235
- );
268
+ box.approveAndCall(call, address(box));
236
269
  postTokenOutBal = _boxBal(box, tokenOut);
237
270
  netSwappedOut = postTokenOutBal - preTokenOutBal;
238
271
 
239
- require(netSwappedOut * PMath.ONE >= tokenInBal * minSwapRate, "PTLooper: swap below minSwapRate");
240
- emit TokenSwapped(box, tokenIn, tokenInBal, tokenOut, netSwappedOut);
272
+ require(netSwappedOut * PMath.ONE >= netIn * minSwapRate, "PTLooper: swap below minSwapRate");
273
+ }
274
+
275
+ function _toBoxCall(
276
+ BoxApprovedCall memory swap,
277
+ address[] memory tokens,
278
+ uint256[] memory amounts,
279
+ uint256 nativeAmount
280
+ ) internal pure returns (BoxCall memory) {
281
+ return BoxCall({
282
+ tokens: tokens,
283
+ amounts: amounts,
284
+ nativeAmount: nativeAmount,
285
+ approve: swap.approve,
286
+ extRouter: swap.extRouter,
287
+ callData: swap.callData
288
+ });
241
289
  }
242
290
 
243
- /// @notice Only bridge between hubChain and spokeChain.
291
+ /// @dev Stub until cross-chain lands; callers gate on `_isCrossChain`.
244
292
  function _boxBridgeToken(Session memory, BridgeData memory, address, uint256, address, uint256, bool)
245
293
  internal
246
294
  pure
@@ -274,7 +322,7 @@ contract PendlePTLooper is PTLooperBase {
274
322
  revert("PTLooper: unsupported chainid");
275
323
  }
276
324
 
277
- function _ltvCheck(uint256 mmPtBal, uint256 mmDebtBal, uint256 mmOraclePtDebtRate, uint256 maxLTV) internal pure {
325
+ function _checkLTV(uint256 mmPtBal, uint256 mmDebtBal, uint256 mmOraclePtDebtRate, uint256 maxLTV) internal pure {
278
326
  require(mmDebtBal <= mmPtBal.mulDown(mmOraclePtDebtRate).mulDown(maxLTV), "PTLooper: maxLTV exceeded");
279
327
  }
280
328
 
@@ -285,7 +333,7 @@ contract PendlePTLooper is PTLooperBase {
285
333
  (uint256 netLent, uint256 mmPtBal) = s.spokeMM.lend(ctx, ptIn);
286
334
  (uint256 netBorrowed, uint256 mmDebtBal) = s.spokeMM.borrow(ctx, debtOut);
287
335
  uint256 rate = s.spokeMM.oraclePtDebtRate(ctx);
288
- _ltvCheck(mmPtBal, mmDebtBal, rate, req.postBorrowMaxLTV);
336
+ _checkLTV(mmPtBal, mmDebtBal, rate, req.postBorrowMaxLTV);
289
337
  emit MoneyMarketLentThenBorrowed(s.box, netLent, netBorrowed);
290
338
  }
291
339
 
@@ -296,7 +344,7 @@ contract PendlePTLooper is PTLooperBase {
296
344
  (uint256 netRepaid, uint256 mmDebtBal) = s.spokeMM.repay(ctx, debtIn);
297
345
  (uint256 netWithdrawn, uint256 mmPtBal) = s.spokeMM.withdraw(ctx, ptOut);
298
346
  uint256 rate = s.spokeMM.oraclePtDebtRate(ctx);
299
- _ltvCheck(mmPtBal, mmDebtBal, rate, req.postWithdrawMaxLTV);
347
+ _checkLTV(mmPtBal, mmDebtBal, rate, req.postWithdrawMaxLTV);
300
348
  emit MoneyMarketRepaidThenWithdrawn(s.box, netRepaid, netWithdrawn);
301
349
  }
302
350
 
@@ -2,7 +2,7 @@
2
2
  pragma solidity ^0.8.30;
3
3
 
4
4
  import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
5
- import {ApprovedCall, IPLoopPositionBox} from "../../interfaces/IPLoopPositionBox.sol";
5
+ import {BoxCall, IPLoopPositionBox} from "../../interfaces/IPLoopPositionBox.sol";
6
6
  import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
7
7
  import {IERC20Metadata as IERC20} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
8
8
  import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
@@ -52,22 +52,33 @@ contract LoopPositionBox is IPLoopPositionBox, TokenHelper, Initializable {
52
52
  _transferOut(token, to, amount);
53
53
  }
54
54
 
55
- function approveAndCall(ApprovedCall memory call, address nativeRefund)
55
+ function approveAndCall(BoxCall memory call, address nativeRefund)
56
56
  external
57
57
  payable
58
58
  onlyManager
59
59
  returns (bytes memory result)
60
60
  {
61
- uint256 nativeAmount = call.token == NATIVE ? call.amount : 0;
61
+ require(call.tokens.length == call.amounts.length, "LoopPositionBox: tokens/amounts length mismatch");
62
+ // `initialize` gave the spoke MM an infinite approval; the reset-to-zero below would wipe it.
63
+ require(
64
+ SPOKE_MONEY_MARKET == address(0) || call.approve != SPOKE_MONEY_MARKET,
65
+ "LoopPositionBox: approve cannot be spokeMM"
66
+ );
67
+
62
68
  uint256 nativeFee = msg.value;
63
69
 
64
- // Back out the native the manager just sent in (call.amount if NATIVE, plus the msg.value fee)
65
- // so the post-call diff refunds only router-returned surplus, not the box's pre-existing native.
66
- uint256 initialNativeBalance = _selfBalance(NATIVE) - nativeAmount - nativeFee;
70
+ // `initialNativeBalance` is what the box ends with if the router keeps every wei we send it:
71
+ // pre-tx balance (current minus the msg.value fee) minus the box's own `nativeAmount`.
72
+ // Anything above that after the call is router surplus, refunded to `nativeRefund`.
73
+ uint256 initialNativeBalance = _selfBalance(NATIVE) - call.nativeAmount - nativeFee;
67
74
 
68
- _approveForExtRouter(call.token, call.approveTo, call.amount);
69
- result = call.callTo.functionCallWithValue(call.data, nativeAmount + nativeFee);
70
- _approveForExtRouter(call.token, call.approveTo, 0);
75
+ for (uint256 i = 0; i < call.tokens.length; ++i) {
76
+ IERC20(call.tokens[i]).forceApprove(call.approve, call.amounts[i]);
77
+ }
78
+ result = call.extRouter.functionCallWithValue(call.callData, call.nativeAmount + nativeFee);
79
+ for (uint256 i = 0; i < call.tokens.length; ++i) {
80
+ IERC20(call.tokens[i]).forceApprove(call.approve, 0);
81
+ }
71
82
 
72
83
  uint256 finalNativeBalance = _selfBalance(NATIVE);
73
84
 
@@ -76,10 +87,5 @@ contract LoopPositionBox is IPLoopPositionBox, TokenHelper, Initializable {
76
87
  }
77
88
  }
78
89
 
79
- function _approveForExtRouter(address token, address extRouter, uint256 amount) internal {
80
- if (token == NATIVE || extRouter == SPOKE_MONEY_MARKET) return;
81
- IERC20(token).forceApprove(extRouter, amount);
82
- }
83
-
84
90
  receive() external payable {}
85
91
  }
@@ -3,14 +3,10 @@ pragma solidity ^0.8.20;
3
3
 
4
4
  /// @dev Encoding:
5
5
  /// - first byte: to encode eModeCategoryId
6
- /// - second byte, bit 0: isolationMode flag
7
6
  /// @dev eModeCategoryId == 0 means no eMode
8
7
  library AaveMMPayloadLib {
9
- uint256 private constant ISOLATION_MODE_MASK = 1 << 8;
10
-
11
- function unwrap(bytes32 payload) internal pure returns (uint8 eModeCategoryId, bool isolationMode) {
8
+ function unwrap(bytes32 payload) internal pure returns (uint8 eModeCategoryId) {
12
9
  uint256 rawPayload = uint256(payload);
13
10
  eModeCategoryId = uint8(rawPayload);
14
- isolationMode = (rawPayload & ISOLATION_MODE_MASK) != 0;
15
11
  }
16
12
  }