@pendle/core-v2 1.2.0-mainnet → 1.3.0-mainnet

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 (293) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
  10. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +34 -2
  14. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
  16. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  18. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
  19. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  20. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
  21. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  22. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  23. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
  24. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  25. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
  26. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  27. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
  28. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
  29. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -2
  30. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
  32. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
  34. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
  36. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
  38. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
  41. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
  43. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.json +141 -0
  47. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
  48. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json +141 -0
  49. package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +4 -0
  50. package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +50 -0
  51. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
  52. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +143 -2
  53. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +4 -0
  54. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +1296 -0
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +4 -0
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +1283 -0
  57. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +4 -0
  58. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +1218 -0
  59. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +4 -0
  60. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +1231 -0
  61. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +4 -0
  62. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +10 -0
  63. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +4 -0
  64. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +133 -0
  65. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +4 -0
  66. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +10 -0
  67. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +4 -0
  68. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +40 -0
  69. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +4 -0
  70. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +322 -0
  71. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +4 -0
  72. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +1171 -0
  73. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +4 -0
  74. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +10 -0
  75. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +4 -0
  76. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +133 -0
  77. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
  78. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
  79. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
  80. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +143 -2
  81. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
  82. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +143 -2
  83. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
  84. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +143 -2
  85. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
  86. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.json +141 -0
  87. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
  88. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +143 -2
  89. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
  90. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +143 -2
  91. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  92. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
  93. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  94. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
  95. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  96. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
  97. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  98. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
  99. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  100. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +39 -2
  101. package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +4 -0
  102. package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +10 -0
  103. package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +4 -0
  104. package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +24 -0
  105. package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +4 -0
  106. package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +133 -0
  107. package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +4 -0
  108. package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +328 -0
  109. package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +4 -0
  110. package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +467 -0
  111. package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +4 -0
  112. package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.json +61 -0
  113. package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +4 -0
  114. package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +30 -0
  115. package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +4 -0
  116. package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +398 -0
  117. package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +4 -0
  118. package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.json +24 -0
  119. package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +4 -0
  120. package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +278 -0
  121. package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
  122. package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +18 -0
  123. package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +1 -1
  124. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  125. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  126. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  127. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
  128. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  129. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  130. package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
  131. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  132. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +19 -0
  133. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  134. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  135. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  136. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
  137. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
  138. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
  139. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -2
  140. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +4 -0
  141. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +322 -0
  142. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  143. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +2 -2
  144. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  145. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
  146. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  147. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
  148. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  149. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
  150. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  151. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  152. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  153. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
  154. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
  155. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
  156. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  157. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
  158. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  159. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  160. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  161. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  162. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  163. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  164. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  165. package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
  166. package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
  167. package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  168. package/contracts/core/StandardizedYield/SYBase.sol +23 -5
  169. package/contracts/core/StandardizedYield/StEthHelper.sol +71 -0
  170. package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +170 -0
  171. package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +162 -0
  172. package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +134 -0
  173. package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +154 -0
  174. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +289 -0
  175. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +618 -0
  176. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +68 -0
  177. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +322 -0
  178. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +390 -0
  179. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +329 -0
  180. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +30 -0
  181. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +189 -0
  182. package/contracts/core/libraries/ArrayLib.sol +6 -3
  183. package/contracts/core/libraries/Errors.sol +3 -0
  184. package/contracts/interfaces/Balancer/IAsset.sol +4 -0
  185. package/contracts/interfaces/Balancer/IBalancerFees.sol +6 -0
  186. package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +22 -0
  187. package/contracts/interfaces/Balancer/IBasePool.sol +30 -0
  188. package/contracts/interfaces/Balancer/IComposableStable.sol +39 -0
  189. package/contracts/interfaces/Balancer/IGauge.sol +10 -0
  190. package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +6 -0
  191. package/contracts/interfaces/Balancer/IMetaStablePool.sol +31 -0
  192. package/contracts/interfaces/Balancer/IRateProvider.sol +6 -0
  193. package/contracts/interfaces/Balancer/IVault.sol +78 -0
  194. package/contracts/interfaces/ConvexCurve/IRewards.sol +5 -0
  195. package/contracts/router/kyberswap/AggregationRouterHelper.sol +10 -0
  196. package/deployments/1-core.json +1 -1
  197. package/deployments/1-markets/BALANCER-LP-AURA-RETH-WETH-28DEC.json +11 -0
  198. package/package.json +6 -6
  199. package/typechain-types/ComposableStablePreview.ts +217 -0
  200. package/typechain-types/IBalancerFees.ts +89 -0
  201. package/typechain-types/IBalancerStablePreview.ts +217 -0
  202. package/typechain-types/IBasePool.ts +482 -0
  203. package/typechain-types/IComposableStable.ts +730 -0
  204. package/typechain-types/IGauge.ts +160 -0
  205. package/typechain-types/ILiquidityGaugeFactory.ts +99 -0
  206. package/typechain-types/IMetaStablePool.ts +619 -0
  207. package/typechain-types/IPFeeDistributor.ts +18 -0
  208. package/typechain-types/IRateProvider.ts +81 -0
  209. package/typechain-types/IRewards.ts +35 -5
  210. package/typechain-types/IVault.ts +410 -0
  211. package/typechain-types/MetaStableMath.ts +113 -0
  212. package/typechain-types/MetaStablePreview.ts +501 -0
  213. package/typechain-types/Multicall2.ts +437 -0
  214. package/typechain-types/PendleAura3EthSY.ts +1639 -0
  215. package/typechain-types/PendleAuraBalancerStableLPSY.ts +1523 -0
  216. package/typechain-types/PendleAuraCbethWstethSY.ts +1626 -0
  217. package/typechain-types/PendleAuraWethRethSY.ts +1549 -0
  218. package/typechain-types/PendleAuraWethWstethSY.ts +1562 -0
  219. package/typechain-types/PendleConvexLPSY.ts +204 -0
  220. package/typechain-types/PendleCurveFraxUsdcSY.ts +204 -0
  221. package/typechain-types/PendleCurveUsdd3CrvSY.ts +204 -0
  222. package/typechain-types/PendleFeeDistributor.ts +37 -0
  223. package/typechain-types/PendleLooksStakingSY.ts +204 -0
  224. package/typechain-types/PendleQiTokenSY.ts +204 -0
  225. package/typechain-types/PendleWstEthSY.ts +204 -0
  226. package/typechain-types/SAPE.ts +204 -0
  227. package/typechain-types/SYBase.ts +204 -0
  228. package/typechain-types/SYBaseWithRewards.ts +204 -0
  229. package/typechain-types/StEthHelper.ts +107 -0
  230. package/typechain-types/StablePreviewBase.ts +217 -0
  231. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
  232. package/typechain-types/factories/ActionCallback__factory.ts +1 -1
  233. package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
  234. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  235. package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
  236. package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
  237. package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
  238. package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
  239. package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
  240. package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
  241. package/typechain-types/factories/BulkSeller__factory.ts +1 -1
  242. package/typechain-types/factories/ComposableStablePreview__factory.ts +190 -0
  243. package/typechain-types/factories/Errors__factory.ts +38 -1
  244. package/typechain-types/factories/IBalancerFees__factory.ts +36 -0
  245. package/typechain-types/factories/IBalancerStablePreview__factory.ts +152 -0
  246. package/typechain-types/factories/IBasePool__factory.ts +340 -0
  247. package/typechain-types/factories/IComposableStable__factory.ts +482 -0
  248. package/typechain-types/factories/IGauge__factory.ts +70 -0
  249. package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +49 -0
  250. package/typechain-types/factories/IMetaStablePool__factory.ts +413 -0
  251. package/typechain-types/factories/IPFeeDistributor__factory.ts +19 -0
  252. package/typechain-types/factories/IRateProvider__factory.ts +36 -0
  253. package/typechain-types/factories/IRewards__factory.ts +18 -0
  254. package/typechain-types/factories/IVault__factory.ts +287 -0
  255. package/typechain-types/factories/MarketMathStatic__factory.ts +1 -1
  256. package/typechain-types/factories/MetaStableMath__factory.ts +93 -0
  257. package/typechain-types/factories/MetaStablePreview__factory.ts +375 -0
  258. package/typechain-types/factories/Multicall2__factory.ts +372 -0
  259. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  260. package/typechain-types/factories/PendleAura3EthSY__factory.ts +1365 -0
  261. package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +1190 -0
  262. package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +1356 -0
  263. package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +1291 -0
  264. package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +1304 -0
  265. package/typechain-types/factories/PendleConvexLPSY__factory.ts +141 -0
  266. package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +142 -1
  267. package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +142 -1
  268. package/typechain-types/factories/PendleFeeDistributor__factory.ts +33 -1
  269. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
  270. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
  271. package/typechain-types/factories/PendleLooksStakingSY__factory.ts +142 -1
  272. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  273. package/typechain-types/factories/PendleMarket__factory.ts +1 -1
  274. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  275. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  276. package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
  277. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  278. package/typechain-types/factories/PendleQiTokenSY__factory.ts +142 -1
  279. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  280. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  281. package/typechain-types/factories/PendleWstEthSY__factory.ts +142 -1
  282. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
  283. package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
  284. package/typechain-types/factories/RouterStatic__factory.ts +1 -1
  285. package/typechain-types/factories/SAPE__factory.ts +142 -1
  286. package/typechain-types/factories/SYBaseWithRewards__factory.ts +141 -0
  287. package/typechain-types/factories/SYBase__factory.ts +141 -0
  288. package/typechain-types/factories/StEthHelper__factory.ts +62 -0
  289. package/typechain-types/factories/StablePreviewBase__factory.ts +148 -0
  290. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  291. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  292. package/typechain-types/hardhat.d.ts +180 -9
  293. package/typechain-types/index.ts +40 -2
@@ -0,0 +1,289 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity ^0.8.17;
3
+
4
+ import "../FixedPoint.sol";
5
+
6
+ // almost copy-paste from https://etherscan.io/token/0x1e19cf2d73a72ef1332c882f20534b6519be0276#code
7
+ library ComposableStableMath {
8
+ using FixedPoint for uint256;
9
+
10
+ uint256 internal constant _MIN_AMP = 1;
11
+ uint256 internal constant _MAX_AMP = 5000;
12
+ uint256 internal constant _AMP_PRECISION = 1e3;
13
+
14
+ function _calculateInvariant(uint256 amplificationParameter, uint256[] memory balances)
15
+ internal
16
+ pure
17
+ returns (uint256)
18
+ {
19
+ unchecked {
20
+ /**********************************************************************************************
21
+ // invariant //
22
+ // D = invariant D^(n+1) //
23
+ // A = amplification coefficient A n^n S + D = A D n^n + ----------- //
24
+ // S = sum of balances n^n P //
25
+ // P = product of balances //
26
+ // n = number of tokens //
27
+ **********************************************************************************************/
28
+
29
+ // Always round down, to match Vyper's arithmetic (which always truncates).
30
+
31
+ uint256 sum = 0; // S in the Curve version
32
+ uint256 numTokens = balances.length;
33
+ for (uint256 i = 0; i < numTokens; i++) {
34
+ sum = sum.add(balances[i]);
35
+ }
36
+ if (sum == 0) {
37
+ return 0;
38
+ }
39
+
40
+ uint256 prevInvariant; // Dprev in the Curve version
41
+ uint256 invariant = sum; // D in the Curve version
42
+ uint256 ampTimesTotal = amplificationParameter * numTokens; // Ann in the Curve version
43
+
44
+ for (uint256 i = 0; i < 255; i++) {
45
+ uint256 D_P = invariant;
46
+
47
+ for (uint256 j = 0; j < numTokens; j++) {
48
+ // (D_P * invariant) / (balances[j] * numTokens)
49
+ D_P = divDown(mul(D_P, invariant), mul(balances[j], numTokens));
50
+ }
51
+
52
+ prevInvariant = invariant;
53
+
54
+ invariant = divDown(
55
+ mul(
56
+ // (ampTimesTotal * sum) / AMP_PRECISION + D_P * numTokens
57
+ (
58
+ divDown(mul(ampTimesTotal, sum), _AMP_PRECISION).add(
59
+ mul(D_P, numTokens)
60
+ )
61
+ ),
62
+ invariant
63
+ ),
64
+ // ((ampTimesTotal - _AMP_PRECISION) * invariant) / _AMP_PRECISION + (numTokens + 1) * D_P
65
+ (
66
+ divDown(mul((ampTimesTotal - _AMP_PRECISION), invariant), _AMP_PRECISION)
67
+ .add(mul((numTokens + 1), D_P))
68
+ )
69
+ );
70
+
71
+ if (invariant > prevInvariant) {
72
+ if (invariant - prevInvariant <= 1) {
73
+ return invariant;
74
+ }
75
+ } else if (prevInvariant - invariant <= 1) {
76
+ return invariant;
77
+ }
78
+ }
79
+
80
+ revert("Stable Invariant did not converge");
81
+ }
82
+ }
83
+
84
+ function _calcBptOutGivenExactTokensIn(
85
+ uint256 amp,
86
+ uint256[] memory balances,
87
+ uint256[] memory amountsIn,
88
+ uint256 bptTotalSupply,
89
+ uint256 currentInvariant,
90
+ uint256 swapFeePercentage
91
+ ) internal pure returns (uint256) {
92
+ unchecked {
93
+ // BPT out, so we round down overall.
94
+
95
+ // First loop calculates the sum of all token balances, which will be used to calculate
96
+ // the current weights of each token, relative to this sum
97
+ uint256 sumBalances = 0;
98
+ for (uint256 i = 0; i < balances.length; i++) {
99
+ sumBalances = sumBalances.add(balances[i]);
100
+ }
101
+
102
+ // Calculate the weighted balance ratio without considering fees
103
+ uint256[] memory balanceRatiosWithFee = new uint256[](amountsIn.length);
104
+ // The weighted sum of token balance ratios with fee
105
+ uint256 invariantRatioWithFees = 0;
106
+ for (uint256 i = 0; i < balances.length; i++) {
107
+ uint256 currentWeight = balances[i].divDown(sumBalances);
108
+ balanceRatiosWithFee[i] = balances[i].add(amountsIn[i]).divDown(balances[i]);
109
+ invariantRatioWithFees = invariantRatioWithFees.add(
110
+ balanceRatiosWithFee[i].mulDown(currentWeight)
111
+ );
112
+ }
113
+
114
+ // Second loop calculates new amounts in, taking into account the fee on the percentage excess
115
+ uint256[] memory newBalances = new uint256[](balances.length);
116
+ for (uint256 i = 0; i < balances.length; i++) {
117
+ uint256 amountInWithoutFee;
118
+
119
+ // Check if the balance ratio is greater than the ideal ratio to charge fees or not
120
+ if (balanceRatiosWithFee[i] > invariantRatioWithFees) {
121
+ uint256 nonTaxableAmount = balances[i].mulDown(
122
+ invariantRatioWithFees.sub(FixedPoint.ONE)
123
+ );
124
+ uint256 taxableAmount = amountsIn[i].sub(nonTaxableAmount);
125
+ // No need to use checked arithmetic for the swap fee, it is guaranteed to be lower than 50%
126
+ amountInWithoutFee = nonTaxableAmount.add(
127
+ taxableAmount.mulDown(FixedPoint.ONE - swapFeePercentage)
128
+ );
129
+ } else {
130
+ amountInWithoutFee = amountsIn[i];
131
+ }
132
+
133
+ newBalances[i] = balances[i].add(amountInWithoutFee);
134
+ }
135
+
136
+ uint256 newInvariant = _calculateInvariant(amp, newBalances);
137
+ uint256 invariantRatio = newInvariant.divDown(currentInvariant);
138
+
139
+ // If the invariant didn't increase for any reason, we simply don't mint BPT
140
+ if (invariantRatio > FixedPoint.ONE) {
141
+ return bptTotalSupply.mulDown(invariantRatio - FixedPoint.ONE);
142
+ } else {
143
+ return 0;
144
+ }
145
+ }
146
+ }
147
+
148
+ function _calcTokenOutGivenExactBptIn(
149
+ uint256 amp,
150
+ uint256[] memory balances,
151
+ uint256 tokenIndex,
152
+ uint256 bptAmountIn,
153
+ uint256 bptTotalSupply,
154
+ uint256 currentInvariant,
155
+ uint256 swapFeePercentage
156
+ ) internal pure returns (uint256) {
157
+ unchecked {
158
+ // Token out, so we round down overall.
159
+
160
+ uint256 newInvariant = bptTotalSupply.sub(bptAmountIn).divUp(bptTotalSupply).mulUp(
161
+ currentInvariant
162
+ );
163
+
164
+ // Calculate amount out without fee
165
+ uint256 newBalanceTokenIndex = _getTokenBalanceGivenInvariantAndAllOtherBalances(
166
+ amp,
167
+ balances,
168
+ newInvariant,
169
+ tokenIndex
170
+ );
171
+ uint256 amountOutWithoutFee = balances[tokenIndex].sub(newBalanceTokenIndex);
172
+
173
+ // First calculate the sum of all token balances, which will be used to calculate
174
+ // the current weight of each token
175
+ uint256 sumBalances = 0;
176
+ for (uint256 i = 0; i < balances.length; i++) {
177
+ sumBalances = sumBalances.add(balances[i]);
178
+ }
179
+
180
+ // We can now compute how much excess balance is being withdrawn as a result of the virtual swaps, which result
181
+ // in swap fees.
182
+ uint256 currentWeight = balances[tokenIndex].divDown(sumBalances);
183
+ uint256 taxablePercentage = currentWeight.complement();
184
+
185
+ // Swap fees are typically charged on 'token in', but there is no 'token in' here, so we apply it
186
+ // to 'token out'. This results in slightly larger price impact. Fees are rounded up.
187
+ uint256 taxableAmount = amountOutWithoutFee.mulUp(taxablePercentage);
188
+ uint256 nonTaxableAmount = amountOutWithoutFee.sub(taxableAmount);
189
+
190
+ // No need to use checked arithmetic for the swap fee, it is guaranteed to be lower than 50%
191
+ return nonTaxableAmount.add(taxableAmount.mulDown(FixedPoint.ONE - swapFeePercentage));
192
+ }
193
+ }
194
+
195
+ // This function calculates the balance of a given token (tokenIndex)
196
+ // given all the other balances and the invariant
197
+ function _getTokenBalanceGivenInvariantAndAllOtherBalances(
198
+ uint256 amplificationParameter,
199
+ uint256[] memory balances,
200
+ uint256 invariant,
201
+ uint256 tokenIndex
202
+ ) internal pure returns (uint256) {
203
+ unchecked {
204
+ // Rounds result up overall
205
+
206
+ uint256 ampTimesTotal = amplificationParameter * balances.length;
207
+ uint256 sum = balances[0];
208
+ uint256 P_D = balances[0] * balances.length;
209
+ for (uint256 j = 1; j < balances.length; j++) {
210
+ P_D = divDown(mul(mul(P_D, balances[j]), balances.length), invariant);
211
+ sum = sum.add(balances[j]);
212
+ }
213
+ // No need to use safe math, based on the loop above `sum` is greater than or equal to `balances[tokenIndex]`
214
+ sum = sum - balances[tokenIndex];
215
+
216
+ uint256 inv2 = mul(invariant, invariant);
217
+ // We remove the balance from c by multiplying it
218
+ uint256 c = mul(
219
+ mul(divUp(inv2, mul(ampTimesTotal, P_D)), _AMP_PRECISION),
220
+ balances[tokenIndex]
221
+ );
222
+ uint256 b = sum.add(mul(divDown(invariant, ampTimesTotal), _AMP_PRECISION));
223
+
224
+ // We iterate to find the balance
225
+ uint256 prevTokenBalance = 0;
226
+ // We multiply the first iteration outside the loop with the invariant to set the value of the
227
+ // initial approximation.
228
+ uint256 tokenBalance = divUp(inv2.add(c), invariant.add(b));
229
+
230
+ for (uint256 i = 0; i < 255; i++) {
231
+ prevTokenBalance = tokenBalance;
232
+
233
+ tokenBalance = divUp(
234
+ mul(tokenBalance, tokenBalance).add(c),
235
+ mul(tokenBalance, 2).add(b).sub(invariant)
236
+ );
237
+
238
+ if (tokenBalance > prevTokenBalance) {
239
+ if (tokenBalance - prevTokenBalance <= 1) {
240
+ return tokenBalance;
241
+ }
242
+ } else if (prevTokenBalance - tokenBalance <= 1) {
243
+ return tokenBalance;
244
+ }
245
+ }
246
+
247
+ revert("Stable get balance did not converge");
248
+ }
249
+ }
250
+
251
+ /*///////////////////////////////////////////////////////////////
252
+ LEGACY MATH FUNCTIONS
253
+ //////////////////////////////////////////////////////////////*/
254
+
255
+ function mul(uint256 a, uint256 b) internal pure returns (uint256) {
256
+ unchecked {
257
+ uint256 c = a * b;
258
+ require(a == 0 || c / a == b);
259
+ return c;
260
+ }
261
+ }
262
+
263
+ function div(
264
+ uint256 a,
265
+ uint256 b,
266
+ bool roundUp
267
+ ) private pure returns (uint256) {
268
+ return roundUp ? divUp(a, b) : divDown(a, b);
269
+ }
270
+
271
+ function divDown(uint256 a, uint256 b) private pure returns (uint256) {
272
+ unchecked {
273
+ require(b != 0);
274
+ return a / b;
275
+ }
276
+ }
277
+
278
+ function divUp(uint256 a, uint256 b) private pure returns (uint256) {
279
+ unchecked {
280
+ require(b != 0);
281
+
282
+ if (a == 0) {
283
+ return 0;
284
+ } else {
285
+ return 1 + (a - 1) / b;
286
+ }
287
+ }
288
+ }
289
+ }