@pendle/core-v2 2.17.7-tradingbot → 2.18.0-tradingbot

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 (216) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
  6. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  10. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  12. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  14. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  16. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  18. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  19. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
  20. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
  21. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
  22. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  23. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  24. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  25. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  26. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  27. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  28. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  29. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
  30. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
  32. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
  34. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
  36. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAPoolHelper.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAWethHelper.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearMath.sol/LinearMath.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol/LinearPreview.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
  48. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
  49. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.dbg.json +1 -1
  50. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.dbg.json +1 -1
  51. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileLpHelper.sol/CamelotV1VolatileLpHelper.dbg.json +1 -1
  52. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.dbg.json +1 -1
  53. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
  54. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +1 -1
  57. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
  58. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
  59. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
  60. package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
  61. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
  62. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
  63. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
  65. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
  66. package/build/artifacts/contracts/core/TradingBot/BotActionCallback.sol/BotActionCallback.dbg.json +1 -1
  67. package/build/artifacts/contracts/core/TradingBot/BotActionCallback.sol/BotActionCallback.json +32 -17
  68. package/build/artifacts/contracts/core/TradingBot/BotActionHelper.sol/BotActionHelper.dbg.json +1 -1
  69. package/build/artifacts/contracts/core/TradingBot/BotActionHelper.sol/BotActionHelper.json +32 -17
  70. package/build/artifacts/contracts/core/TradingBot/BotSimulationLib.sol/BotSimulationLib.dbg.json +1 -1
  71. package/build/artifacts/contracts/core/TradingBot/BotSimulationLib.sol/BotSimulationLib.json +2 -2
  72. package/build/artifacts/contracts/core/TradingBot/LongYieldDecisionHelper.sol/LongYieldDecisionHelper.dbg.json +4 -0
  73. package/build/artifacts/contracts/core/TradingBot/LongYieldDecisionHelper.sol/LongYieldDecisionHelper.json +1190 -0
  74. package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.dbg.json +1 -1
  75. package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.json +301 -397
  76. package/build/artifacts/contracts/core/TradingBot/MarketExtLib.sol/MarketExtLib.dbg.json +1 -1
  77. package/build/artifacts/contracts/core/TradingBot/SpecSegmentLib.sol/SpecSegmentLib.dbg.json +4 -0
  78. package/build/artifacts/contracts/core/TradingBot/SpecSegmentLib.sol/SpecSegmentLib.json +10 -0
  79. package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.dbg.json +1 -1
  80. package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.json +32 -17
  81. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  82. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  83. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  84. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  85. package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +1 -1
  86. package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
  87. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
  88. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
  89. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  90. package/build/artifacts/contracts/core/libraries/TokenAmountLib.sol/TokenAmountLib.dbg.json +1 -1
  91. package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +1 -1
  93. package/build/artifacts/contracts/interfaces/Balancer/IERC4626LinearPool.sol/IERC4626LinearPool.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.dbg.json +1 -1
  96. package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  99. package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  103. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  104. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  108. package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  110. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
  112. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  113. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  114. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  115. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  116. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  117. package/build/artifacts/contracts/interfaces/TradingBot/IBotDecisionHelper.sol/IBotDecisionHelper.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/TradingBot/IBotDecisionHelper.sol/IBotDecisionHelper.json +542 -581
  119. package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.json +256 -325
  121. package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.dbg.json +1 -1
  122. package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.json +6 -17
  123. package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  124. package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  125. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
  126. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
  127. package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
  128. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  129. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  130. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  131. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  132. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  133. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  134. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  135. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  136. package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  137. package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
  138. package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
  139. package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
  140. package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
  141. package/build/artifacts/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.dbg.json +1 -1
  142. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  143. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  144. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  145. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  146. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  147. package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
  148. package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
  149. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  150. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  151. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  152. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  153. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  154. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +1 -1
  155. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.dbg.json +1 -1
  156. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IHashflow.sol/IHashflow.dbg.json +1 -1
  157. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +1 -1
  158. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol/KyberInputScalingHelper.dbg.json +1 -1
  159. package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.dbg.json +1 -1
  160. package/contracts/core/TradingBot/BotActionCallback.sol +1 -1
  161. package/contracts/core/TradingBot/BotActionHelper.sol +1 -3
  162. package/contracts/core/TradingBot/BotSimulationLib.sol +2 -1
  163. package/contracts/core/TradingBot/LongYieldDecisionHelper.sol +413 -0
  164. package/contracts/core/TradingBot/LongYieldTradingBot.sol +63 -91
  165. package/contracts/core/TradingBot/SpecSegmentLib.sol +62 -0
  166. package/contracts/core/TradingBot/TradingBotBase.sol +14 -9
  167. package/contracts/interfaces/TradingBot/IBotDecisionHelper.sol +41 -57
  168. package/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol +24 -34
  169. package/contracts/interfaces/TradingBot/ITradingBotBase.sol +1 -3
  170. package/package.json +1 -1
  171. package/typechain-types/BotActionCallback.ts +40 -22
  172. package/typechain-types/BotActionHelper.ts +40 -22
  173. package/typechain-types/BotDecisionHelper.ts +221 -187
  174. package/typechain-types/IAnkrBNB.ts +150 -0
  175. package/typechain-types/IAnkrLiquidStaking.ts +253 -0
  176. package/typechain-types/IBotDecisionHelper.ts +142 -212
  177. package/typechain-types/ILongYieldTradingBot.ts +147 -230
  178. package/typechain-types/ISwETH.ts +123 -0
  179. package/typechain-types/ITradingBotBase.ts +14 -22
  180. package/typechain-types/LongYieldDecisionHelper.ts +598 -0
  181. package/typechain-types/LongYieldTradingBot.ts +191 -248
  182. package/typechain-types/PendleAnkrBNBSY.ts +1235 -0
  183. package/typechain-types/PendleAuraWstethAnkreth.ts +1511 -0
  184. package/typechain-types/PendleSwETH.ts +1216 -0
  185. package/typechain-types/PendleThenaSY.ts +153 -0
  186. package/typechain-types/PendleWbEthSY.ts +1229 -0
  187. package/typechain-types/ThenaLpHelper.ts +19 -0
  188. package/typechain-types/ThenaMath.ts +87 -0
  189. package/typechain-types/ThenaPreview.ts +19 -0
  190. package/typechain-types/TradingBotBase.ts +40 -22
  191. package/typechain-types/factories/BotActionCallback__factory.ts +31 -16
  192. package/typechain-types/factories/BotActionHelper__factory.ts +31 -16
  193. package/typechain-types/factories/BotDecisionHelper__factory.ts +490 -421
  194. package/typechain-types/factories/IAnkrBNB__factory.ts +74 -0
  195. package/typechain-types/factories/IAnkrLiquidStaking__factory.ts +123 -0
  196. package/typechain-types/factories/IBotDecisionHelper__factory.ts +540 -579
  197. package/typechain-types/factories/ILongYieldTradingBot__factory.ts +255 -324
  198. package/typechain-types/factories/ISwETH__factory.ts +53 -0
  199. package/typechain-types/factories/ITradingBotBase__factory.ts +6 -17
  200. package/typechain-types/factories/LongYieldDecisionHelper__factory.ts +1247 -0
  201. package/typechain-types/factories/LongYieldTradingBot__factory.ts +301 -393
  202. package/typechain-types/factories/PendleAnkrBNBSY__factory.ts +1100 -0
  203. package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +1244 -0
  204. package/typechain-types/factories/PendleSwETH__factory.ts +1022 -0
  205. package/typechain-types/factories/PendleThenaSY__factory.ts +85 -1
  206. package/typechain-types/factories/PendleWbEthSY__factory.ts +1049 -0
  207. package/typechain-types/factories/PtAndLpToAsset__factory.ts +1 -1
  208. package/typechain-types/factories/ThenaLpHelper__factory.ts +13 -0
  209. package/typechain-types/factories/ThenaMath__factory.ts +36 -0
  210. package/typechain-types/factories/ThenaPreview__factory.ts +14 -1
  211. package/typechain-types/factories/TradingBotBase__factory.ts +31 -16
  212. package/typechain-types/hardhat.d.ts +4 -40
  213. package/typechain-types/index.ts +2 -10
  214. package/build/artifacts/contracts/core/TradingBot/BotDecisionHelper.sol/BotDecisionHelper.dbg.json +0 -4
  215. package/build/artifacts/contracts/core/TradingBot/BotDecisionHelper.sol/BotDecisionHelper.json +0 -1070
  216. package/contracts/core/TradingBot/BotDecisionHelper.sol +0 -306
@@ -97,12 +97,6 @@
97
97
  "name": "botParams",
98
98
  "type": "tuple"
99
99
  },
100
- {
101
- "indexed": false,
102
- "internalType": "uint256",
103
- "name": "maxYtIn",
104
- "type": "uint256"
105
- },
106
100
  {
107
101
  "indexed": false,
108
102
  "internalType": "uint256",
@@ -122,45 +116,6 @@
122
116
  {
123
117
  "anonymous": false,
124
118
  "inputs": [
125
- {
126
- "components": [
127
- {
128
- "internalType": "uint256",
129
- "name": "guessMin",
130
- "type": "uint256"
131
- },
132
- {
133
- "internalType": "uint256",
134
- "name": "guessMax",
135
- "type": "uint256"
136
- },
137
- {
138
- "internalType": "uint256",
139
- "name": "guessOffchain",
140
- "type": "uint256"
141
- },
142
- {
143
- "internalType": "uint256",
144
- "name": "maxIteration",
145
- "type": "uint256"
146
- },
147
- {
148
- "internalType": "uint256",
149
- "name": "eps",
150
- "type": "uint256"
151
- }
152
- ],
153
- "indexed": false,
154
- "internalType": "struct ApproxParams",
155
- "name": "botParams",
156
- "type": "tuple"
157
- },
158
- {
159
- "indexed": false,
160
- "internalType": "uint256",
161
- "name": "maxSyIn",
162
- "type": "uint256"
163
- },
164
119
  {
165
120
  "indexed": false,
166
121
  "internalType": "uint256",
@@ -270,12 +225,6 @@
270
225
  "name": "botParams",
271
226
  "type": "tuple"
272
227
  },
273
- {
274
- "indexed": false,
275
- "internalType": "uint256",
276
- "name": "maxLpRemoved",
277
- "type": "uint256"
278
- },
279
228
  {
280
229
  "indexed": false,
281
230
  "internalType": "uint256",
@@ -374,110 +323,56 @@
374
323
  {
375
324
  "components": [
376
325
  {
377
- "internalType": "uint256",
378
- "name": "guessMin",
379
- "type": "uint256"
380
- },
381
- {
382
- "internalType": "uint256",
383
- "name": "guessMax",
384
- "type": "uint256"
385
- },
386
- {
387
- "internalType": "uint256",
388
- "name": "guessOffchain",
389
- "type": "uint256"
390
- },
391
- {
392
- "internalType": "uint256",
393
- "name": "maxIteration",
394
- "type": "uint256"
395
- },
396
- {
397
- "internalType": "uint256",
398
- "name": "eps",
399
- "type": "uint256"
400
- }
401
- ],
402
- "internalType": "struct ApproxParams",
403
- "name": "botParams",
404
- "type": "tuple"
405
- },
406
- {
407
- "internalType": "uint256",
408
- "name": "minLpOut",
409
- "type": "uint256"
410
- },
411
- {
412
- "internalType": "uint256",
413
- "name": "maxSyIn",
414
- "type": "uint256"
415
- }
416
- ],
417
- "name": "addLiqFromSy",
418
- "outputs": [
419
- {
420
- "internalType": "uint256",
421
- "name": "netPtFromSwap",
422
- "type": "uint256"
423
- },
424
- {
425
- "internalType": "uint256",
426
- "name": "netLpOut",
427
- "type": "uint256"
428
- },
429
- {
430
- "internalType": "uint256",
431
- "name": "netSyIn",
432
- "type": "uint256"
433
- }
434
- ],
435
- "stateMutability": "nonpayable",
436
- "type": "function"
437
- },
438
- {
439
- "inputs": [
440
- {
441
- "components": [
442
- {
443
- "internalType": "uint256",
444
- "name": "guessMin",
445
- "type": "uint256"
446
- },
447
- {
448
- "internalType": "uint256",
449
- "name": "guessMax",
450
- "type": "uint256"
326
+ "components": [
327
+ {
328
+ "internalType": "uint256",
329
+ "name": "guessMin",
330
+ "type": "uint256"
331
+ },
332
+ {
333
+ "internalType": "uint256",
334
+ "name": "guessMax",
335
+ "type": "uint256"
336
+ },
337
+ {
338
+ "internalType": "uint256",
339
+ "name": "guessOffchain",
340
+ "type": "uint256"
341
+ },
342
+ {
343
+ "internalType": "uint256",
344
+ "name": "maxIteration",
345
+ "type": "uint256"
346
+ },
347
+ {
348
+ "internalType": "uint256",
349
+ "name": "eps",
350
+ "type": "uint256"
351
+ }
352
+ ],
353
+ "internalType": "struct ApproxParams",
354
+ "name": "botParams",
355
+ "type": "tuple"
451
356
  },
452
357
  {
453
358
  "internalType": "uint256",
454
- "name": "guessOffchain",
359
+ "name": "minLpOut",
455
360
  "type": "uint256"
456
361
  },
457
362
  {
458
363
  "internalType": "uint256",
459
- "name": "maxIteration",
364
+ "name": "targetIy",
460
365
  "type": "uint256"
461
366
  },
462
367
  {
463
- "internalType": "uint256",
464
- "name": "eps",
465
- "type": "uint256"
368
+ "internalType": "int256",
369
+ "name": "currentBin",
370
+ "type": "int256"
466
371
  }
467
372
  ],
468
- "internalType": "struct ApproxParams",
469
- "name": "botParams",
373
+ "internalType": "struct ILongYieldTradingBot.AddLiqFromYtInput",
374
+ "name": "inputParams",
470
375
  "type": "tuple"
471
- },
472
- {
473
- "internalType": "uint256",
474
- "name": "minLpOut",
475
- "type": "uint256"
476
- },
477
- {
478
- "internalType": "uint256",
479
- "name": "maxYtIn",
480
- "type": "uint256"
481
376
  }
482
377
  ],
483
378
  "name": "addLiqFromYt",
@@ -503,46 +398,9 @@
503
398
  },
504
399
  {
505
400
  "inputs": [
506
- {
507
- "internalType": "address",
508
- "name": "router",
509
- "type": "address"
510
- },
511
- {
512
- "components": [
513
- {
514
- "internalType": "uint256",
515
- "name": "guessMin",
516
- "type": "uint256"
517
- },
518
- {
519
- "internalType": "uint256",
520
- "name": "guessMax",
521
- "type": "uint256"
522
- },
523
- {
524
- "internalType": "uint256",
525
- "name": "guessOffchain",
526
- "type": "uint256"
527
- },
528
- {
529
- "internalType": "uint256",
530
- "name": "maxIteration",
531
- "type": "uint256"
532
- },
533
- {
534
- "internalType": "uint256",
535
- "name": "eps",
536
- "type": "uint256"
537
- }
538
- ],
539
- "internalType": "struct ApproxParams",
540
- "name": "botParams",
541
- "type": "tuple"
542
- },
543
401
  {
544
402
  "internalType": "uint256",
545
- "name": "maxSyIn",
403
+ "name": "netSyIn",
546
404
  "type": "uint256"
547
405
  },
548
406
  {
@@ -558,11 +416,6 @@
558
416
  ],
559
417
  "name": "addLiqKeepYt",
560
418
  "outputs": [
561
- {
562
- "internalType": "uint256",
563
- "name": "netSyIn",
564
- "type": "uint256"
565
- },
566
419
  {
567
420
  "internalType": "uint256",
568
421
  "name": "netLpOut",
@@ -604,11 +457,6 @@
604
457
  },
605
458
  {
606
459
  "inputs": [
607
- {
608
- "internalType": "address",
609
- "name": "router",
610
- "type": "address"
611
- },
612
460
  {
613
461
  "components": [
614
462
  {
@@ -730,11 +578,6 @@
730
578
  },
731
579
  {
732
580
  "inputs": [
733
- {
734
- "internalType": "address",
735
- "name": "router",
736
- "type": "address"
737
- },
738
581
  {
739
582
  "components": [
740
583
  {
@@ -825,6 +668,11 @@
825
668
  "internalType": "uint256",
826
669
  "name": "syBalance",
827
670
  "type": "uint256"
671
+ },
672
+ {
673
+ "internalType": "uint256",
674
+ "name": "buyBins",
675
+ "type": "uint256"
828
676
  }
829
677
  ],
830
678
  "internalType": "struct BotState",
@@ -836,13 +684,7 @@
836
684
  "type": "function"
837
685
  },
838
686
  {
839
- "inputs": [
840
- {
841
- "internalType": "address",
842
- "name": "router",
843
- "type": "address"
844
- }
845
- ],
687
+ "inputs": [],
846
688
  "name": "readMarketExtState",
847
689
  "outputs": [
848
690
  {
@@ -919,80 +761,240 @@
919
761
  "type": "function"
920
762
  },
921
763
  {
922
- "inputs": [
764
+ "inputs": [],
765
+ "name": "readStrategyData",
766
+ "outputs": [
923
767
  {
924
768
  "components": [
925
769
  {
926
- "internalType": "uint256",
927
- "name": "guessMin",
928
- "type": "uint256"
929
- },
930
- {
931
- "internalType": "uint256",
932
- "name": "guessMax",
933
- "type": "uint256"
934
- },
935
- {
936
- "internalType": "uint256",
937
- "name": "guessOffchain",
938
- "type": "uint256"
770
+ "components": [
771
+ {
772
+ "internalType": "uint256",
773
+ "name": "lpBalance",
774
+ "type": "uint256"
775
+ },
776
+ {
777
+ "internalType": "uint256",
778
+ "name": "ytBalance",
779
+ "type": "uint256"
780
+ },
781
+ {
782
+ "internalType": "uint256",
783
+ "name": "syBalance",
784
+ "type": "uint256"
785
+ },
786
+ {
787
+ "internalType": "uint256",
788
+ "name": "buyBins",
789
+ "type": "uint256"
790
+ }
791
+ ],
792
+ "internalType": "struct BotState",
793
+ "name": "botState",
794
+ "type": "tuple"
939
795
  },
940
796
  {
941
- "internalType": "uint256",
942
- "name": "maxIteration",
943
- "type": "uint256"
797
+ "components": [
798
+ {
799
+ "components": [
800
+ {
801
+ "internalType": "int256",
802
+ "name": "totalPt",
803
+ "type": "int256"
804
+ },
805
+ {
806
+ "internalType": "int256",
807
+ "name": "totalSy",
808
+ "type": "int256"
809
+ },
810
+ {
811
+ "internalType": "int256",
812
+ "name": "totalLp",
813
+ "type": "int256"
814
+ },
815
+ {
816
+ "internalType": "address",
817
+ "name": "treasury",
818
+ "type": "address"
819
+ },
820
+ {
821
+ "internalType": "int256",
822
+ "name": "scalarRoot",
823
+ "type": "int256"
824
+ },
825
+ {
826
+ "internalType": "uint256",
827
+ "name": "expiry",
828
+ "type": "uint256"
829
+ },
830
+ {
831
+ "internalType": "uint256",
832
+ "name": "lnFeeRateRoot",
833
+ "type": "uint256"
834
+ },
835
+ {
836
+ "internalType": "uint256",
837
+ "name": "reserveFeePercent",
838
+ "type": "uint256"
839
+ },
840
+ {
841
+ "internalType": "uint256",
842
+ "name": "lastLnImpliedRate",
843
+ "type": "uint256"
844
+ }
845
+ ],
846
+ "internalType": "struct MarketState",
847
+ "name": "state",
848
+ "type": "tuple"
849
+ },
850
+ {
851
+ "internalType": "PYIndex",
852
+ "name": "index",
853
+ "type": "uint256"
854
+ },
855
+ {
856
+ "internalType": "uint256",
857
+ "name": "blockTime",
858
+ "type": "uint256"
859
+ }
860
+ ],
861
+ "internalType": "struct MarketExtState",
862
+ "name": "marketExt",
863
+ "type": "tuple"
944
864
  },
945
865
  {
946
- "internalType": "uint256",
947
- "name": "eps",
948
- "type": "uint256"
866
+ "components": [
867
+ {
868
+ "internalType": "uint256",
869
+ "name": "buyYtIy",
870
+ "type": "uint256"
871
+ },
872
+ {
873
+ "internalType": "uint256",
874
+ "name": "sellYtIy",
875
+ "type": "uint256"
876
+ },
877
+ {
878
+ "internalType": "uint256",
879
+ "name": "targetSyRatio",
880
+ "type": "uint256"
881
+ },
882
+ {
883
+ "internalType": "uint256",
884
+ "name": "maxSyRatio",
885
+ "type": "uint256"
886
+ },
887
+ {
888
+ "internalType": "uint256",
889
+ "name": "minYtPtRatio",
890
+ "type": "uint256"
891
+ },
892
+ {
893
+ "internalType": "uint256",
894
+ "name": "numOfBins",
895
+ "type": "uint256"
896
+ }
897
+ ],
898
+ "internalType": "struct LongTradingSpecs",
899
+ "name": "specs",
900
+ "type": "tuple"
949
901
  }
950
902
  ],
951
- "internalType": "struct ApproxParams",
952
- "name": "botParams",
903
+ "internalType": "struct StrategyData",
904
+ "name": "strategyData",
953
905
  "type": "tuple"
954
- },
906
+ }
907
+ ],
908
+ "stateMutability": "nonpayable",
909
+ "type": "function"
910
+ },
911
+ {
912
+ "inputs": [
955
913
  {
956
914
  "components": [
957
915
  {
958
- "internalType": "uint256",
959
- "name": "guessMin",
960
- "type": "uint256"
916
+ "components": [
917
+ {
918
+ "internalType": "uint256",
919
+ "name": "guessMin",
920
+ "type": "uint256"
921
+ },
922
+ {
923
+ "internalType": "uint256",
924
+ "name": "guessMax",
925
+ "type": "uint256"
926
+ },
927
+ {
928
+ "internalType": "uint256",
929
+ "name": "guessOffchain",
930
+ "type": "uint256"
931
+ },
932
+ {
933
+ "internalType": "uint256",
934
+ "name": "maxIteration",
935
+ "type": "uint256"
936
+ },
937
+ {
938
+ "internalType": "uint256",
939
+ "name": "eps",
940
+ "type": "uint256"
941
+ }
942
+ ],
943
+ "internalType": "struct ApproxParams",
944
+ "name": "botParams",
945
+ "type": "tuple"
961
946
  },
962
947
  {
963
- "internalType": "uint256",
964
- "name": "guessMax",
965
- "type": "uint256"
948
+ "components": [
949
+ {
950
+ "internalType": "uint256",
951
+ "name": "guessMin",
952
+ "type": "uint256"
953
+ },
954
+ {
955
+ "internalType": "uint256",
956
+ "name": "guessMax",
957
+ "type": "uint256"
958
+ },
959
+ {
960
+ "internalType": "uint256",
961
+ "name": "guessOffchain",
962
+ "type": "uint256"
963
+ },
964
+ {
965
+ "internalType": "uint256",
966
+ "name": "maxIteration",
967
+ "type": "uint256"
968
+ },
969
+ {
970
+ "internalType": "uint256",
971
+ "name": "eps",
972
+ "type": "uint256"
973
+ }
974
+ ],
975
+ "internalType": "struct ApproxParams",
976
+ "name": "guessTotalPtToSwap",
977
+ "type": "tuple"
966
978
  },
967
979
  {
968
980
  "internalType": "uint256",
969
- "name": "guessOffchain",
981
+ "name": "minYtOut",
970
982
  "type": "uint256"
971
983
  },
972
984
  {
973
985
  "internalType": "uint256",
974
- "name": "maxIteration",
986
+ "name": "targetIy",
975
987
  "type": "uint256"
976
988
  },
977
989
  {
978
- "internalType": "uint256",
979
- "name": "eps",
980
- "type": "uint256"
990
+ "internalType": "int256",
991
+ "name": "currentBin",
992
+ "type": "int256"
981
993
  }
982
994
  ],
983
- "internalType": "struct ApproxParams",
984
- "name": "guessTotalPtToSwap",
995
+ "internalType": "struct ILongYieldTradingBot.RemoveLiqToYtInput",
996
+ "name": "inputParams",
985
997
  "type": "tuple"
986
- },
987
- {
988
- "internalType": "uint256",
989
- "name": "maxLpRemoved",
990
- "type": "uint256"
991
- },
992
- {
993
- "internalType": "uint256",
994
- "name": "minYtOut",
995
- "type": "uint256"
996
998
  }
997
999
  ],
998
1000
  "name": "removeLiqToYt",
@@ -1006,11 +1008,6 @@
1006
1008
  "internalType": "uint256",
1007
1009
  "name": "netYtOut",
1008
1010
  "type": "uint256"
1009
- },
1010
- {
1011
- "internalType": "uint256",
1012
- "name": "totalPtToSwap",
1013
- "type": "uint256"
1014
1011
  }
1015
1012
  ],
1016
1013
  "stateMutability": "nonpayable",
@@ -1022,32 +1019,32 @@
1022
1019
  "components": [
1023
1020
  {
1024
1021
  "internalType": "uint256",
1025
- "name": "lowerIyLimit",
1022
+ "name": "buyYtIy",
1026
1023
  "type": "uint256"
1027
1024
  },
1028
1025
  {
1029
1026
  "internalType": "uint256",
1030
- "name": "upperIyLimit",
1027
+ "name": "sellYtIy",
1031
1028
  "type": "uint256"
1032
1029
  },
1033
1030
  {
1034
1031
  "internalType": "uint256",
1035
- "name": "floatingSyRatioLimit",
1032
+ "name": "targetSyRatio",
1036
1033
  "type": "uint256"
1037
1034
  },
1038
1035
  {
1039
1036
  "internalType": "uint256",
1040
- "name": "floatingSyRatioTarget",
1037
+ "name": "maxSyRatio",
1041
1038
  "type": "uint256"
1042
1039
  },
1043
1040
  {
1044
1041
  "internalType": "uint256",
1045
- "name": "ytPtRatioLimit",
1042
+ "name": "minYtPtRatio",
1046
1043
  "type": "uint256"
1047
1044
  },
1048
1045
  {
1049
1046
  "internalType": "uint256",
1050
- "name": "ytPtRatioTarget",
1047
+ "name": "numOfBins",
1051
1048
  "type": "uint256"
1052
1049
  }
1053
1050
  ],
@@ -1061,72 +1058,6 @@
1061
1058
  "stateMutability": "nonpayable",
1062
1059
  "type": "function"
1063
1060
  },
1064
- {
1065
- "inputs": [
1066
- {
1067
- "internalType": "address",
1068
- "name": "router",
1069
- "type": "address"
1070
- },
1071
- {
1072
- "components": [
1073
- {
1074
- "internalType": "uint256",
1075
- "name": "guessMin",
1076
- "type": "uint256"
1077
- },
1078
- {
1079
- "internalType": "uint256",
1080
- "name": "guessMax",
1081
- "type": "uint256"
1082
- },
1083
- {
1084
- "internalType": "uint256",
1085
- "name": "guessOffchain",
1086
- "type": "uint256"
1087
- },
1088
- {
1089
- "internalType": "uint256",
1090
- "name": "maxIteration",
1091
- "type": "uint256"
1092
- },
1093
- {
1094
- "internalType": "uint256",
1095
- "name": "eps",
1096
- "type": "uint256"
1097
- }
1098
- ],
1099
- "internalType": "struct ApproxParams",
1100
- "name": "botParams",
1101
- "type": "tuple"
1102
- },
1103
- {
1104
- "internalType": "uint256",
1105
- "name": "minYtOut",
1106
- "type": "uint256"
1107
- },
1108
- {
1109
- "internalType": "uint256",
1110
- "name": "maxSyIn",
1111
- "type": "uint256"
1112
- }
1113
- ],
1114
- "name": "swapSyToYt",
1115
- "outputs": [
1116
- {
1117
- "internalType": "uint256",
1118
- "name": "exactYtOut",
1119
- "type": "uint256"
1120
- },
1121
- {
1122
- "internalType": "uint256",
1123
- "name": "netSyIn",
1124
- "type": "uint256"
1125
- }
1126
- ],
1127
- "stateMutability": "nonpayable",
1128
- "type": "function"
1129
- },
1130
1061
  {
1131
1062
  "inputs": [
1132
1063
  {