@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
@@ -5,148 +5,144 @@
5
5
  "abi": [
6
6
  {
7
7
  "inputs": [
8
- {
9
- "components": [
10
- {
11
- "internalType": "uint256",
12
- "name": "lpBalance",
13
- "type": "uint256"
14
- },
15
- {
16
- "internalType": "uint256",
17
- "name": "ytBalance",
18
- "type": "uint256"
19
- },
20
- {
21
- "internalType": "uint256",
22
- "name": "syBalance",
23
- "type": "uint256"
24
- }
25
- ],
26
- "internalType": "struct BotState",
27
- "name": "botState",
28
- "type": "tuple"
29
- },
30
- {
31
- "components": [
32
- {
33
- "internalType": "enum StrategyFlag",
34
- "name": "iyFlag",
35
- "type": "uint8"
36
- },
37
- {
38
- "internalType": "enum StrategyFlag",
39
- "name": "syRatioFlag",
40
- "type": "uint8"
41
- }
42
- ],
43
- "internalType": "struct StrategyState",
44
- "name": "currentState",
45
- "type": "tuple"
46
- }
47
- ],
48
- "name": "actionToTake",
49
- "outputs": [
50
- {
51
- "internalType": "enum ActionType",
52
- "name": "",
53
- "type": "uint8"
54
- }
55
- ],
56
- "stateMutability": "pure",
57
- "type": "function"
58
- },
59
- {
60
- "inputs": [
61
- {
62
- "components": [
63
- {
64
- "internalType": "uint256",
65
- "name": "lpBalance",
66
- "type": "uint256"
67
- },
68
- {
69
- "internalType": "uint256",
70
- "name": "ytBalance",
71
- "type": "uint256"
72
- },
73
- {
74
- "internalType": "uint256",
75
- "name": "syBalance",
76
- "type": "uint256"
77
- }
78
- ],
79
- "internalType": "struct BotState",
80
- "name": "bot",
81
- "type": "tuple"
82
- },
83
8
  {
84
9
  "components": [
85
10
  {
86
11
  "components": [
87
12
  {
88
- "internalType": "int256",
89
- "name": "totalPt",
90
- "type": "int256"
13
+ "internalType": "uint256",
14
+ "name": "lpBalance",
15
+ "type": "uint256"
91
16
  },
92
17
  {
93
- "internalType": "int256",
94
- "name": "totalSy",
95
- "type": "int256"
18
+ "internalType": "uint256",
19
+ "name": "ytBalance",
20
+ "type": "uint256"
96
21
  },
97
22
  {
98
- "internalType": "int256",
99
- "name": "totalLp",
100
- "type": "int256"
23
+ "internalType": "uint256",
24
+ "name": "syBalance",
25
+ "type": "uint256"
101
26
  },
102
27
  {
103
- "internalType": "address",
104
- "name": "treasury",
105
- "type": "address"
28
+ "internalType": "uint256",
29
+ "name": "buyBins",
30
+ "type": "uint256"
31
+ }
32
+ ],
33
+ "internalType": "struct BotState",
34
+ "name": "botState",
35
+ "type": "tuple"
36
+ },
37
+ {
38
+ "components": [
39
+ {
40
+ "components": [
41
+ {
42
+ "internalType": "int256",
43
+ "name": "totalPt",
44
+ "type": "int256"
45
+ },
46
+ {
47
+ "internalType": "int256",
48
+ "name": "totalSy",
49
+ "type": "int256"
50
+ },
51
+ {
52
+ "internalType": "int256",
53
+ "name": "totalLp",
54
+ "type": "int256"
55
+ },
56
+ {
57
+ "internalType": "address",
58
+ "name": "treasury",
59
+ "type": "address"
60
+ },
61
+ {
62
+ "internalType": "int256",
63
+ "name": "scalarRoot",
64
+ "type": "int256"
65
+ },
66
+ {
67
+ "internalType": "uint256",
68
+ "name": "expiry",
69
+ "type": "uint256"
70
+ },
71
+ {
72
+ "internalType": "uint256",
73
+ "name": "lnFeeRateRoot",
74
+ "type": "uint256"
75
+ },
76
+ {
77
+ "internalType": "uint256",
78
+ "name": "reserveFeePercent",
79
+ "type": "uint256"
80
+ },
81
+ {
82
+ "internalType": "uint256",
83
+ "name": "lastLnImpliedRate",
84
+ "type": "uint256"
85
+ }
86
+ ],
87
+ "internalType": "struct MarketState",
88
+ "name": "state",
89
+ "type": "tuple"
90
+ },
91
+ {
92
+ "internalType": "PYIndex",
93
+ "name": "index",
94
+ "type": "uint256"
106
95
  },
107
96
  {
108
- "internalType": "int256",
109
- "name": "scalarRoot",
110
- "type": "int256"
97
+ "internalType": "uint256",
98
+ "name": "blockTime",
99
+ "type": "uint256"
100
+ }
101
+ ],
102
+ "internalType": "struct MarketExtState",
103
+ "name": "marketExt",
104
+ "type": "tuple"
105
+ },
106
+ {
107
+ "components": [
108
+ {
109
+ "internalType": "uint256",
110
+ "name": "buyYtIy",
111
+ "type": "uint256"
111
112
  },
112
113
  {
113
114
  "internalType": "uint256",
114
- "name": "expiry",
115
+ "name": "sellYtIy",
115
116
  "type": "uint256"
116
117
  },
117
118
  {
118
119
  "internalType": "uint256",
119
- "name": "lnFeeRateRoot",
120
+ "name": "targetSyRatio",
120
121
  "type": "uint256"
121
122
  },
122
123
  {
123
124
  "internalType": "uint256",
124
- "name": "reserveFeePercent",
125
+ "name": "maxSyRatio",
125
126
  "type": "uint256"
126
127
  },
127
128
  {
128
129
  "internalType": "uint256",
129
- "name": "lastLnImpliedRate",
130
+ "name": "minYtPtRatio",
131
+ "type": "uint256"
132
+ },
133
+ {
134
+ "internalType": "uint256",
135
+ "name": "numOfBins",
130
136
  "type": "uint256"
131
137
  }
132
138
  ],
133
- "internalType": "struct MarketState",
134
- "name": "state",
139
+ "internalType": "struct LongTradingSpecs",
140
+ "name": "specs",
135
141
  "type": "tuple"
136
- },
137
- {
138
- "internalType": "PYIndex",
139
- "name": "index",
140
- "type": "uint256"
141
- },
142
- {
143
- "internalType": "uint256",
144
- "name": "blockTime",
145
- "type": "uint256"
146
142
  }
147
143
  ],
148
- "internalType": "struct MarketExtState",
149
- "name": "marketExt",
144
+ "internalType": "struct StrategyData",
145
+ "name": "strategyData",
150
146
  "type": "tuple"
151
147
  }
152
148
  ],
@@ -173,461 +169,180 @@
173
169
  "type": "uint256"
174
170
  }
175
171
  ],
176
- "stateMutability": "pure",
172
+ "stateMutability": "view",
177
173
  "type": "function"
178
174
  },
179
175
  {
180
176
  "inputs": [
181
177
  {
182
- "components": [
183
- {
184
- "internalType": "uint256",
185
- "name": "lpBalance",
186
- "type": "uint256"
187
- },
188
- {
189
- "internalType": "uint256",
190
- "name": "ytBalance",
191
- "type": "uint256"
192
- },
193
- {
194
- "internalType": "uint256",
195
- "name": "syBalance",
196
- "type": "uint256"
197
- }
198
- ],
199
- "internalType": "struct BotState",
200
- "name": "botData",
201
- "type": "tuple"
202
- },
203
- {
204
- "components": [
205
- {
206
- "components": [
207
- {
208
- "internalType": "int256",
209
- "name": "totalPt",
210
- "type": "int256"
211
- },
212
- {
213
- "internalType": "int256",
214
- "name": "totalSy",
215
- "type": "int256"
216
- },
217
- {
218
- "internalType": "int256",
219
- "name": "totalLp",
220
- "type": "int256"
221
- },
222
- {
223
- "internalType": "address",
224
- "name": "treasury",
225
- "type": "address"
226
- },
227
- {
228
- "internalType": "int256",
229
- "name": "scalarRoot",
230
- "type": "int256"
231
- },
232
- {
233
- "internalType": "uint256",
234
- "name": "expiry",
235
- "type": "uint256"
236
- },
237
- {
238
- "internalType": "uint256",
239
- "name": "lnFeeRateRoot",
240
- "type": "uint256"
241
- },
242
- {
243
- "internalType": "uint256",
244
- "name": "reserveFeePercent",
245
- "type": "uint256"
246
- },
247
- {
248
- "internalType": "uint256",
249
- "name": "lastLnImpliedRate",
250
- "type": "uint256"
251
- }
252
- ],
253
- "internalType": "struct MarketState",
254
- "name": "state",
255
- "type": "tuple"
256
- },
257
- {
258
- "internalType": "PYIndex",
259
- "name": "index",
260
- "type": "uint256"
261
- },
262
- {
263
- "internalType": "uint256",
264
- "name": "blockTime",
265
- "type": "uint256"
266
- }
267
- ],
268
- "internalType": "struct MarketExtState",
269
- "name": "marketExtData",
270
- "type": "tuple"
271
- },
272
- {
273
- "internalType": "enum ActionType",
274
- "name": "action",
275
- "type": "uint8"
276
- },
178
+ "internalType": "address",
179
+ "name": "botAddress",
180
+ "type": "address"
181
+ }
182
+ ],
183
+ "name": "getAvailableZpiAmount",
184
+ "outputs": [
277
185
  {
278
186
  "internalType": "uint256",
279
- "name": "botParam",
187
+ "name": "amountSyToZpi",
280
188
  "type": "uint256"
281
- },
282
- {
283
- "components": [
284
- {
285
- "internalType": "uint256",
286
- "name": "guessMin",
287
- "type": "uint256"
288
- },
289
- {
290
- "internalType": "uint256",
291
- "name": "guessMax",
292
- "type": "uint256"
293
- },
294
- {
295
- "internalType": "uint256",
296
- "name": "guessOffchain",
297
- "type": "uint256"
298
- },
299
- {
300
- "internalType": "uint256",
301
- "name": "maxIteration",
302
- "type": "uint256"
303
- },
304
- {
305
- "internalType": "uint256",
306
- "name": "eps",
307
- "type": "uint256"
308
- }
309
- ],
310
- "internalType": "struct ApproxParams",
311
- "name": "swapApproxParams",
312
- "type": "tuple"
313
189
  }
314
190
  ],
315
- "name": "previewAction",
316
- "outputs": [
317
- {
318
- "internalType": "bool",
319
- "name": "",
320
- "type": "bool"
321
- },
322
- {
323
- "components": [
324
- {
325
- "internalType": "uint256",
326
- "name": "lpBalance",
327
- "type": "uint256"
328
- },
329
- {
330
- "internalType": "uint256",
331
- "name": "ytBalance",
332
- "type": "uint256"
333
- },
334
- {
335
- "internalType": "uint256",
336
- "name": "syBalance",
337
- "type": "uint256"
338
- }
339
- ],
340
- "internalType": "struct BotState",
341
- "name": "",
342
- "type": "tuple"
343
- },
191
+ "stateMutability": "nonpayable",
192
+ "type": "function"
193
+ },
194
+ {
195
+ "inputs": [
344
196
  {
345
197
  "components": [
346
198
  {
347
199
  "components": [
348
- {
349
- "internalType": "int256",
350
- "name": "totalPt",
351
- "type": "int256"
352
- },
353
- {
354
- "internalType": "int256",
355
- "name": "totalSy",
356
- "type": "int256"
357
- },
358
- {
359
- "internalType": "int256",
360
- "name": "totalLp",
361
- "type": "int256"
362
- },
363
- {
364
- "internalType": "address",
365
- "name": "treasury",
366
- "type": "address"
367
- },
368
- {
369
- "internalType": "int256",
370
- "name": "scalarRoot",
371
- "type": "int256"
372
- },
373
200
  {
374
201
  "internalType": "uint256",
375
- "name": "expiry",
202
+ "name": "lpBalance",
376
203
  "type": "uint256"
377
204
  },
378
205
  {
379
206
  "internalType": "uint256",
380
- "name": "lnFeeRateRoot",
207
+ "name": "ytBalance",
381
208
  "type": "uint256"
382
209
  },
383
210
  {
384
211
  "internalType": "uint256",
385
- "name": "reserveFeePercent",
212
+ "name": "syBalance",
386
213
  "type": "uint256"
387
214
  },
388
215
  {
389
216
  "internalType": "uint256",
390
- "name": "lastLnImpliedRate",
217
+ "name": "buyBins",
391
218
  "type": "uint256"
392
219
  }
393
220
  ],
394
- "internalType": "struct MarketState",
395
- "name": "state",
221
+ "internalType": "struct BotState",
222
+ "name": "botState",
396
223
  "type": "tuple"
397
224
  },
398
- {
399
- "internalType": "PYIndex",
400
- "name": "index",
401
- "type": "uint256"
402
- },
403
- {
404
- "internalType": "uint256",
405
- "name": "blockTime",
406
- "type": "uint256"
407
- }
408
- ],
409
- "internalType": "struct MarketExtState",
410
- "name": "",
411
- "type": "tuple"
412
- }
413
- ],
414
- "stateMutability": "pure",
415
- "type": "function"
416
- },
417
- {
418
- "inputs": [
419
- {
420
- "components": [
421
- {
422
- "internalType": "uint256",
423
- "name": "lpBalance",
424
- "type": "uint256"
425
- },
426
- {
427
- "internalType": "uint256",
428
- "name": "ytBalance",
429
- "type": "uint256"
430
- },
431
- {
432
- "internalType": "uint256",
433
- "name": "syBalance",
434
- "type": "uint256"
435
- }
436
- ],
437
- "internalType": "struct BotState",
438
- "name": "bot",
439
- "type": "tuple"
440
- },
441
- {
442
- "components": [
443
225
  {
444
226
  "components": [
445
227
  {
446
- "internalType": "int256",
447
- "name": "totalPt",
448
- "type": "int256"
449
- },
450
- {
451
- "internalType": "int256",
452
- "name": "totalSy",
453
- "type": "int256"
454
- },
455
- {
456
- "internalType": "int256",
457
- "name": "totalLp",
458
- "type": "int256"
459
- },
460
- {
461
- "internalType": "address",
462
- "name": "treasury",
463
- "type": "address"
464
- },
465
- {
466
- "internalType": "int256",
467
- "name": "scalarRoot",
468
- "type": "int256"
469
- },
470
- {
471
- "internalType": "uint256",
472
- "name": "expiry",
473
- "type": "uint256"
474
- },
475
- {
476
- "internalType": "uint256",
477
- "name": "lnFeeRateRoot",
478
- "type": "uint256"
479
- },
480
- {
481
- "internalType": "uint256",
482
- "name": "reserveFeePercent",
228
+ "components": [
229
+ {
230
+ "internalType": "int256",
231
+ "name": "totalPt",
232
+ "type": "int256"
233
+ },
234
+ {
235
+ "internalType": "int256",
236
+ "name": "totalSy",
237
+ "type": "int256"
238
+ },
239
+ {
240
+ "internalType": "int256",
241
+ "name": "totalLp",
242
+ "type": "int256"
243
+ },
244
+ {
245
+ "internalType": "address",
246
+ "name": "treasury",
247
+ "type": "address"
248
+ },
249
+ {
250
+ "internalType": "int256",
251
+ "name": "scalarRoot",
252
+ "type": "int256"
253
+ },
254
+ {
255
+ "internalType": "uint256",
256
+ "name": "expiry",
257
+ "type": "uint256"
258
+ },
259
+ {
260
+ "internalType": "uint256",
261
+ "name": "lnFeeRateRoot",
262
+ "type": "uint256"
263
+ },
264
+ {
265
+ "internalType": "uint256",
266
+ "name": "reserveFeePercent",
267
+ "type": "uint256"
268
+ },
269
+ {
270
+ "internalType": "uint256",
271
+ "name": "lastLnImpliedRate",
272
+ "type": "uint256"
273
+ }
274
+ ],
275
+ "internalType": "struct MarketState",
276
+ "name": "state",
277
+ "type": "tuple"
278
+ },
279
+ {
280
+ "internalType": "PYIndex",
281
+ "name": "index",
483
282
  "type": "uint256"
484
283
  },
485
284
  {
486
285
  "internalType": "uint256",
487
- "name": "lastLnImpliedRate",
488
- "type": "uint256"
489
- }
490
- ],
491
- "internalType": "struct MarketState",
492
- "name": "state",
493
- "type": "tuple"
494
- },
495
- {
496
- "internalType": "PYIndex",
497
- "name": "index",
498
- "type": "uint256"
499
- },
500
- {
501
- "internalType": "uint256",
502
- "name": "blockTime",
503
- "type": "uint256"
504
- }
505
- ],
506
- "internalType": "struct MarketExtState",
507
- "name": "marketExt",
508
- "type": "tuple"
509
- },
510
- {
511
- "components": [
512
- {
513
- "internalType": "uint256",
514
- "name": "lowerIyLimit",
515
- "type": "uint256"
516
- },
517
- {
518
- "internalType": "uint256",
519
- "name": "upperIyLimit",
520
- "type": "uint256"
521
- },
522
- {
523
- "internalType": "uint256",
524
- "name": "floatingSyRatioLimit",
525
- "type": "uint256"
526
- },
527
- {
528
- "internalType": "uint256",
529
- "name": "floatingSyRatioTarget",
530
- "type": "uint256"
531
- },
532
- {
533
- "internalType": "uint256",
534
- "name": "ytPtRatioLimit",
535
- "type": "uint256"
536
- },
537
- {
538
- "internalType": "uint256",
539
- "name": "ytPtRatioTarget",
540
- "type": "uint256"
541
- }
542
- ],
543
- "internalType": "struct LongTradingSpecs",
544
- "name": "specs",
545
- "type": "tuple"
546
- },
547
- {
548
- "internalType": "enum ActionType",
549
- "name": "action",
550
- "type": "uint8"
551
- },
552
- {
553
- "components": [
554
- {
555
- "internalType": "uint256",
556
- "name": "guessMin",
557
- "type": "uint256"
558
- },
559
- {
560
- "internalType": "uint256",
561
- "name": "guessMax",
562
- "type": "uint256"
563
- },
564
- {
565
- "internalType": "uint256",
566
- "name": "guessOffchain",
567
- "type": "uint256"
568
- },
569
- {
570
- "internalType": "uint256",
571
- "name": "maxIteration",
572
- "type": "uint256"
573
- },
574
- {
575
- "internalType": "uint256",
576
- "name": "eps",
577
- "type": "uint256"
578
- }
579
- ],
580
- "internalType": "struct ApproxParams",
581
- "name": "botParams",
582
- "type": "tuple"
583
- },
584
- {
585
- "components": [
586
- {
587
- "internalType": "uint256",
588
- "name": "guessMin",
589
- "type": "uint256"
590
- },
591
- {
592
- "internalType": "uint256",
593
- "name": "guessMax",
594
- "type": "uint256"
595
- },
596
- {
597
- "internalType": "uint256",
598
- "name": "guessOffchain",
599
- "type": "uint256"
600
- },
601
- {
602
- "internalType": "uint256",
603
- "name": "maxIteration",
604
- "type": "uint256"
286
+ "name": "blockTime",
287
+ "type": "uint256"
288
+ }
289
+ ],
290
+ "internalType": "struct MarketExtState",
291
+ "name": "marketExt",
292
+ "type": "tuple"
605
293
  },
606
294
  {
607
- "internalType": "uint256",
608
- "name": "eps",
609
- "type": "uint256"
295
+ "components": [
296
+ {
297
+ "internalType": "uint256",
298
+ "name": "buyYtIy",
299
+ "type": "uint256"
300
+ },
301
+ {
302
+ "internalType": "uint256",
303
+ "name": "sellYtIy",
304
+ "type": "uint256"
305
+ },
306
+ {
307
+ "internalType": "uint256",
308
+ "name": "targetSyRatio",
309
+ "type": "uint256"
310
+ },
311
+ {
312
+ "internalType": "uint256",
313
+ "name": "maxSyRatio",
314
+ "type": "uint256"
315
+ },
316
+ {
317
+ "internalType": "uint256",
318
+ "name": "minYtPtRatio",
319
+ "type": "uint256"
320
+ },
321
+ {
322
+ "internalType": "uint256",
323
+ "name": "numOfBins",
324
+ "type": "uint256"
325
+ }
326
+ ],
327
+ "internalType": "struct LongTradingSpecs",
328
+ "name": "specs",
329
+ "type": "tuple"
610
330
  }
611
331
  ],
612
- "internalType": "struct ApproxParams",
613
- "name": "intParams",
332
+ "internalType": "struct StrategyData",
333
+ "name": "strategyData",
614
334
  "type": "tuple"
615
335
  }
616
336
  ],
617
- "name": "searchForBotParam",
337
+ "name": "getCurrentBin",
618
338
  "outputs": [
619
339
  {
620
- "internalType": "uint256",
621
- "name": "",
622
- "type": "uint256"
623
- },
624
- {
625
- "internalType": "enum IBotDecisionHelper.RebalanceResult",
340
+ "internalType": "int256",
626
341
  "name": "",
627
- "type": "uint8"
342
+ "type": "int256"
628
343
  }
629
344
  ],
630
- "stateMutability": "pure",
345
+ "stateMutability": "view",
631
346
  "type": "function"
632
347
  },
633
348
  {
@@ -637,68 +352,139 @@
637
352
  {
638
353
  "components": [
639
354
  {
640
- "internalType": "int256",
641
- "name": "totalPt",
642
- "type": "int256"
355
+ "internalType": "uint256",
356
+ "name": "lpBalance",
357
+ "type": "uint256"
643
358
  },
644
359
  {
645
- "internalType": "int256",
646
- "name": "totalSy",
647
- "type": "int256"
360
+ "internalType": "uint256",
361
+ "name": "ytBalance",
362
+ "type": "uint256"
648
363
  },
649
364
  {
650
- "internalType": "int256",
651
- "name": "totalLp",
652
- "type": "int256"
365
+ "internalType": "uint256",
366
+ "name": "syBalance",
367
+ "type": "uint256"
653
368
  },
654
369
  {
655
- "internalType": "address",
656
- "name": "treasury",
657
- "type": "address"
370
+ "internalType": "uint256",
371
+ "name": "buyBins",
372
+ "type": "uint256"
373
+ }
374
+ ],
375
+ "internalType": "struct BotState",
376
+ "name": "botState",
377
+ "type": "tuple"
378
+ },
379
+ {
380
+ "components": [
381
+ {
382
+ "components": [
383
+ {
384
+ "internalType": "int256",
385
+ "name": "totalPt",
386
+ "type": "int256"
387
+ },
388
+ {
389
+ "internalType": "int256",
390
+ "name": "totalSy",
391
+ "type": "int256"
392
+ },
393
+ {
394
+ "internalType": "int256",
395
+ "name": "totalLp",
396
+ "type": "int256"
397
+ },
398
+ {
399
+ "internalType": "address",
400
+ "name": "treasury",
401
+ "type": "address"
402
+ },
403
+ {
404
+ "internalType": "int256",
405
+ "name": "scalarRoot",
406
+ "type": "int256"
407
+ },
408
+ {
409
+ "internalType": "uint256",
410
+ "name": "expiry",
411
+ "type": "uint256"
412
+ },
413
+ {
414
+ "internalType": "uint256",
415
+ "name": "lnFeeRateRoot",
416
+ "type": "uint256"
417
+ },
418
+ {
419
+ "internalType": "uint256",
420
+ "name": "reserveFeePercent",
421
+ "type": "uint256"
422
+ },
423
+ {
424
+ "internalType": "uint256",
425
+ "name": "lastLnImpliedRate",
426
+ "type": "uint256"
427
+ }
428
+ ],
429
+ "internalType": "struct MarketState",
430
+ "name": "state",
431
+ "type": "tuple"
432
+ },
433
+ {
434
+ "internalType": "PYIndex",
435
+ "name": "index",
436
+ "type": "uint256"
658
437
  },
659
438
  {
660
- "internalType": "int256",
661
- "name": "scalarRoot",
662
- "type": "int256"
439
+ "internalType": "uint256",
440
+ "name": "blockTime",
441
+ "type": "uint256"
442
+ }
443
+ ],
444
+ "internalType": "struct MarketExtState",
445
+ "name": "marketExt",
446
+ "type": "tuple"
447
+ },
448
+ {
449
+ "components": [
450
+ {
451
+ "internalType": "uint256",
452
+ "name": "buyYtIy",
453
+ "type": "uint256"
663
454
  },
664
455
  {
665
456
  "internalType": "uint256",
666
- "name": "expiry",
457
+ "name": "sellYtIy",
667
458
  "type": "uint256"
668
459
  },
669
460
  {
670
461
  "internalType": "uint256",
671
- "name": "lnFeeRateRoot",
462
+ "name": "targetSyRatio",
672
463
  "type": "uint256"
673
464
  },
674
465
  {
675
466
  "internalType": "uint256",
676
- "name": "reserveFeePercent",
467
+ "name": "maxSyRatio",
677
468
  "type": "uint256"
678
469
  },
679
470
  {
680
471
  "internalType": "uint256",
681
- "name": "lastLnImpliedRate",
472
+ "name": "minYtPtRatio",
473
+ "type": "uint256"
474
+ },
475
+ {
476
+ "internalType": "uint256",
477
+ "name": "numOfBins",
682
478
  "type": "uint256"
683
479
  }
684
480
  ],
685
- "internalType": "struct MarketState",
686
- "name": "state",
481
+ "internalType": "struct LongTradingSpecs",
482
+ "name": "specs",
687
483
  "type": "tuple"
688
- },
689
- {
690
- "internalType": "PYIndex",
691
- "name": "index",
692
- "type": "uint256"
693
- },
694
- {
695
- "internalType": "uint256",
696
- "name": "blockTime",
697
- "type": "uint256"
698
484
  }
699
485
  ],
700
- "internalType": "struct MarketExtState",
701
- "name": "marketExt",
486
+ "internalType": "struct StrategyData",
487
+ "name": "strategyData",
702
488
  "type": "tuple"
703
489
  },
704
490
  {
@@ -740,23 +526,17 @@
740
526
  }
741
527
  ],
742
528
  "internalType": "struct ApproxParams",
743
- "name": "intParams",
529
+ "name": "swapApproxParams",
744
530
  "type": "tuple"
745
531
  }
746
532
  ],
747
- "name": "searchForIntParam",
533
+ "name": "previewAction",
748
534
  "outputs": [
749
535
  {
750
- "internalType": "uint256",
536
+ "internalType": "bool",
751
537
  "name": "",
752
- "type": "uint256"
753
- }
754
- ],
755
- "stateMutability": "pure",
756
- "type": "function"
757
- },
758
- {
759
- "inputs": [
538
+ "type": "bool"
539
+ },
760
540
  {
761
541
  "components": [
762
542
  {
@@ -773,10 +553,15 @@
773
553
  "internalType": "uint256",
774
554
  "name": "syBalance",
775
555
  "type": "uint256"
556
+ },
557
+ {
558
+ "internalType": "uint256",
559
+ "name": "buyBins",
560
+ "type": "uint256"
776
561
  }
777
562
  ],
778
563
  "internalType": "struct BotState",
779
- "name": "bot",
564
+ "name": "",
780
565
  "type": "tuple"
781
566
  },
782
567
  {
@@ -845,68 +630,244 @@
845
630
  }
846
631
  ],
847
632
  "internalType": "struct MarketExtState",
848
- "name": "marketExt",
633
+ "name": "",
849
634
  "type": "tuple"
850
- },
635
+ }
636
+ ],
637
+ "stateMutability": "view",
638
+ "type": "function"
639
+ },
640
+ {
641
+ "inputs": [
851
642
  {
852
643
  "components": [
853
644
  {
854
- "internalType": "uint256",
855
- "name": "lowerIyLimit",
856
- "type": "uint256"
645
+ "components": [
646
+ {
647
+ "internalType": "uint256",
648
+ "name": "lpBalance",
649
+ "type": "uint256"
650
+ },
651
+ {
652
+ "internalType": "uint256",
653
+ "name": "ytBalance",
654
+ "type": "uint256"
655
+ },
656
+ {
657
+ "internalType": "uint256",
658
+ "name": "syBalance",
659
+ "type": "uint256"
660
+ },
661
+ {
662
+ "internalType": "uint256",
663
+ "name": "buyBins",
664
+ "type": "uint256"
665
+ }
666
+ ],
667
+ "internalType": "struct BotState",
668
+ "name": "botState",
669
+ "type": "tuple"
670
+ },
671
+ {
672
+ "components": [
673
+ {
674
+ "components": [
675
+ {
676
+ "internalType": "int256",
677
+ "name": "totalPt",
678
+ "type": "int256"
679
+ },
680
+ {
681
+ "internalType": "int256",
682
+ "name": "totalSy",
683
+ "type": "int256"
684
+ },
685
+ {
686
+ "internalType": "int256",
687
+ "name": "totalLp",
688
+ "type": "int256"
689
+ },
690
+ {
691
+ "internalType": "address",
692
+ "name": "treasury",
693
+ "type": "address"
694
+ },
695
+ {
696
+ "internalType": "int256",
697
+ "name": "scalarRoot",
698
+ "type": "int256"
699
+ },
700
+ {
701
+ "internalType": "uint256",
702
+ "name": "expiry",
703
+ "type": "uint256"
704
+ },
705
+ {
706
+ "internalType": "uint256",
707
+ "name": "lnFeeRateRoot",
708
+ "type": "uint256"
709
+ },
710
+ {
711
+ "internalType": "uint256",
712
+ "name": "reserveFeePercent",
713
+ "type": "uint256"
714
+ },
715
+ {
716
+ "internalType": "uint256",
717
+ "name": "lastLnImpliedRate",
718
+ "type": "uint256"
719
+ }
720
+ ],
721
+ "internalType": "struct MarketState",
722
+ "name": "state",
723
+ "type": "tuple"
724
+ },
725
+ {
726
+ "internalType": "PYIndex",
727
+ "name": "index",
728
+ "type": "uint256"
729
+ },
730
+ {
731
+ "internalType": "uint256",
732
+ "name": "blockTime",
733
+ "type": "uint256"
734
+ }
735
+ ],
736
+ "internalType": "struct MarketExtState",
737
+ "name": "marketExt",
738
+ "type": "tuple"
857
739
  },
740
+ {
741
+ "components": [
742
+ {
743
+ "internalType": "uint256",
744
+ "name": "buyYtIy",
745
+ "type": "uint256"
746
+ },
747
+ {
748
+ "internalType": "uint256",
749
+ "name": "sellYtIy",
750
+ "type": "uint256"
751
+ },
752
+ {
753
+ "internalType": "uint256",
754
+ "name": "targetSyRatio",
755
+ "type": "uint256"
756
+ },
757
+ {
758
+ "internalType": "uint256",
759
+ "name": "maxSyRatio",
760
+ "type": "uint256"
761
+ },
762
+ {
763
+ "internalType": "uint256",
764
+ "name": "minYtPtRatio",
765
+ "type": "uint256"
766
+ },
767
+ {
768
+ "internalType": "uint256",
769
+ "name": "numOfBins",
770
+ "type": "uint256"
771
+ }
772
+ ],
773
+ "internalType": "struct LongTradingSpecs",
774
+ "name": "specs",
775
+ "type": "tuple"
776
+ }
777
+ ],
778
+ "internalType": "struct StrategyData",
779
+ "name": "strategyData",
780
+ "type": "tuple"
781
+ },
782
+ {
783
+ "internalType": "enum ActionType",
784
+ "name": "action",
785
+ "type": "uint8"
786
+ },
787
+ {
788
+ "internalType": "uint256",
789
+ "name": "targetIy",
790
+ "type": "uint256"
791
+ },
792
+ {
793
+ "internalType": "uint256",
794
+ "name": "rebalanceAdditionalCheck",
795
+ "type": "uint256"
796
+ },
797
+ {
798
+ "components": [
858
799
  {
859
800
  "internalType": "uint256",
860
- "name": "upperIyLimit",
801
+ "name": "guessMin",
861
802
  "type": "uint256"
862
803
  },
863
804
  {
864
805
  "internalType": "uint256",
865
- "name": "floatingSyRatioLimit",
806
+ "name": "guessMax",
866
807
  "type": "uint256"
867
808
  },
868
809
  {
869
810
  "internalType": "uint256",
870
- "name": "floatingSyRatioTarget",
811
+ "name": "guessOffchain",
871
812
  "type": "uint256"
872
813
  },
873
814
  {
874
815
  "internalType": "uint256",
875
- "name": "ytPtRatioLimit",
816
+ "name": "maxIteration",
876
817
  "type": "uint256"
877
818
  },
878
819
  {
879
820
  "internalType": "uint256",
880
- "name": "ytPtRatioTarget",
821
+ "name": "eps",
881
822
  "type": "uint256"
882
823
  }
883
824
  ],
884
- "internalType": "struct LongTradingSpecs",
885
- "name": "specs",
825
+ "internalType": "struct ApproxParams",
826
+ "name": "botParams",
886
827
  "type": "tuple"
887
- }
888
- ],
889
- "name": "strategyState",
890
- "outputs": [
828
+ },
891
829
  {
892
830
  "components": [
893
831
  {
894
- "internalType": "enum StrategyFlag",
895
- "name": "iyFlag",
896
- "type": "uint8"
832
+ "internalType": "uint256",
833
+ "name": "guessMin",
834
+ "type": "uint256"
835
+ },
836
+ {
837
+ "internalType": "uint256",
838
+ "name": "guessMax",
839
+ "type": "uint256"
840
+ },
841
+ {
842
+ "internalType": "uint256",
843
+ "name": "guessOffchain",
844
+ "type": "uint256"
845
+ },
846
+ {
847
+ "internalType": "uint256",
848
+ "name": "maxIteration",
849
+ "type": "uint256"
897
850
  },
898
851
  {
899
- "internalType": "enum StrategyFlag",
900
- "name": "syRatioFlag",
901
- "type": "uint8"
852
+ "internalType": "uint256",
853
+ "name": "eps",
854
+ "type": "uint256"
902
855
  }
903
856
  ],
904
- "internalType": "struct StrategyState",
905
- "name": "",
857
+ "internalType": "struct ApproxParams",
858
+ "name": "intParams",
906
859
  "type": "tuple"
907
860
  }
908
861
  ],
909
- "stateMutability": "pure",
862
+ "name": "searchForBotParam",
863
+ "outputs": [
864
+ {
865
+ "internalType": "uint256",
866
+ "name": "",
867
+ "type": "uint256"
868
+ }
869
+ ],
870
+ "stateMutability": "view",
910
871
  "type": "function"
911
872
  }
912
873
  ],