@pendle/core-v2 2.29.1 → 2.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (764) 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/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  10. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
  14. package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +4 -0
  15. package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.json +426 -0
  16. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
  18. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  19. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.json +2 -2
  20. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  21. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
  22. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  23. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  24. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
  25. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  26. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
  27. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  28. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  29. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  30. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  31. package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
  32. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -2
  34. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
  36. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
  38. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
  40. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/Market/PendleExternalRewardDistributor.sol/PendleExternalRewardDistributor.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/Market/PendleExternalRewardDistributor.sol/PendleExternalRewardDistributor.json +2 -2
  43. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +74 -9
  46. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
  48. package/build/artifacts/contracts/core/Market/v2/PendleGaugeV2.sol/PendleGaugeV2.dbg.json +1 -1
  49. package/build/artifacts/contracts/core/Market/v2/PendleMarketFactoryV2.sol/PendleMarketFactoryV2.dbg.json +1 -1
  50. package/build/artifacts/contracts/core/Market/v2/PendleMarketFactoryV2.sol/PendleMarketFactoryV2.json +2 -2
  51. package/build/artifacts/contracts/core/Market/v2/PendleMarketV2.sol/PendleMarketV2.dbg.json +1 -1
  52. package/build/artifacts/contracts/core/Market/v2/PendleMarketV2.sol/PendleMarketV2.json +74 -9
  53. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  54. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  55. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
  56. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.json +2 -2
  57. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
  58. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.json +65 -0
  59. package/build/artifacts/contracts/core/StandardizedYield/SYBaseUpg.sol/SYBaseUpg.dbg.json +4 -0
  60. package/build/artifacts/contracts/core/StandardizedYield/SYBaseUpg.sol/SYBaseUpg.json +976 -0
  61. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
  62. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json +65 -0
  63. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewardsUpg.sol/SYBaseWithRewardsUpg.dbg.json +4 -0
  64. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewardsUpg.sol/SYBaseWithRewardsUpg.json +1042 -0
  65. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
  66. package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +1 -1
  67. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.dbg.json +1 -1
  68. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.json +67 -2
  69. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
  70. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +67 -2
  71. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol/AuraEthxBbAWethSY.dbg.json +1 -1
  72. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol/AuraEthxBbAWethSY.json +67 -2
  73. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraSwEthBbAWethSYV2.sol/AuraSwEthBbAWethSYV2.dbg.json +1 -1
  74. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraSwEthBbAWethSYV2.sol/AuraSwEthBbAWethSYV2.json +67 -2
  75. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraWethVethSYUpg.sol/AuraWethVethSYUpg.dbg.json +4 -0
  76. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraWethVethSYUpg.sol/AuraWethVethSYUpg.json +1211 -0
  77. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
  78. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.json +67 -2
  79. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
  80. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.json +67 -2
  81. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
  82. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.json +67 -2
  83. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
  84. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.json +67 -2
  85. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
  86. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.json +67 -2
  87. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.dbg.json +1 -1
  88. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.json +67 -2
  89. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +1 -1
  90. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +1 -1
  91. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewProxy.sol/ComposableStablePreviewProxy.dbg.json +1 -1
  92. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewProxy.sol/ComposableStablePreviewProxy.json +2 -2
  93. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV4.sol/ComposableStablePreviewV4.dbg.json +1 -1
  94. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV4.sol/ComposableStablePreviewV4.json +2 -2
  95. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV5.sol/ComposableStablePreviewV5.dbg.json +1 -1
  96. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV5.sol/ComposableStablePreviewV5.json +2 -2
  97. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +1 -1
  98. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAPoolHelper.dbg.json +1 -1
  99. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAWethHelper.dbg.json +1 -1
  100. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearMath.sol/LinearMath.dbg.json +1 -1
  101. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol/LinearPreview.dbg.json +1 -1
  102. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol/LinearPreview.json +2 -2
  103. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +1 -1
  104. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +1 -1
  105. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +2 -2
  106. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
  107. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.json +65 -0
  108. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV3Upg.sol/PendleAuraBalancerStableLPSYV3Upg.dbg.json +4 -0
  109. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV3Upg.sol/PendleAuraBalancerStableLPSYV3Upg.json +1188 -0
  110. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +1 -1
  111. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +1 -1
  112. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
  113. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
  114. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
  115. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +67 -2
  116. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.dbg.json +1 -1
  117. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.json +2 -2
  118. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.dbg.json +1 -1
  119. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.json +2 -2
  120. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileLpHelper.sol/CamelotV1VolatileLpHelper.dbg.json +1 -1
  121. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.dbg.json +1 -1
  122. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.json +2 -2
  123. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
  124. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.json +67 -2
  125. package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol/PendleChainlinkReceiver.dbg.json +1 -1
  126. package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol/PendleChainlinkReceiver.json +2 -2
  127. package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol/PendleChainlinkRelayer.dbg.json +1 -1
  128. package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol/PendleChainlinkRelayer.json +2 -2
  129. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
  130. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +67 -2
  131. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
  132. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +67 -2
  133. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +1 -1
  134. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +2 -2
  135. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
  136. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +2 -2
  137. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
  138. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +2 -2
  139. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
  140. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.json +65 -0
  141. package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/FluxTokenLib.sol/FluxTokenLib.dbg.json +1 -1
  142. package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/PendleFluxLendingSY.sol/PendleFluxLendingSY.dbg.json +1 -1
  143. package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/PendleFluxLendingSY.sol/PendleFluxLendingSY.json +67 -2
  144. package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/GLPPreviewHelper.sol/GLPPreviewHelper.dbg.json +1 -1
  145. package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
  146. package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.json +67 -2
  147. package/build/artifacts/contracts/core/StandardizedYield/implementations/HMX/HLPPricingHelper.sol/HLPPricingHelper.dbg.json +1 -1
  148. package/build/artifacts/contracts/core/StandardizedYield/implementations/HMX/HLPPricingHelper.sol/HLPPricingHelper.json +2 -2
  149. package/build/artifacts/contracts/core/StandardizedYield/implementations/HMX/PendleHlpSY.sol/PendleHlpSY.dbg.json +1 -1
  150. package/build/artifacts/contracts/core/StandardizedYield/implementations/HMX/PendleHlpSY.sol/PendleHlpSY.json +67 -2
  151. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/KyberMathHelper.sol/KyberMathHelper.dbg.json +4 -0
  152. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/KyberMathHelper.sol/KyberMathHelper.json +375 -0
  153. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/KyberNftManagerBaseUpg.sol/KyberNftManagerBaseUpg.dbg.json +4 -0
  154. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/KyberNftManagerBaseUpg.sol/KyberNftManagerBaseUpg.json +82 -0
  155. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/PendleKyberElasticSYUpg.sol/PendleKyberElasticSYUpg.dbg.json +4 -0
  156. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/PendleKyberElasticSYUpg.sol/PendleKyberElasticSYUpg.json +1287 -0
  157. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/FullMath.sol/FullMath.dbg.json +4 -0
  158. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/FullMath.sol/FullMath.json +10 -0
  159. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiqDeltaMath.sol/LiqDeltaMath.dbg.json +4 -0
  160. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiqDeltaMath.sol/LiqDeltaMath.json +10 -0
  161. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiquidityMath.sol/LiquidityMath.dbg.json +4 -0
  162. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiquidityMath.sol/LiquidityMath.json +10 -0
  163. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/MathConstants.sol/MathConstants.dbg.json +4 -0
  164. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/MathConstants.sol/MathConstants.json +10 -0
  165. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/QtyDeltaMath.sol/QtyDeltaMath.dbg.json +4 -0
  166. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/QtyDeltaMath.sol/QtyDeltaMath.json +10 -0
  167. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/QuadMath.sol/QuadMath.dbg.json +4 -0
  168. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/QuadMath.sol/QuadMath.json +10 -0
  169. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/ReinvestmentMath.sol/ReinvestmentMath.dbg.json +4 -0
  170. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/ReinvestmentMath.sol/ReinvestmentMath.json +10 -0
  171. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/SafeCast.sol/SafeCast.dbg.json +4 -0
  172. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/SafeCast.sol/SafeCast.json +10 -0
  173. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/SwapMath.sol/SwapMath.dbg.json +4 -0
  174. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/SwapMath.sol/SwapMath.json +10 -0
  175. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/TickMath.sol/TickMath.dbg.json +4 -0
  176. package/build/artifacts/contracts/core/StandardizedYield/implementations/Kyber/libraries/TickMath.sol/TickMath.json +10 -0
  177. package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol/PendleMantleStakedEthSY.dbg.json +1 -1
  178. package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol/PendleMantleStakedEthSY.json +67 -2
  179. package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleOracleForSyProxy.sol/PendleOracleForSyProxy.dbg.json +1 -1
  180. package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleOracleForSyProxy.sol/PendleOracleForSyProxy.json +2 -2
  181. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.dbg.json +1 -1
  182. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.json +67 -2
  183. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleBridgedLSDSY.sol/PendleBridgedLSDSY.dbg.json +1 -1
  184. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleBridgedLSDSY.sol/PendleBridgedLSDSY.json +67 -2
  185. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626SY.sol/PendleERC4626SY.dbg.json +1 -1
  186. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626SY.sol/PendleERC4626SY.json +67 -2
  187. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleEUSDSY.sol/PendleEUSDSY.dbg.json +1 -1
  188. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleEUSDSY.sol/PendleEUSDSY.json +67 -2
  189. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
  190. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.json +67 -2
  191. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
  192. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +67 -2
  193. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
  194. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.json +67 -2
  195. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
  196. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.json +67 -2
  197. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.dbg.json +1 -1
  198. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.json +67 -2
  199. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
  200. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +67 -2
  201. package/build/artifacts/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveSY.sol/PendleSiloWithIncentiveSY.dbg.json +4 -0
  202. package/build/artifacts/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveSY.sol/PendleSiloWithIncentiveSY.json +1177 -0
  203. package/build/artifacts/contracts/core/StandardizedYield/implementations/Stader/PendleETHXSY.sol/PendleETHXSY.dbg.json +1 -1
  204. package/build/artifacts/contracts/core/StandardizedYield/implementations/Stader/PendleETHXSY.sol/PendleETHXSY.json +67 -2
  205. package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.dbg.json +1 -1
  206. package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.json +67 -2
  207. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.dbg.json +1 -1
  208. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.json +67 -2
  209. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol/ThenaLpHelper.dbg.json +1 -1
  210. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol/ThenaMath.dbg.json +1 -1
  211. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/IThenaSY.dbg.json +1 -1
  212. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/ThenaPreview.dbg.json +1 -1
  213. package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/ThenaPreview.json +2 -2
  214. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  215. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  216. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +67 -2
  217. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  218. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
  219. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  220. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +67 -2
  221. package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +1 -1
  222. package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
  223. package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.json +67 -2
  224. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
  225. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.json +2 -2
  226. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
  227. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.json +67 -2
  228. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
  229. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
  230. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
  231. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +67 -2
  232. package/build/artifacts/contracts/core/erc20/PendleERC20PermitUpg.sol/PendleERC20PermitUpg.dbg.json +4 -0
  233. package/build/artifacts/contracts/core/erc20/PendleERC20PermitUpg.sol/PendleERC20PermitUpg.json +370 -0
  234. package/build/artifacts/contracts/core/erc20/PendleERC20Upg.sol/PendleERC20Upg.dbg.json +4 -0
  235. package/build/artifacts/contracts/core/erc20/PendleERC20Upg.sol/PendleERC20Upg.json +246 -0
  236. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  237. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
  238. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
  239. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +2 -2
  240. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
  241. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
  242. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
  243. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
  244. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.json +2 -2
  245. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  246. package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
  247. package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
  248. package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
  249. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  250. package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
  251. package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.dbg.json +1 -1
  252. package/build/artifacts/contracts/interfaces/Ankr/IAnkrBNB.sol/IAnkrBNB.dbg.json +1 -1
  253. package/build/artifacts/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol/IAnkrLiquidStaking.dbg.json +1 -1
  254. package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +1 -1
  255. package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +1 -1
  256. package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +1 -1
  257. package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +1 -1
  258. package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +1 -1
  259. package/build/artifacts/contracts/interfaces/Balancer/IERC4626LinearPool.sol/IERC4626LinearPool.dbg.json +1 -1
  260. package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +1 -1
  261. package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +1 -1
  262. package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +1 -1
  263. package/build/artifacts/contracts/interfaces/Balancer/IPComposableStablePreview.sol/IPComposableStablePreview.dbg.json +1 -1
  264. package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +1 -1
  265. package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +1 -1
  266. package/build/artifacts/contracts/interfaces/Balancer/IVersion.sol/IVersion.dbg.json +1 -1
  267. package/build/artifacts/contracts/interfaces/BinanceEth/IWBETH.sol/IWBETH.dbg.json +1 -1
  268. package/build/artifacts/contracts/interfaces/Camelot/ICamelotFactory.sol/ICamelotFactory.dbg.json +1 -1
  269. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTFactory.sol/ICamelotNFTFactory.dbg.json +1 -1
  270. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTHandler.sol/ICamelotNFTHandler.dbg.json +1 -1
  271. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.dbg.json +1 -1
  272. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.json +1 -1
  273. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.dbg.json +1 -1
  274. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.json +1 -1
  275. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPoolFactory.sol/ICamelotNitroPoolFactory.dbg.json +1 -1
  276. package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.dbg.json +1 -1
  277. package/build/artifacts/contracts/interfaces/Camelot/ICamelotRouter.sol/ICamelotRouter.dbg.json +1 -1
  278. package/build/artifacts/contracts/interfaces/Camelot/ICamelotYieldBooster.sol/ICamelotYieldBooster.dbg.json +1 -1
  279. package/build/artifacts/contracts/interfaces/Camelot/IXGrail.sol/IXGrail.dbg.json +1 -1
  280. package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
  281. package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.dbg.json +1 -1
  282. package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.dbg.json +1 -1
  283. package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
  284. package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
  285. package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +1 -1
  286. package/build/artifacts/contracts/interfaces/Flux/IFluxErc20.sol/IFluxErc20.dbg.json +1 -1
  287. package/build/artifacts/contracts/interfaces/Flux/IFluxInterestRateModel.sol/IFluxInterestRateModel.dbg.json +1 -1
  288. package/build/artifacts/contracts/interfaces/Frax/IFrxEthMinter.sol/IFrxEthMinter.dbg.json +1 -1
  289. package/build/artifacts/contracts/interfaces/GMX/IGMXVault.sol/IGMXVault.dbg.json +1 -1
  290. package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.dbg.json +1 -1
  291. package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.dbg.json +1 -1
  292. package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.dbg.json +1 -1
  293. package/build/artifacts/contracts/interfaces/HMX/IHLPStaking.sol/IHLPStaking.dbg.json +1 -1
  294. package/build/artifacts/contracts/interfaces/HMX/IHMXCalculator.sol/IHMXCalculator.dbg.json +1 -1
  295. package/build/artifacts/contracts/interfaces/HMX/IHMXCompounder.sol/IHMXCompounder.dbg.json +1 -1
  296. package/build/artifacts/contracts/interfaces/HMX/IHMXStaking.sol/IHMXStaking.dbg.json +1 -1
  297. package/build/artifacts/contracts/interfaces/HMX/IHMXVester.sol/IHMXVester.dbg.json +1 -1
  298. package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
  299. package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +1 -1
  300. package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
  301. package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
  302. package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.dbg.json +1 -1
  303. package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.dbg.json +1 -1
  304. package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
  305. package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
  306. package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
  307. package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +1 -1
  308. package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +1 -1
  309. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  310. package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  311. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  312. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  313. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  314. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  315. package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
  316. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  317. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  318. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  319. package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
  320. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  321. package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
  322. package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +1 -1
  323. package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +1 -1
  324. package/build/artifacts/contracts/interfaces/IPExternalRewardDistributor.sol/IPExternalRewardDistributor.dbg.json +1 -1
  325. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  326. package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
  327. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  328. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  329. package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
  330. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  331. package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
  332. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  333. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  334. package/build/artifacts/contracts/interfaces/IPMarketFactoryV2.sol/IPMarketFactoryV2.dbg.json +1 -1
  335. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  336. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +4 -0
  337. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.json +150 -0
  338. package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
  339. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  340. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  341. package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
  342. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  343. package/build/artifacts/contracts/interfaces/IPPtOracle.sol/IPPtOracle.dbg.json +1 -1
  344. package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
  345. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  346. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  347. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  348. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  349. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  350. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  351. package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
  352. package/build/artifacts/contracts/interfaces/IPendlePreviewHelper.sol/IPendlePreviewHelper.dbg.json +1 -1
  353. package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
  354. package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
  355. package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
  356. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  357. package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
  358. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  359. package/build/artifacts/contracts/interfaces/IStargateLP.sol/IStargateLP.dbg.json +1 -1
  360. package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
  361. package/build/artifacts/contracts/interfaces/IStargateStaking.sol/IStargateStaking.dbg.json +1 -1
  362. package/build/artifacts/contracts/interfaces/ISwETH.sol/ISwETH.dbg.json +1 -1
  363. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  364. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  365. package/build/artifacts/contracts/interfaces/Kyber/IKyberElasticFactory.sol/IKyberElasticFactory.dbg.json +4 -0
  366. package/build/artifacts/contracts/interfaces/Kyber/IKyberElasticFactory.sol/IKyberElasticFactory.json +436 -0
  367. package/build/artifacts/contracts/interfaces/Kyber/IKyberElasticPool.sol/IKyberElasticPool.dbg.json +4 -0
  368. package/build/artifacts/contracts/interfaces/Kyber/IKyberElasticPool.sol/IKyberElasticPool.json +300 -0
  369. package/build/artifacts/contracts/interfaces/Kyber/IKyberElasticRouter.sol/IKyberElasticRouter.dbg.json +4 -0
  370. package/build/artifacts/contracts/interfaces/Kyber/IKyberElasticRouter.sol/IKyberElasticRouter.json +225 -0
  371. package/build/artifacts/contracts/interfaces/Kyber/IKyberLiquidityMining.sol/IKyberLiquidityMining.dbg.json +4 -0
  372. package/build/artifacts/contracts/interfaces/Kyber/IKyberLiquidityMining.sol/IKyberLiquidityMining.json +894 -0
  373. package/build/artifacts/contracts/interfaces/Kyber/IKyberMathHelper.sol/IKyberMathHelper.dbg.json +4 -0
  374. package/build/artifacts/contracts/interfaces/Kyber/IKyberMathHelper.sol/IKyberMathHelper.json +128 -0
  375. package/build/artifacts/contracts/interfaces/Kyber/IKyberPositionManager.sol/IKyberPositionManager.dbg.json +4 -0
  376. package/build/artifacts/contracts/interfaces/Kyber/IKyberPositionManager.sol/IKyberPositionManager.json +614 -0
  377. package/build/artifacts/contracts/interfaces/Lybra/IEUSD.sol/IEUSD.dbg.json +1 -1
  378. package/build/artifacts/contracts/interfaces/Silo/ISilo.sol/ISilo.dbg.json +4 -0
  379. package/build/artifacts/contracts/interfaces/Silo/ISilo.sol/ISilo.json +837 -0
  380. package/build/artifacts/contracts/interfaces/Silo/ISiloIncentiveController.sol/ISiloIncentiveController.dbg.json +4 -0
  381. package/build/artifacts/contracts/interfaces/Silo/ISiloIncentiveController.sol/ISiloIncentiveController.json +48 -0
  382. package/build/artifacts/contracts/interfaces/Silo/ISiloLens.sol/ISiloLens.dbg.json +4 -0
  383. package/build/artifacts/contracts/interfaces/Silo/ISiloLens.sol/ISiloLens.json +35 -0
  384. package/build/artifacts/contracts/interfaces/Stader/IStaderStakeManager.sol/IStaderStakeManager.dbg.json +1 -1
  385. package/build/artifacts/contracts/interfaces/Thena/IThenaFactory.sol/IThenaFactory.dbg.json +1 -1
  386. package/build/artifacts/contracts/interfaces/Thena/IThenaGaugeV2.sol/IThenaGaugeV2.dbg.json +1 -1
  387. package/build/artifacts/contracts/interfaces/Thena/IThenaPair.sol/IThenaPair.dbg.json +1 -1
  388. package/build/artifacts/contracts/interfaces/Thena/IThenaRouter.sol/IThenaRouter.dbg.json +1 -1
  389. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
  390. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.json +2 -2
  391. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
  392. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
  393. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
  394. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
  395. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  396. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +2 -2
  397. package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  398. package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  399. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
  400. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.json +2 -2
  401. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
  402. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
  403. package/build/artifacts/contracts/offchain-helpers/ChainlinkRelayerAutomation.sol/ChainlinkRelayerAutomation.dbg.json +1 -1
  404. package/build/artifacts/contracts/offchain-helpers/ChainlinkRelayerAutomation.sol/ChainlinkRelayerAutomation.json +2 -2
  405. package/build/artifacts/contracts/offchain-helpers/ChainlinkRelayerGelato.sol/ChainlinkRelayerGelato.dbg.json +1 -1
  406. package/build/artifacts/contracts/offchain-helpers/ChainlinkRelayerGelato.sol/ChainlinkRelayerGelato.json +2 -2
  407. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
  408. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.json +2 -2
  409. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
  410. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
  411. package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
  412. package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.json +2 -2
  413. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
  414. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
  415. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
  416. package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.dbg.json +1 -1
  417. package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.json +2 -2
  418. package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
  419. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  420. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
  421. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  422. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
  423. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  424. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
  425. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  426. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
  427. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  428. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
  429. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  430. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
  431. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  432. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
  433. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  434. package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  435. package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
  436. package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
  437. package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.json +2 -2
  438. package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
  439. package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.json +2 -2
  440. package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
  441. package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.json +2 -2
  442. package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
  443. package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.json +2 -2
  444. package/build/artifacts/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.dbg.json +1 -1
  445. package/build/artifacts/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.json +2 -2
  446. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  447. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
  448. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  449. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
  450. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  451. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  452. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  453. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
  454. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  455. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
  456. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  457. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  458. package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
  459. package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.json +2 -2
  460. package/build/artifacts/contracts/router/PendleRouterHelper2.sol/PendleRouterHelper2.dbg.json +4 -0
  461. package/build/artifacts/contracts/router/PendleRouterHelper2.sol/PendleRouterHelper2.json +145 -0
  462. package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
  463. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  464. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  465. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  466. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  467. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  468. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  469. package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
  470. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  471. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +2 -2
  472. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +1 -1
  473. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.dbg.json +1 -1
  474. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +1 -1
  475. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol/KyberInputScalingHelper.dbg.json +1 -1
  476. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.dbg.json +1 -1
  477. package/build/artifacts/contracts/router/swap-aggregator/oneinch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +1 -1
  478. package/build/artifacts/contracts/router/swap-aggregator/oneinch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +1 -1
  479. package/contracts/LiquidityMining/PendleMerkleDistributor.sol +95 -0
  480. package/contracts/core/StandardizedYield/SYBaseUpg.sol +224 -0
  481. package/contracts/core/StandardizedYield/SYBaseWithRewardsUpg.sol +120 -0
  482. package/contracts/core/StandardizedYield/implementations/BalancerStable/{PendleAuraWethVethSY.sol → AuraWethVethSYUpg.sol} +31 -33
  483. package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV3Upg.sol +363 -0
  484. package/contracts/core/StandardizedYield/implementations/Kyber/KyberMathHelper.sol +390 -0
  485. package/contracts/core/StandardizedYield/implementations/Kyber/KyberNftManagerBaseUpg.sol +411 -0
  486. package/contracts/core/StandardizedYield/implementations/Kyber/PendleKyberElasticSYUpg.sol +153 -0
  487. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/FullMath.sol +132 -0
  488. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiqDeltaMath.sol +18 -0
  489. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/LiquidityMath.sol +75 -0
  490. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/MathConstants.sol +21 -0
  491. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/QtyDeltaMath.sol +117 -0
  492. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/QuadMath.sol +37 -0
  493. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/ReinvestmentMath.sol +31 -0
  494. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/SafeCast.sol +75 -0
  495. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/SwapMath.sol +338 -0
  496. package/contracts/core/StandardizedYield/implementations/Kyber/libraries/TickMath.sol +224 -0
  497. package/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveSY.sol +165 -0
  498. package/contracts/core/erc20/PendleERC20PermitUpg.sol +87 -0
  499. package/contracts/core/erc20/PendleERC20Upg.sol +340 -0
  500. package/contracts/core/libraries/ArrayLib.sol +5 -0
  501. package/contracts/interfaces/IPMerkleDistributor.sol +24 -0
  502. package/contracts/interfaces/Kyber/IKyberElasticFactory.sol +165 -0
  503. package/contracts/interfaces/Kyber/IKyberElasticPool.sol +112 -0
  504. package/contracts/interfaces/Kyber/IKyberElasticRouter.sol +110 -0
  505. package/contracts/interfaces/Kyber/IKyberLiquidityMining.sol +227 -0
  506. package/contracts/interfaces/Kyber/IKyberMathHelper.sol +28 -0
  507. package/contracts/interfaces/Kyber/IKyberPositionManager.sol +196 -0
  508. package/contracts/interfaces/Silo/ISilo.sol +317 -0
  509. package/contracts/interfaces/Silo/ISiloIncentiveController.sol +19 -0
  510. package/contracts/interfaces/Silo/ISiloLens.sol +9 -0
  511. package/contracts/offchain-helpers/ChainlinkRelayerAutomation.sol +1 -1
  512. package/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol +41 -49
  513. package/contracts/router/PendleRouterHelper2.sol +40 -0
  514. package/deployments/1-core.json +1 -0
  515. package/deployments/1-markets/EPENDLE-SEP2024.json +12 -0
  516. package/deployments/1-markets/SFRAX-MARCH2024.json +10 -0
  517. package/deployments/1-markets/SILO-CRVUSD-MARCH2024.json +10 -0
  518. package/deployments/10-core.json +1 -0
  519. package/deployments/42161-core.json +1 -0
  520. package/deployments/42161-markets/KYBER-AXLWSTETH-WSTETH-MARCH2024.json +10 -0
  521. package/deployments/56-core.json +1 -0
  522. package/deployments/merkle-distribution/2023-10-26.json +7300 -0
  523. package/package.json +8 -8
  524. package/typechain-types/ActionLimitOrdersStatic.ts +262 -0
  525. package/typechain-types/AuraEthxBbAWethSY.ts +65 -0
  526. package/typechain-types/AuraSwEthBbAWethSYV2.ts +65 -0
  527. package/typechain-types/AuraWethVethSYUpg.ts +1612 -0
  528. package/typechain-types/EIP712.ts +135 -0
  529. package/typechain-types/EIP712Upgradeable.ts +144 -0
  530. package/typechain-types/ERC20Permit.ts +65 -0
  531. package/typechain-types/ICamelotNFTPool.ts +5 -5
  532. package/typechain-types/ICamelotNitroPool.ts +5 -5
  533. package/typechain-types/IDaiLikePermit.ts +146 -0
  534. package/typechain-types/IERC1967.ts +97 -0
  535. package/typechain-types/IERC5267.ts +135 -0
  536. package/typechain-types/IERC5267Upgradeable.ts +135 -0
  537. package/typechain-types/IERC721.ts +5 -5
  538. package/typechain-types/IKyberElasticFactory.ts +734 -0
  539. package/typechain-types/IKyberElasticPool.ts +514 -0
  540. package/typechain-types/IKyberElasticRouter.ts +315 -0
  541. package/typechain-types/IKyberLiquidityMining.ts +968 -0
  542. package/typechain-types/IKyberMathHelper.ts +231 -0
  543. package/typechain-types/IKyberPositionManager.ts +773 -0
  544. package/typechain-types/ILimitOrderCallee.ts +179 -0
  545. package/typechain-types/IPLimitRouter.ts +532 -0
  546. package/typechain-types/IPMerkleDistributor.ts +235 -0
  547. package/typechain-types/IPOrderMixin.ts +349 -0
  548. package/typechain-types/ISilo.ts +1093 -0
  549. package/typechain-types/ISiloIncentiveController.ts +129 -0
  550. package/typechain-types/ISiloLens.ts +107 -0
  551. package/typechain-types/KyberMathHelper.ts +604 -0
  552. package/typechain-types/KyberNftManagerBaseUpg.ts +148 -0
  553. package/typechain-types/NonceManager.ts +209 -0
  554. package/typechain-types/PendleAnkrBNBSY.ts +65 -0
  555. package/typechain-types/PendleArbitrumStakedEthSY.ts +65 -0
  556. package/typechain-types/PendleAuraBalancerStableLPSYV2.ts +65 -0
  557. package/typechain-types/PendleAuraBalancerStableLPSYV3Upg.ts +1577 -0
  558. package/typechain-types/PendleAuraBbAWethSwethSY.ts +65 -0
  559. package/typechain-types/PendleAuraWethAnkrethSYV2.ts +65 -0
  560. package/typechain-types/PendleAuraWethRocketEthSYV2.ts +65 -0
  561. package/typechain-types/PendleAuraWethStafiEthSY.ts +65 -0
  562. package/typechain-types/PendleAuraWethVethSY.ts +65 -0
  563. package/typechain-types/PendleAuraWethWstethSYV2.ts +65 -0
  564. package/typechain-types/PendleAuraWstethAnkreth.ts +65 -0
  565. package/typechain-types/PendleBridgedLSDSY.ts +65 -0
  566. package/typechain-types/PendleCamelotV1VolatileSY.ts +65 -0
  567. package/typechain-types/PendleConvexLPSY.ts +65 -0
  568. package/typechain-types/PendleCurveFraxUsdcSY.ts +65 -0
  569. package/typechain-types/PendleCurveUsdd3CrvSY.ts +65 -0
  570. package/typechain-types/PendleERC20Permit.ts +65 -0
  571. package/typechain-types/PendleERC20PermitUpg.ts +517 -0
  572. package/typechain-types/PendleERC20Upg.ts +348 -0
  573. package/typechain-types/PendleERC4626SY.ts +65 -0
  574. package/typechain-types/PendleETHXSY.ts +65 -0
  575. package/typechain-types/PendleEUSDSY.ts +65 -0
  576. package/typechain-types/PendleFluxLendingSY.ts +65 -0
  577. package/typechain-types/PendleGDaiSY.ts +65 -0
  578. package/typechain-types/PendleGlpSY.ts +65 -0
  579. package/typechain-types/PendleHlpSY.ts +65 -0
  580. package/typechain-types/PendleKyberElasticSY.ts +1583 -0
  581. package/typechain-types/PendleKyberElasticSYUpg.ts +1648 -0
  582. package/typechain-types/PendleLimitRouter.ts +936 -0
  583. package/typechain-types/PendleLooksStakingSY.ts +65 -0
  584. package/typechain-types/PendleMantleStakedEthSY.ts +65 -0
  585. package/typechain-types/PendleMarket.ts +65 -0
  586. package/typechain-types/PendleMarketV2.ts +65 -0
  587. package/typechain-types/PendleMerkleDistributor.ts +610 -0
  588. package/typechain-types/PendleOrderMixin.ts +753 -0
  589. package/typechain-types/PendlePrincipalToken.ts +65 -0
  590. package/typechain-types/PendlePrincipalTokenV2.ts +65 -0
  591. package/typechain-types/PendleQiTokenSY.ts +65 -0
  592. package/typechain-types/PendleRouterHelper2.ts +185 -0
  593. package/typechain-types/PendleSfrxEthSY.ts +65 -0
  594. package/typechain-types/PendleSiloWithIncentiveSY.ts +1455 -0
  595. package/typechain-types/PendleStargateLPSY.ts +65 -0
  596. package/typechain-types/PendleThenaSY.ts +65 -0
  597. package/typechain-types/PendleWbEthSY.ts +65 -0
  598. package/typechain-types/PendleWstEthSY.ts +65 -0
  599. package/typechain-types/PendleYieldToken.ts +65 -0
  600. package/typechain-types/PendleYieldTokenV2.ts +65 -0
  601. package/typechain-types/PredicateHelper.ts +298 -0
  602. package/typechain-types/RouterV2InterfaceForRouterHelper.ts +479 -0
  603. package/typechain-types/SAPE.ts +65 -0
  604. package/typechain-types/SYBase.ts +65 -0
  605. package/typechain-types/SYBaseUpg.ts +1270 -0
  606. package/typechain-types/SYBaseWithRewards.ts +65 -0
  607. package/typechain-types/SYBaseWithRewardsUpg.ts +1363 -0
  608. package/typechain-types/ShortStrings.ts +57 -0
  609. package/typechain-types/SimulateHelper.ts +146 -0
  610. package/typechain-types/SwETHSY.ts +65 -0
  611. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
  612. package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
  613. package/typechain-types/factories/ActionLimitOrdersStatic__factory.ts +499 -0
  614. package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
  615. package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
  616. package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
  617. package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
  618. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  619. package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
  620. package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
  621. package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
  622. package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
  623. package/typechain-types/factories/AddressProvider__factory.ts +1 -1
  624. package/typechain-types/factories/AuraEthxBbAWethSY__factory.ts +66 -1
  625. package/typechain-types/factories/AuraSwEthBbAWethSYV2__factory.ts +66 -1
  626. package/typechain-types/factories/AuraWethVethSYUpg__factory.ts +1264 -0
  627. package/typechain-types/factories/AutomationBase__factory.ts +1 -1
  628. package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +1 -1
  629. package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
  630. package/typechain-types/factories/Broadcaster__factory.ts +1 -1
  631. package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
  632. package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
  633. package/typechain-types/factories/BulkSeller__factory.ts +1 -1
  634. package/typechain-types/factories/CamelotRewardHelper__factory.ts +1 -1
  635. package/typechain-types/factories/CamelotV1VolatilePreview__factory.ts +1 -1
  636. package/typechain-types/factories/ChainlinkRelayerAutomation__factory.ts +1 -1
  637. package/typechain-types/factories/ChainlinkRelayerGelato__factory.ts +1 -1
  638. package/typechain-types/factories/ComposableStablePreviewProxy__factory.ts +1 -1
  639. package/typechain-types/factories/ComposableStablePreviewV4__factory.ts +1 -1
  640. package/typechain-types/factories/ComposableStablePreviewV5__factory.ts +1 -1
  641. package/typechain-types/factories/EIP712Upgradeable__factory.ts +88 -0
  642. package/typechain-types/factories/EIP712__factory.ts +85 -0
  643. package/typechain-types/factories/ERC20Permit__factory.ts +65 -0
  644. package/typechain-types/factories/ERC20__factory.ts +1 -1
  645. package/typechain-types/factories/EmptyUUPS__factory.ts +1 -1
  646. package/typechain-types/factories/HLPPricingHelper__factory.ts +1 -1
  647. package/typechain-types/factories/ICamelotNFTPool__factory.ts +1 -1
  648. package/typechain-types/factories/ICamelotNitroPool__factory.ts +1 -1
  649. package/typechain-types/factories/IDaiLikePermit__factory.ts +74 -0
  650. package/typechain-types/factories/IERC1967__factory.ts +68 -0
  651. package/typechain-types/factories/IERC5267Upgradeable__factory.ts +75 -0
  652. package/typechain-types/factories/IERC5267__factory.ts +72 -0
  653. package/typechain-types/factories/IERC721__factory.ts +1 -1
  654. package/typechain-types/factories/IKyberElasticFactory__factory.ts +455 -0
  655. package/typechain-types/factories/IKyberElasticPool__factory.ts +315 -0
  656. package/typechain-types/factories/IKyberElasticRouter__factory.ts +240 -0
  657. package/typechain-types/factories/IKyberLiquidityMining__factory.ts +913 -0
  658. package/typechain-types/factories/IKyberMathHelper__factory.ts +143 -0
  659. package/typechain-types/factories/IKyberPositionManager__factory.ts +633 -0
  660. package/typechain-types/factories/ILimitOrderCallee__factory.ts +92 -0
  661. package/typechain-types/factories/IPLimitRouter__factory.ts +670 -0
  662. package/typechain-types/factories/IPMerkleDistributor__factory.ts +165 -0
  663. package/typechain-types/factories/IPOrderMixin__factory.ts +450 -0
  664. package/typechain-types/factories/ISiloIncentiveController__factory.ts +67 -0
  665. package/typechain-types/factories/ISiloLens__factory.ts +47 -0
  666. package/typechain-types/factories/ISilo__factory.ts +846 -0
  667. package/typechain-types/factories/KyberMathHelper__factory.ts +430 -0
  668. package/typechain-types/factories/KyberNftManagerBaseUpg__factory.ts +101 -0
  669. package/typechain-types/factories/LinearPreview__factory.ts +1 -1
  670. package/typechain-types/factories/MetaStablePreview__factory.ts +1 -1
  671. package/typechain-types/factories/NonceManager__factory.ts +149 -0
  672. package/typechain-types/factories/PendleAnkrBNBSY__factory.ts +66 -1
  673. package/typechain-types/factories/PendleArbitrumStakedEthSY__factory.ts +66 -1
  674. package/typechain-types/factories/PendleAuraBalancerStableLPSYV2__factory.ts +65 -0
  675. package/typechain-types/factories/PendleAuraBalancerStableLPSYV3Upg__factory.ts +1209 -0
  676. package/typechain-types/factories/PendleAuraBbAWethSwethSY__factory.ts +66 -1
  677. package/typechain-types/factories/PendleAuraWethAnkrethSYV2__factory.ts +66 -1
  678. package/typechain-types/factories/PendleAuraWethRocketEthSYV2__factory.ts +66 -1
  679. package/typechain-types/factories/PendleAuraWethStafiEthSY__factory.ts +66 -1
  680. package/typechain-types/factories/PendleAuraWethVethSY__factory.ts +66 -1
  681. package/typechain-types/factories/PendleAuraWethWstethSYV2__factory.ts +66 -1
  682. package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +66 -1
  683. package/typechain-types/factories/PendleBridgedLSDSY__factory.ts +66 -1
  684. package/typechain-types/factories/PendleCamelotV1VolatileSY__factory.ts +66 -1
  685. package/typechain-types/factories/PendleChainlinkReceiver__factory.ts +1 -1
  686. package/typechain-types/factories/PendleChainlinkRelayer__factory.ts +1 -1
  687. package/typechain-types/factories/PendleConvexLPSY__factory.ts +65 -0
  688. package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +66 -1
  689. package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +66 -1
  690. package/typechain-types/factories/PendleERC20PermitUpg__factory.ts +389 -0
  691. package/typechain-types/factories/PendleERC20Permit__factory.ts +66 -1
  692. package/typechain-types/factories/PendleERC20Upg__factory.ts +261 -0
  693. package/typechain-types/factories/PendleERC20__factory.ts +1 -1
  694. package/typechain-types/factories/PendleERC4626SY__factory.ts +66 -1
  695. package/typechain-types/factories/PendleETHXSY__factory.ts +66 -1
  696. package/typechain-types/factories/PendleEUSDSY__factory.ts +66 -1
  697. package/typechain-types/factories/PendleExternalRewardDistributor__factory.ts +1 -1
  698. package/typechain-types/factories/PendleFeeDistributorV2__factory.ts +1 -1
  699. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  700. package/typechain-types/factories/PendleFluxLendingSY__factory.ts +66 -1
  701. package/typechain-types/factories/PendleGDaiSY__factory.ts +66 -1
  702. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
  703. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
  704. package/typechain-types/factories/PendleGlpSY__factory.ts +66 -1
  705. package/typechain-types/factories/PendleHlpSY__factory.ts +66 -1
  706. package/typechain-types/factories/PendleKyberElasticSYUpg__factory.ts +1351 -0
  707. package/typechain-types/factories/PendleKyberElasticSY__factory.ts +1302 -0
  708. package/typechain-types/factories/PendleLimitRouter__factory.ts +992 -0
  709. package/typechain-types/factories/PendleLooksStakingSY__factory.ts +66 -1
  710. package/typechain-types/factories/PendleLpGlpOracle__factory.ts +1 -1
  711. package/typechain-types/factories/PendleMantleStakedEthSY__factory.ts +66 -1
  712. package/typechain-types/factories/PendleMarketFactoryV2__factory.ts +1 -1
  713. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  714. package/typechain-types/factories/PendleMarketV2__factory.ts +66 -1
  715. package/typechain-types/factories/PendleMarket__factory.ts +66 -1
  716. package/typechain-types/factories/PendleMerkleDistributor__factory.ts +488 -0
  717. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  718. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  719. package/typechain-types/factories/PendleOracleForSyProxy__factory.ts +1 -1
  720. package/typechain-types/factories/PendleOrderMixin__factory.ts +718 -0
  721. package/typechain-types/factories/PendlePrincipalTokenV2__factory.ts +66 -1
  722. package/typechain-types/factories/PendlePrincipalToken__factory.ts +66 -1
  723. package/typechain-types/factories/PendlePtGlpOracle__factory.ts +1 -1
  724. package/typechain-types/factories/PendlePtOracle__factory.ts +1 -1
  725. package/typechain-types/factories/PendlePtUsdChainlinkOracle__factory.ts +1 -1
  726. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  727. package/typechain-types/factories/PendleQiTokenSY__factory.ts +66 -1
  728. package/typechain-types/factories/PendleRouterHelper2__factory.ts +206 -0
  729. package/typechain-types/factories/PendleRouterHelper__factory.ts +1 -1
  730. package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
  731. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  732. package/typechain-types/factories/PendleSfrxEthSY__factory.ts +66 -1
  733. package/typechain-types/factories/PendleSiloWithIncentiveSY__factory.ts +1266 -0
  734. package/typechain-types/factories/PendleStargateLPSY__factory.ts +66 -1
  735. package/typechain-types/factories/PendleSwap__factory.ts +1 -1
  736. package/typechain-types/factories/PendleThenaSY__factory.ts +66 -1
  737. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  738. package/typechain-types/factories/PendleWbEthSY__factory.ts +66 -1
  739. package/typechain-types/factories/PendleWstEthSY__factory.ts +66 -1
  740. package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +1 -1
  741. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
  742. package/typechain-types/factories/PendleYieldTokenV2__factory.ts +66 -1
  743. package/typechain-types/factories/PendleYieldToken__factory.ts +66 -1
  744. package/typechain-types/factories/PredicateHelper__factory.ts +218 -0
  745. package/typechain-types/factories/PtAndLpToAsset__factory.ts +1 -1
  746. package/typechain-types/factories/RouterV2InterfaceForRouterHelper__factory.ts +487 -0
  747. package/typechain-types/factories/SAPE__factory.ts +66 -1
  748. package/typechain-types/factories/SYBaseUpg__factory.ts +988 -0
  749. package/typechain-types/factories/SYBaseWithRewardsUpg__factory.ts +1061 -0
  750. package/typechain-types/factories/SYBaseWithRewards__factory.ts +65 -0
  751. package/typechain-types/factories/SYBase__factory.ts +65 -0
  752. package/typechain-types/factories/ShortStrings__factory.ts +77 -0
  753. package/typechain-types/factories/SimulateHelper__factory.ts +84 -0
  754. package/typechain-types/factories/SwETHSY__factory.ts +66 -1
  755. package/typechain-types/factories/ThenaPreview__factory.ts +1 -1
  756. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  757. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  758. package/typechain-types/hardhat.d.ts +350 -17
  759. package/typechain-types/index.ts +78 -4
  760. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.dbg.json +0 -4
  761. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.json +0 -1166
  762. package/deployments/1-markets/BALANCER-LP-AURA-VETH-WETH-SEP2024.json +0 -8
  763. /package/deployments/1-markets/{BALANCER-LP-AURA-BBAWETHSWETH-SEP-26-2024.json → deprecated/BALANCER-LP-AURA-BBAWETHSWETH-SEP-26-2024.json} +0 -0
  764. /package/deployments/1-markets/{BALANCER-LP-AURA-ETHX-BBAWETH-SEP-26-2024.json → deprecated/BALANCER-LP-AURA-ETHX-BBAWETH-SEP-26-2024.json} +0 -0
@@ -0,0 +1,338 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.0;
3
+
4
+ import { MathConstants as C } from "./MathConstants.sol";
5
+ import { FullMath } from "./FullMath.sol";
6
+ import { QuadMath } from "./QuadMath.sol";
7
+ import { SafeCast } from "./SafeCast.sol";
8
+
9
+
10
+ /**
11
+ * --------- [DIRECT COPIED FROM KYBERSWAP] ---------
12
+ */
13
+
14
+
15
+ /// @title Contains helper functions for swaps
16
+ library SwapMath {
17
+ using SafeCast for uint256;
18
+ using SafeCast for int256;
19
+
20
+ /// @dev Computes the actual swap input / output amounts to be deducted or added,
21
+ /// the swap fee to be collected and the resulting sqrtP.
22
+ /// @notice nextSqrtP should not exceed targetSqrtP.
23
+ /// @param liquidity active base liquidity + reinvest liquidity
24
+ /// @param currentSqrtP current sqrt price
25
+ /// @param targetSqrtP sqrt price limit the new sqrt price can take
26
+ /// @param feeInFeeUnits swap fee in basis points
27
+ /// @param specifiedAmount the amount remaining to be used for the swap
28
+ /// @param isExactInput true if specifiedAmount refers to input amount, false if specifiedAmount refers to output amount
29
+ /// @param isToken0 true if specifiedAmount is in token0, false if specifiedAmount is in token1
30
+ /// @return usedAmount actual amount to be used for the swap
31
+ /// @return returnedAmount output qty to be accumulated if isExactInput = true, input qty if isExactInput = false
32
+ /// @return deltaL collected swap fee, to be incremented to reinvest liquidity
33
+ /// @return nextSqrtP the new sqrt price after the computed swap step
34
+ function computeSwapStep(
35
+ uint256 liquidity,
36
+ uint160 currentSqrtP,
37
+ uint160 targetSqrtP,
38
+ uint256 feeInFeeUnits,
39
+ int256 specifiedAmount,
40
+ bool isExactInput,
41
+ bool isToken0
42
+ )
43
+ internal
44
+ pure
45
+ returns (int256 usedAmount, int256 returnedAmount, uint256 deltaL, uint160 nextSqrtP)
46
+ {
47
+ // in the event currentSqrtP == targetSqrtP because of tick movements, return
48
+ // eg. swapped up tick where specified price limit is on an initialised tick
49
+ // then swapping down tick will cause next tick to be the same as the current tick
50
+ if (currentSqrtP == targetSqrtP) return (0, 0, 0, currentSqrtP);
51
+ usedAmount = calcReachAmount(
52
+ liquidity,
53
+ currentSqrtP,
54
+ targetSqrtP,
55
+ feeInFeeUnits,
56
+ isExactInput,
57
+ isToken0
58
+ );
59
+
60
+ if (
61
+ (isExactInput && usedAmount > specifiedAmount) ||
62
+ (!isExactInput && usedAmount <= specifiedAmount)
63
+ ) {
64
+ usedAmount = specifiedAmount;
65
+ } else {
66
+ nextSqrtP = targetSqrtP;
67
+ }
68
+
69
+ uint256 absDelta = usedAmount >= 0 ? uint256(usedAmount) : usedAmount.revToUint256();
70
+ if (nextSqrtP == 0) {
71
+ deltaL = estimateIncrementalLiquidity(
72
+ absDelta,
73
+ liquidity,
74
+ currentSqrtP,
75
+ feeInFeeUnits,
76
+ isExactInput,
77
+ isToken0
78
+ );
79
+ nextSqrtP = calcFinalPrice(
80
+ absDelta,
81
+ liquidity,
82
+ deltaL,
83
+ currentSqrtP,
84
+ isExactInput,
85
+ isToken0
86
+ ).toUint160();
87
+ } else {
88
+ deltaL = calcIncrementalLiquidity(
89
+ absDelta,
90
+ liquidity,
91
+ currentSqrtP,
92
+ nextSqrtP,
93
+ isExactInput,
94
+ isToken0
95
+ );
96
+ }
97
+ returnedAmount = calcReturnedAmount(
98
+ liquidity,
99
+ currentSqrtP,
100
+ nextSqrtP,
101
+ deltaL,
102
+ isExactInput,
103
+ isToken0
104
+ );
105
+ }
106
+
107
+ /// @dev calculates the amount needed to reach targetSqrtP from currentSqrtP
108
+ /// @dev we cast currentSqrtP and targetSqrtP to uint256 as they are multiplied by TWO_FEE_UNITS or feeInFeeUnits
109
+ function calcReachAmount(
110
+ uint256 liquidity,
111
+ uint256 currentSqrtP,
112
+ uint256 targetSqrtP,
113
+ uint256 feeInFeeUnits,
114
+ bool isExactInput,
115
+ bool isToken0
116
+ ) internal pure returns (int256 reachAmount) {
117
+ uint256 absPriceDiff;
118
+ unchecked {
119
+ absPriceDiff = (currentSqrtP >= targetSqrtP)
120
+ ? (currentSqrtP - targetSqrtP)
121
+ : (targetSqrtP - currentSqrtP);
122
+ }
123
+ if (isExactInput) {
124
+ // we round down so that we avoid taking giving away too much for the specified input
125
+ // ie. require less input qty to move ticks
126
+ if (isToken0) {
127
+ // numerator = 2 * liquidity * absPriceDiff
128
+ // denominator = currentSqrtP * (2 * targetSqrtP - currentSqrtP * feeInFeeUnits / FEE_UNITS)
129
+ // overflow should not happen because the absPriceDiff is capped to ~5%
130
+ uint256 denominator = C.TWO_FEE_UNITS * targetSqrtP - feeInFeeUnits * currentSqrtP;
131
+ uint256 numerator = FullMath.mulDivFloor(
132
+ liquidity,
133
+ C.TWO_FEE_UNITS * absPriceDiff,
134
+ denominator
135
+ );
136
+ reachAmount = FullMath
137
+ .mulDivFloor(numerator, C.TWO_POW_96, currentSqrtP)
138
+ .toInt256();
139
+ } else {
140
+ // numerator = 2 * liquidity * absPriceDiff * currentSqrtP
141
+ // denominator = 2 * currentSqrtP - targetSqrtP * feeInFeeUnits / FEE_UNITS
142
+ // overflow should not happen because the absPriceDiff is capped to ~5%
143
+ uint256 denominator = C.TWO_FEE_UNITS * currentSqrtP - feeInFeeUnits * targetSqrtP;
144
+ uint256 numerator = FullMath.mulDivFloor(
145
+ liquidity,
146
+ C.TWO_FEE_UNITS * absPriceDiff,
147
+ denominator
148
+ );
149
+ reachAmount = FullMath
150
+ .mulDivFloor(numerator, currentSqrtP, C.TWO_POW_96)
151
+ .toInt256();
152
+ }
153
+ } else {
154
+ // we will perform negation as the last step
155
+ // we round down so that we require less output qty to move ticks
156
+ if (isToken0) {
157
+ // numerator: (liquidity)(absPriceDiff)(2 * currentSqrtP - deltaL * (currentSqrtP + targetSqrtP))
158
+ // denominator: (currentSqrtP * targetSqrtP) * (2 * currentSqrtP - deltaL * targetSqrtP)
159
+ // overflow should not happen because the absPriceDiff is capped to ~5%
160
+ uint256 denominator = C.TWO_FEE_UNITS * currentSqrtP - feeInFeeUnits * targetSqrtP;
161
+ uint256 numerator = denominator - feeInFeeUnits * currentSqrtP;
162
+ numerator = FullMath.mulDivFloor(liquidity << C.RES_96, numerator, denominator);
163
+ reachAmount = (FullMath.mulDivFloor(numerator, absPriceDiff, currentSqrtP) /
164
+ targetSqrtP).revToInt256();
165
+ } else {
166
+ // numerator: liquidity * absPriceDiff * (TWO_FEE_UNITS * targetSqrtP - feeInFeeUnits * (targetSqrtP + currentSqrtP))
167
+ // denominator: (TWO_FEE_UNITS * targetSqrtP - feeInFeeUnits * currentSqrtP)
168
+ // overflow should not happen because the absPriceDiff is capped to ~5%
169
+ uint256 denominator = C.TWO_FEE_UNITS * targetSqrtP - feeInFeeUnits * currentSqrtP;
170
+ uint256 numerator = denominator - feeInFeeUnits * targetSqrtP;
171
+ numerator = FullMath.mulDivFloor(liquidity, numerator, denominator);
172
+ reachAmount = FullMath
173
+ .mulDivFloor(numerator, absPriceDiff, C.TWO_POW_96)
174
+ .revToInt256();
175
+ }
176
+ }
177
+ }
178
+
179
+ /// @dev estimates deltaL, the swap fee to be collected based on amount specified
180
+ /// for the final swap step to be performed,
181
+ /// where the next (temporary) tick will not be crossed
182
+ function estimateIncrementalLiquidity(
183
+ uint256 absDelta,
184
+ uint256 liquidity,
185
+ uint160 currentSqrtP,
186
+ uint256 feeInFeeUnits,
187
+ bool isExactInput,
188
+ bool isToken0
189
+ ) internal pure returns (uint256 deltaL) {
190
+ if (isExactInput) {
191
+ if (isToken0) {
192
+ // deltaL = feeInFeeUnits * absDelta * currentSqrtP / 2
193
+ deltaL = FullMath.mulDivFloor(
194
+ currentSqrtP,
195
+ absDelta * feeInFeeUnits,
196
+ C.TWO_FEE_UNITS << C.RES_96
197
+ );
198
+ } else {
199
+ // deltaL = feeInFeeUnits * absDelta * / (currentSqrtP * 2)
200
+ // Because nextSqrtP = (liquidity + absDelta / currentSqrtP) * currentSqrtP / (liquidity + deltaL)
201
+ // so we round up deltaL, to round down nextSqrtP
202
+ deltaL = FullMath.mulDivFloor(
203
+ C.TWO_POW_96,
204
+ absDelta * feeInFeeUnits,
205
+ C.TWO_FEE_UNITS * currentSqrtP
206
+ );
207
+ }
208
+ } else {
209
+ // obtain the smaller root of the quadratic equation
210
+ // ax^2 - 2bx + c = 0 such that b > 0, and x denotes deltaL
211
+ uint256 a = feeInFeeUnits;
212
+ uint256 b = (C.FEE_UNITS - feeInFeeUnits) * liquidity;
213
+ uint256 c = feeInFeeUnits * liquidity * absDelta;
214
+ if (isToken0) {
215
+ // a = feeInFeeUnits
216
+ // b = (FEE_UNITS - feeInFeeUnits) * liquidity - FEE_UNITS * absDelta * currentSqrtP
217
+ // c = feeInFeeUnits * liquidity * absDelta * currentSqrtP
218
+ b -= FullMath.mulDivFloor(C.FEE_UNITS * absDelta, currentSqrtP, C.TWO_POW_96);
219
+ c = FullMath.mulDivFloor(c, currentSqrtP, C.TWO_POW_96);
220
+ } else {
221
+ // a = feeInFeeUnits
222
+ // b = (FEE_UNITS - feeInFeeUnits) * liquidity - FEE_UNITS * absDelta / currentSqrtP
223
+ // c = liquidity * feeInFeeUnits * absDelta / currentSqrtP
224
+ b -= FullMath.mulDivFloor(C.FEE_UNITS * absDelta, C.TWO_POW_96, currentSqrtP);
225
+ c = FullMath.mulDivFloor(c, C.TWO_POW_96, currentSqrtP);
226
+ }
227
+ deltaL = QuadMath.getSmallerRootOfQuadEqn(a, b, c);
228
+ }
229
+ }
230
+
231
+ /// @dev calculates deltaL, the swap fee to be collected for an intermediate swap step,
232
+ /// where the next (temporary) tick will be crossed
233
+ function calcIncrementalLiquidity(
234
+ uint256 absDelta,
235
+ uint256 liquidity,
236
+ uint160 currentSqrtP,
237
+ uint160 nextSqrtP,
238
+ bool isExactInput,
239
+ bool isToken0
240
+ ) internal pure returns (uint256 deltaL) {
241
+ if (isToken0) {
242
+ // deltaL = nextSqrtP * (liquidity / currentSqrtP +/- absDelta)) - liquidity
243
+ // needs to be minimum
244
+ uint256 tmp1 = FullMath.mulDivFloor(liquidity, C.TWO_POW_96, currentSqrtP);
245
+ uint256 tmp2 = isExactInput ? tmp1 + absDelta : tmp1 - absDelta;
246
+ uint256 tmp3 = FullMath.mulDivFloor(nextSqrtP, tmp2, C.TWO_POW_96);
247
+ // in edge cases where liquidity or absDelta is small
248
+ // liquidity might be greater than nextSqrtP * ((liquidity / currentSqrtP) +/- absDelta))
249
+ // due to rounding
250
+ deltaL = (tmp3 > liquidity) ? tmp3 - liquidity : 0;
251
+ } else {
252
+ // deltaL = (liquidity * currentSqrtP +/- absDelta) / nextSqrtP - liquidity
253
+ // needs to be minimum
254
+ uint256 tmp1 = FullMath.mulDivFloor(liquidity, currentSqrtP, C.TWO_POW_96);
255
+ uint256 tmp2 = isExactInput ? tmp1 + absDelta : tmp1 - absDelta;
256
+ uint256 tmp3 = FullMath.mulDivFloor(tmp2, C.TWO_POW_96, nextSqrtP);
257
+ // in edge cases where liquidity or absDelta is small
258
+ // liquidity might be greater than nextSqrtP * ((liquidity / currentSqrtP) +/- absDelta))
259
+ // due to rounding
260
+ deltaL = (tmp3 > liquidity) ? tmp3 - liquidity : 0;
261
+ }
262
+ }
263
+
264
+ /// @dev calculates the sqrt price of the final swap step
265
+ /// where the next (temporary) tick will not be crossed
266
+ function calcFinalPrice(
267
+ uint256 absDelta,
268
+ uint256 liquidity,
269
+ uint256 deltaL,
270
+ uint160 currentSqrtP,
271
+ bool isExactInput,
272
+ bool isToken0
273
+ ) internal pure returns (uint256) {
274
+ if (isToken0) {
275
+ // if isExactInput: swap 0 -> 1, sqrtP decreases, we round up
276
+ // else swap: 1 -> 0, sqrtP increases, we round down
277
+ uint256 tmp = FullMath.mulDivFloor(absDelta, currentSqrtP, C.TWO_POW_96);
278
+ if (isExactInput) {
279
+ return FullMath.mulDivCeiling(liquidity + deltaL, currentSqrtP, liquidity + tmp);
280
+ } else {
281
+ return FullMath.mulDivFloor(liquidity + deltaL, currentSqrtP, liquidity - tmp);
282
+ }
283
+ } else {
284
+ // if isExactInput: swap 1 -> 0, sqrtP increases, we round down
285
+ // else swap: 0 -> 1, sqrtP decreases, we round up
286
+ uint256 tmp = FullMath.mulDivFloor(absDelta, C.TWO_POW_96, currentSqrtP);
287
+ if (isExactInput) {
288
+ return FullMath.mulDivFloor(liquidity + tmp, currentSqrtP, liquidity + deltaL);
289
+ } else {
290
+ return FullMath.mulDivCeiling(liquidity - tmp, currentSqrtP, liquidity + deltaL);
291
+ }
292
+ }
293
+ }
294
+
295
+ /// @dev calculates returned output | input tokens in exchange for specified amount
296
+ /// @dev round down when calculating returned output (isExactInput) so we avoid sending too much
297
+ /// @dev round up when calculating returned input (!isExactInput) so we get desired output amount
298
+ function calcReturnedAmount(
299
+ uint256 liquidity,
300
+ uint160 currentSqrtP,
301
+ uint160 nextSqrtP,
302
+ uint256 deltaL,
303
+ bool isExactInput,
304
+ bool isToken0
305
+ ) internal pure returns (int256 returnedAmount) {
306
+ if (isToken0) {
307
+ if (isExactInput) {
308
+ // minimise actual output (<0, make less negative) so we avoid sending too much
309
+ // returnedAmount = deltaL * nextSqrtP - liquidity * (currentSqrtP - nextSqrtP)
310
+ returnedAmount =
311
+ FullMath.mulDivCeiling(deltaL, nextSqrtP, C.TWO_POW_96).toInt256() +
312
+ FullMath
313
+ .mulDivFloor(liquidity, currentSqrtP - nextSqrtP, C.TWO_POW_96)
314
+ .revToInt256();
315
+ } else {
316
+ // maximise actual input (>0) so we get desired output amount
317
+ // returnedAmount = deltaL * nextSqrtP + liquidity * (nextSqrtP - currentSqrtP)
318
+ returnedAmount =
319
+ FullMath.mulDivCeiling(deltaL, nextSqrtP, C.TWO_POW_96).toInt256() +
320
+ FullMath
321
+ .mulDivCeiling(liquidity, nextSqrtP - currentSqrtP, C.TWO_POW_96)
322
+ .toInt256();
323
+ }
324
+ } else {
325
+ // returnedAmount = (liquidity + deltaL)/nextSqrtP - (liquidity)/currentSqrtP
326
+ // if exactInput, minimise actual output (<0, make less negative) so we avoid sending too much
327
+ // if exactOutput, maximise actual input (>0) so we get desired output amount
328
+ returnedAmount =
329
+ FullMath.mulDivCeiling(liquidity + deltaL, C.TWO_POW_96, nextSqrtP).toInt256() +
330
+ FullMath.mulDivFloor(liquidity, C.TWO_POW_96, currentSqrtP).revToInt256();
331
+ }
332
+
333
+ if (isExactInput && returnedAmount == 1) {
334
+ // rounding make returnedAmount == 1
335
+ returnedAmount = 0;
336
+ }
337
+ }
338
+ }
@@ -0,0 +1,224 @@
1
+ // SPDX-License-Identifier: GPL-2.0-or-later
2
+ pragma solidity >=0.8.0;
3
+
4
+
5
+ /**
6
+ * --------- [DIRECT COPIED FROM KYBERSWAP] ---------
7
+ */
8
+
9
+ /// @title Math library for computing sqrt prices from ticks and vice versa
10
+ /// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
11
+ /// prices between 2**-128 and 2**128
12
+ library TickMath {
13
+ /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
14
+ int24 internal constant MIN_TICK = -887272;
15
+ /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
16
+ int24 internal constant MAX_TICK = -MIN_TICK;
17
+
18
+ /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
19
+ uint160 internal constant MIN_SQRT_RATIO = 4295128739;
20
+ /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
21
+ uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;
22
+
23
+ /// @notice Calculates sqrt(1.0001^tick) * 2^96
24
+ /// @dev Throws if |tick| > max tick
25
+ /// @param tick The input tick for the above formula
26
+ /// @return sqrtP A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
27
+ /// at the given tick
28
+ function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtP) {
29
+ unchecked {
30
+ uint256 absTick = uint256(tick < 0 ? -int256(tick) : int256(tick));
31
+ require(absTick <= uint256(int256(MAX_TICK)), 'T');
32
+
33
+ // do bitwise comparison, if i-th bit is turned on,
34
+ // multiply ratio by hardcoded values of sqrt(1.0001^-(2^i)) * 2^128
35
+ // where 0 <= i <= 19
36
+ uint256 ratio = (absTick & 0x1 != 0)
37
+ ? 0xfffcb933bd6fad37aa2d162d1a594001
38
+ : 0x100000000000000000000000000000000;
39
+ if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
40
+ if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
41
+ if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
42
+ if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
43
+ if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
44
+ if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
45
+ if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
46
+ if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
47
+ if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
48
+ if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
49
+ if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
50
+ if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
51
+ if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
52
+ if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
53
+ if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
54
+ if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
55
+ if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
56
+ if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
57
+ if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;
58
+
59
+ // take reciprocal for positive tick values
60
+ if (tick > 0) ratio = type(uint256).max / ratio;
61
+
62
+ // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
63
+ // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
64
+ // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
65
+ sqrtP = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
66
+ }
67
+ }
68
+
69
+ /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
70
+ /// @dev Throws in case sqrtP < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
71
+ /// ever return.
72
+ /// @param sqrtP The sqrt ratio for which to compute the tick as a Q64.96
73
+ /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
74
+ function getTickAtSqrtRatio(uint160 sqrtP) internal pure returns (int24 tick) {
75
+ // second inequality must be < because the price can never reach the price at the max tick
76
+ require(sqrtP >= MIN_SQRT_RATIO && sqrtP < MAX_SQRT_RATIO, 'R');
77
+ uint256 ratio = uint256(sqrtP) << 32;
78
+
79
+ uint256 r = ratio;
80
+ uint256 msb = 0;
81
+
82
+ unchecked {
83
+ assembly {
84
+ let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
85
+ msb := or(msb, f)
86
+ r := shr(f, r)
87
+ }
88
+ assembly {
89
+ let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
90
+ msb := or(msb, f)
91
+ r := shr(f, r)
92
+ }
93
+ assembly {
94
+ let f := shl(5, gt(r, 0xFFFFFFFF))
95
+ msb := or(msb, f)
96
+ r := shr(f, r)
97
+ }
98
+ assembly {
99
+ let f := shl(4, gt(r, 0xFFFF))
100
+ msb := or(msb, f)
101
+ r := shr(f, r)
102
+ }
103
+ assembly {
104
+ let f := shl(3, gt(r, 0xFF))
105
+ msb := or(msb, f)
106
+ r := shr(f, r)
107
+ }
108
+ assembly {
109
+ let f := shl(2, gt(r, 0xF))
110
+ msb := or(msb, f)
111
+ r := shr(f, r)
112
+ }
113
+ assembly {
114
+ let f := shl(1, gt(r, 0x3))
115
+ msb := or(msb, f)
116
+ r := shr(f, r)
117
+ }
118
+ assembly {
119
+ let f := gt(r, 0x1)
120
+ msb := or(msb, f)
121
+ }
122
+
123
+ if (msb >= 128) r = ratio >> (msb - 127);
124
+ else r = ratio << (127 - msb);
125
+
126
+ int256 log_2 = (int256(msb) - 128) << 64;
127
+
128
+ assembly {
129
+ r := shr(127, mul(r, r))
130
+ let f := shr(128, r)
131
+ log_2 := or(log_2, shl(63, f))
132
+ r := shr(f, r)
133
+ }
134
+ assembly {
135
+ r := shr(127, mul(r, r))
136
+ let f := shr(128, r)
137
+ log_2 := or(log_2, shl(62, f))
138
+ r := shr(f, r)
139
+ }
140
+ assembly {
141
+ r := shr(127, mul(r, r))
142
+ let f := shr(128, r)
143
+ log_2 := or(log_2, shl(61, f))
144
+ r := shr(f, r)
145
+ }
146
+ assembly {
147
+ r := shr(127, mul(r, r))
148
+ let f := shr(128, r)
149
+ log_2 := or(log_2, shl(60, f))
150
+ r := shr(f, r)
151
+ }
152
+ assembly {
153
+ r := shr(127, mul(r, r))
154
+ let f := shr(128, r)
155
+ log_2 := or(log_2, shl(59, f))
156
+ r := shr(f, r)
157
+ }
158
+ assembly {
159
+ r := shr(127, mul(r, r))
160
+ let f := shr(128, r)
161
+ log_2 := or(log_2, shl(58, f))
162
+ r := shr(f, r)
163
+ }
164
+ assembly {
165
+ r := shr(127, mul(r, r))
166
+ let f := shr(128, r)
167
+ log_2 := or(log_2, shl(57, f))
168
+ r := shr(f, r)
169
+ }
170
+ assembly {
171
+ r := shr(127, mul(r, r))
172
+ let f := shr(128, r)
173
+ log_2 := or(log_2, shl(56, f))
174
+ r := shr(f, r)
175
+ }
176
+ assembly {
177
+ r := shr(127, mul(r, r))
178
+ let f := shr(128, r)
179
+ log_2 := or(log_2, shl(55, f))
180
+ r := shr(f, r)
181
+ }
182
+ assembly {
183
+ r := shr(127, mul(r, r))
184
+ let f := shr(128, r)
185
+ log_2 := or(log_2, shl(54, f))
186
+ r := shr(f, r)
187
+ }
188
+ assembly {
189
+ r := shr(127, mul(r, r))
190
+ let f := shr(128, r)
191
+ log_2 := or(log_2, shl(53, f))
192
+ r := shr(f, r)
193
+ }
194
+ assembly {
195
+ r := shr(127, mul(r, r))
196
+ let f := shr(128, r)
197
+ log_2 := or(log_2, shl(52, f))
198
+ r := shr(f, r)
199
+ }
200
+ assembly {
201
+ r := shr(127, mul(r, r))
202
+ let f := shr(128, r)
203
+ log_2 := or(log_2, shl(51, f))
204
+ r := shr(f, r)
205
+ }
206
+ assembly {
207
+ r := shr(127, mul(r, r))
208
+ let f := shr(128, r)
209
+ log_2 := or(log_2, shl(50, f))
210
+ }
211
+
212
+ int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number
213
+
214
+ int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
215
+ int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);
216
+
217
+ tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtP ? tickHi : tickLow;
218
+ }
219
+ }
220
+
221
+ function getMaxNumberTicks(int24 _tickDistance) internal pure returns (uint24 numTicks) {
222
+ return uint24(TickMath.MAX_TICK / _tickDistance) * 2;
223
+ }
224
+ }