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