@pendle/core-v2 2.17.5-tradingbot → 2.17.7-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 (162) 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/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  6. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  10. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  12. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  14. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  16. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  18. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
  19. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
  20. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
  21. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  22. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  23. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  24. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  25. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  26. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
  27. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
  28. package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
  29. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
  30. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
  32. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
  34. package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
  36. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/TradingBot/BotActionCallback.sol/BotActionCallback.dbg.json +1 -1
  48. package/build/artifacts/contracts/core/TradingBot/BotActionCallback.sol/BotActionCallback.json +25 -0
  49. package/build/artifacts/contracts/core/TradingBot/BotActionHelper.sol/BotActionHelper.dbg.json +1 -1
  50. package/build/artifacts/contracts/core/TradingBot/BotActionHelper.sol/BotActionHelper.json +25 -0
  51. package/build/artifacts/contracts/core/TradingBot/BotDecisionHelper.sol/BotDecisionHelper.dbg.json +4 -0
  52. package/build/artifacts/contracts/core/TradingBot/BotDecisionHelper.sol/BotDecisionHelper.json +1070 -0
  53. package/build/artifacts/contracts/core/TradingBot/BotSimulationLib.sol/BotSimulationLib.dbg.json +1 -1
  54. package/build/artifacts/contracts/core/TradingBot/BotSimulationLib.sol/BotSimulationLib.json +2 -2
  55. package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.dbg.json +1 -1
  56. package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.json +60 -180
  57. package/build/artifacts/contracts/core/TradingBot/MarketExtLib.sol/MarketExtLib.dbg.json +1 -1
  58. package/build/artifacts/contracts/core/TradingBot/MarketExtLib.sol/MarketExtLib.json +2 -2
  59. package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.dbg.json +1 -1
  60. package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.json +25 -0
  61. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  62. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  63. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
  65. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
  66. package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
  67. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  68. package/build/artifacts/contracts/core/libraries/TokenAmountLib.sol/TokenAmountLib.dbg.json +1 -1
  69. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  70. package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  71. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  73. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  77. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  79. package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  81. package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/TradingBot/IBotDecisionHelper.sol/IBotDecisionHelper.dbg.json +4 -0
  87. package/build/artifacts/contracts/interfaces/TradingBot/IBotDecisionHelper.sol/IBotDecisionHelper.json +917 -0
  88. package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.json +425 -161
  90. package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.json +50 -0
  92. package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  93. package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  94. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
  95. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
  96. package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
  97. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  98. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  99. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  100. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  101. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  102. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  103. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  104. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  105. package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  106. package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
  107. package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
  108. package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
  109. package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
  110. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  111. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  112. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  113. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  114. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  115. package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
  116. package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
  117. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  118. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  119. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  120. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  121. package/contracts/core/TradingBot/BotActionCallback.sol +1 -1
  122. package/contracts/core/TradingBot/BotDecisionHelper.sol +306 -0
  123. package/contracts/core/TradingBot/BotSimulationLib.sol +8 -7
  124. package/contracts/core/TradingBot/LongYieldTradingBot.sol +20 -24
  125. package/contracts/core/TradingBot/MarketExtLib.sol +64 -31
  126. package/contracts/core/TradingBot/README.md +27 -25
  127. package/contracts/core/TradingBot/TradingBotBase.sol +36 -16
  128. package/contracts/interfaces/TradingBot/IBotDecisionHelper.sol +91 -0
  129. package/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol +7 -32
  130. package/contracts/interfaces/TradingBot/ITradingBotBase.sol +6 -4
  131. package/package.json +1 -1
  132. package/typechain-types/BotActionCallback.ts +36 -0
  133. package/typechain-types/BotActionHelper.ts +36 -0
  134. package/typechain-types/BotDecisionHelper.ts +527 -0
  135. package/typechain-types/IBotDecisionHelper.ts +507 -0
  136. package/typechain-types/ILongYieldTradingBot.ts +481 -129
  137. package/typechain-types/ITradingBotBase.ts +76 -0
  138. package/typechain-types/IWBETH.ts +128 -0
  139. package/typechain-types/LongYieldTradingBot.ts +85 -141
  140. package/typechain-types/PendleBinanceEth.ts +1229 -0
  141. package/typechain-types/PtAndLpToAsset.ts +136 -0
  142. package/typechain-types/TradingBotBase.ts +36 -0
  143. package/typechain-types/factories/BotActionCallback__factory.ts +25 -0
  144. package/typechain-types/factories/BotActionHelper__factory.ts +25 -0
  145. package/typechain-types/factories/BotDecisionHelper__factory.ts +1123 -0
  146. package/typechain-types/factories/IBotDecisionHelper__factory.ts +932 -0
  147. package/typechain-types/factories/ILongYieldTradingBot__factory.ts +425 -161
  148. package/typechain-types/factories/ITradingBotBase__factory.ts +50 -0
  149. package/typechain-types/factories/IWBETH__factory.ts +51 -0
  150. package/typechain-types/factories/LongYieldTradingBot__factory.ts +63 -183
  151. package/typechain-types/factories/MarketExtLib__factory.ts +1 -1
  152. package/typechain-types/factories/PendleBinanceEth__factory.ts +1052 -0
  153. package/typechain-types/factories/PtAndLpToAsset__factory.ts +150 -0
  154. package/typechain-types/factories/TradingBotBase__factory.ts +25 -0
  155. package/typechain-types/hardhat.d.ts +49 -13
  156. package/typechain-types/index.ts +12 -4
  157. package/build/artifacts/contracts/core/TradingBot/BotDecisionLib.sol/BotDecisionLib.dbg.json +0 -4
  158. package/build/artifacts/contracts/core/TradingBot/BotDecisionLib.sol/BotDecisionLib.json +0 -589
  159. package/build/artifacts/contracts/core/TradingBot/TradingBotOffchain.sol/TradingBotOffchain.dbg.json +0 -4
  160. package/build/artifacts/contracts/core/TradingBot/TradingBotOffchain.sol/TradingBotOffchain.json +0 -1075
  161. package/contracts/core/TradingBot/BotDecisionLib.sol +0 -274
  162. package/contracts/core/TradingBot/TradingBotOffchain.sol +0 -141
@@ -0,0 +1,527 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ import {
5
+ BaseContract,
6
+ BigNumber,
7
+ BigNumberish,
8
+ BytesLike,
9
+ CallOverrides,
10
+ PopulatedTransaction,
11
+ Signer,
12
+ utils,
13
+ } from "ethers";
14
+ import { FunctionFragment, Result } from "@ethersproject/abi";
15
+ import { Listener, Provider } from "@ethersproject/providers";
16
+ import type {
17
+ TypedEventFilter,
18
+ TypedEvent,
19
+ TypedListener,
20
+ OnEvent,
21
+ } from "./common";
22
+
23
+ export type BotStateStruct = {
24
+ lpBalance: BigNumberish;
25
+ ytBalance: BigNumberish;
26
+ syBalance: BigNumberish;
27
+ };
28
+
29
+ export type BotStateStructOutput = [BigNumber, BigNumber, BigNumber] & {
30
+ lpBalance: BigNumber;
31
+ ytBalance: BigNumber;
32
+ syBalance: BigNumber;
33
+ };
34
+
35
+ export type StrategyStateStruct = {
36
+ iyFlag: BigNumberish;
37
+ syRatioFlag: BigNumberish;
38
+ };
39
+
40
+ export type StrategyStateStructOutput = [number, number] & {
41
+ iyFlag: number;
42
+ syRatioFlag: number;
43
+ };
44
+
45
+ export type MarketStateStruct = {
46
+ totalPt: BigNumberish;
47
+ totalSy: BigNumberish;
48
+ totalLp: BigNumberish;
49
+ treasury: string;
50
+ scalarRoot: BigNumberish;
51
+ expiry: BigNumberish;
52
+ lnFeeRateRoot: BigNumberish;
53
+ reserveFeePercent: BigNumberish;
54
+ lastLnImpliedRate: BigNumberish;
55
+ };
56
+
57
+ export type MarketStateStructOutput = [
58
+ BigNumber,
59
+ BigNumber,
60
+ BigNumber,
61
+ string,
62
+ BigNumber,
63
+ BigNumber,
64
+ BigNumber,
65
+ BigNumber,
66
+ BigNumber
67
+ ] & {
68
+ totalPt: BigNumber;
69
+ totalSy: BigNumber;
70
+ totalLp: BigNumber;
71
+ treasury: string;
72
+ scalarRoot: BigNumber;
73
+ expiry: BigNumber;
74
+ lnFeeRateRoot: BigNumber;
75
+ reserveFeePercent: BigNumber;
76
+ lastLnImpliedRate: BigNumber;
77
+ };
78
+
79
+ export type MarketExtStateStruct = {
80
+ state: MarketStateStruct;
81
+ index: BigNumberish;
82
+ blockTime: BigNumberish;
83
+ };
84
+
85
+ export type MarketExtStateStructOutput = [
86
+ MarketStateStructOutput,
87
+ BigNumber,
88
+ BigNumber
89
+ ] & { state: MarketStateStructOutput; index: BigNumber; blockTime: BigNumber };
90
+
91
+ export type ApproxParamsStruct = {
92
+ guessMin: BigNumberish;
93
+ guessMax: BigNumberish;
94
+ guessOffchain: BigNumberish;
95
+ maxIteration: BigNumberish;
96
+ eps: BigNumberish;
97
+ };
98
+
99
+ export type ApproxParamsStructOutput = [
100
+ BigNumber,
101
+ BigNumber,
102
+ BigNumber,
103
+ BigNumber,
104
+ BigNumber
105
+ ] & {
106
+ guessMin: BigNumber;
107
+ guessMax: BigNumber;
108
+ guessOffchain: BigNumber;
109
+ maxIteration: BigNumber;
110
+ eps: BigNumber;
111
+ };
112
+
113
+ export type LongTradingSpecsStruct = {
114
+ lowerIyLimit: BigNumberish;
115
+ upperIyLimit: BigNumberish;
116
+ floatingSyRatioLimit: BigNumberish;
117
+ floatingSyRatioTarget: BigNumberish;
118
+ ytPtRatioLimit: BigNumberish;
119
+ ytPtRatioTarget: BigNumberish;
120
+ };
121
+
122
+ export type LongTradingSpecsStructOutput = [
123
+ BigNumber,
124
+ BigNumber,
125
+ BigNumber,
126
+ BigNumber,
127
+ BigNumber,
128
+ BigNumber
129
+ ] & {
130
+ lowerIyLimit: BigNumber;
131
+ upperIyLimit: BigNumber;
132
+ floatingSyRatioLimit: BigNumber;
133
+ floatingSyRatioTarget: BigNumber;
134
+ ytPtRatioLimit: BigNumber;
135
+ ytPtRatioTarget: BigNumber;
136
+ };
137
+
138
+ export interface BotDecisionHelperInterface extends utils.Interface {
139
+ contractName: "BotDecisionHelper";
140
+ functions: {
141
+ "actionToTake((uint256,uint256,uint256),(uint8,uint8))": FunctionFragment;
142
+ "botExtStats((uint256,uint256,uint256),((int256,int256,int256,address,int256,uint256,uint256,uint256,uint256),uint256,uint256))": FunctionFragment;
143
+ "previewAction((uint256,uint256,uint256),((int256,int256,int256,address,int256,uint256,uint256,uint256,uint256),uint256,uint256),uint8,uint256,(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
144
+ "searchForBotParam((uint256,uint256,uint256),((int256,int256,int256,address,int256,uint256,uint256,uint256,uint256),uint256,uint256),(uint256,uint256,uint256,uint256,uint256,uint256),uint8,(uint256,uint256,uint256,uint256,uint256),(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
145
+ "searchForIntParam(((int256,int256,int256,address,int256,uint256,uint256,uint256,uint256),uint256,uint256),uint8,uint256,(uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
146
+ "strategyState((uint256,uint256,uint256),((int256,int256,int256,address,int256,uint256,uint256,uint256,uint256),uint256,uint256),(uint256,uint256,uint256,uint256,uint256,uint256))": FunctionFragment;
147
+ };
148
+
149
+ encodeFunctionData(
150
+ functionFragment: "actionToTake",
151
+ values: [BotStateStruct, StrategyStateStruct]
152
+ ): string;
153
+ encodeFunctionData(
154
+ functionFragment: "botExtStats",
155
+ values: [BotStateStruct, MarketExtStateStruct]
156
+ ): string;
157
+ encodeFunctionData(
158
+ functionFragment: "previewAction",
159
+ values: [
160
+ BotStateStruct,
161
+ MarketExtStateStruct,
162
+ BigNumberish,
163
+ BigNumberish,
164
+ ApproxParamsStruct
165
+ ]
166
+ ): string;
167
+ encodeFunctionData(
168
+ functionFragment: "searchForBotParam",
169
+ values: [
170
+ BotStateStruct,
171
+ MarketExtStateStruct,
172
+ LongTradingSpecsStruct,
173
+ BigNumberish,
174
+ ApproxParamsStruct,
175
+ ApproxParamsStruct
176
+ ]
177
+ ): string;
178
+ encodeFunctionData(
179
+ functionFragment: "searchForIntParam",
180
+ values: [
181
+ MarketExtStateStruct,
182
+ BigNumberish,
183
+ BigNumberish,
184
+ ApproxParamsStruct
185
+ ]
186
+ ): string;
187
+ encodeFunctionData(
188
+ functionFragment: "strategyState",
189
+ values: [BotStateStruct, MarketExtStateStruct, LongTradingSpecsStruct]
190
+ ): string;
191
+
192
+ decodeFunctionResult(
193
+ functionFragment: "actionToTake",
194
+ data: BytesLike
195
+ ): Result;
196
+ decodeFunctionResult(
197
+ functionFragment: "botExtStats",
198
+ data: BytesLike
199
+ ): Result;
200
+ decodeFunctionResult(
201
+ functionFragment: "previewAction",
202
+ data: BytesLike
203
+ ): Result;
204
+ decodeFunctionResult(
205
+ functionFragment: "searchForBotParam",
206
+ data: BytesLike
207
+ ): Result;
208
+ decodeFunctionResult(
209
+ functionFragment: "searchForIntParam",
210
+ data: BytesLike
211
+ ): Result;
212
+ decodeFunctionResult(
213
+ functionFragment: "strategyState",
214
+ data: BytesLike
215
+ ): Result;
216
+
217
+ events: {};
218
+ }
219
+
220
+ export interface BotDecisionHelper extends BaseContract {
221
+ contractName: "BotDecisionHelper";
222
+ connect(signerOrProvider: Signer | Provider | string): this;
223
+ attach(addressOrName: string): this;
224
+ deployed(): Promise<this>;
225
+
226
+ interface: BotDecisionHelperInterface;
227
+
228
+ queryFilter<TEvent extends TypedEvent>(
229
+ event: TypedEventFilter<TEvent>,
230
+ fromBlockOrBlockhash?: string | number | undefined,
231
+ toBlock?: string | number | undefined
232
+ ): Promise<Array<TEvent>>;
233
+
234
+ listeners<TEvent extends TypedEvent>(
235
+ eventFilter?: TypedEventFilter<TEvent>
236
+ ): Array<TypedListener<TEvent>>;
237
+ listeners(eventName?: string): Array<Listener>;
238
+ removeAllListeners<TEvent extends TypedEvent>(
239
+ eventFilter: TypedEventFilter<TEvent>
240
+ ): this;
241
+ removeAllListeners(eventName?: string): this;
242
+ off: OnEvent<this>;
243
+ on: OnEvent<this>;
244
+ once: OnEvent<this>;
245
+ removeListener: OnEvent<this>;
246
+
247
+ functions: {
248
+ actionToTake(
249
+ botState: BotStateStruct,
250
+ currentState: StrategyStateStruct,
251
+ overrides?: CallOverrides
252
+ ): Promise<[number]>;
253
+
254
+ botExtStats(
255
+ bot: BotStateStruct,
256
+ marketExt: MarketExtStateStruct,
257
+ overrides?: CallOverrides
258
+ ): Promise<
259
+ [BigNumber, BigNumber, BigNumber, BigNumber] & {
260
+ tvlInSy: BigNumber;
261
+ iy: BigNumber;
262
+ currentSyRatio: BigNumber;
263
+ currentYtPtRatio: BigNumber;
264
+ }
265
+ >;
266
+
267
+ previewAction(
268
+ botData: BotStateStruct,
269
+ marketExtData: MarketExtStateStruct,
270
+ action: BigNumberish,
271
+ botParam: BigNumberish,
272
+ swapApproxParams: ApproxParamsStruct,
273
+ overrides?: CallOverrides
274
+ ): Promise<
275
+ [boolean, BotStateStructOutput, MarketExtStateStructOutput] & {
276
+ success: boolean;
277
+ bot: BotStateStructOutput;
278
+ marketExt: MarketExtStateStructOutput;
279
+ }
280
+ >;
281
+
282
+ searchForBotParam(
283
+ bot: BotStateStruct,
284
+ marketExt: MarketExtStateStruct,
285
+ specs: LongTradingSpecsStruct,
286
+ action: BigNumberish,
287
+ botParams: ApproxParamsStruct,
288
+ intParams: ApproxParamsStruct,
289
+ overrides?: CallOverrides
290
+ ): Promise<[BigNumber, number]>;
291
+
292
+ searchForIntParam(
293
+ marketExt: MarketExtStateStruct,
294
+ action: BigNumberish,
295
+ botParam: BigNumberish,
296
+ intParams: ApproxParamsStruct,
297
+ overrides?: CallOverrides
298
+ ): Promise<[BigNumber]>;
299
+
300
+ strategyState(
301
+ bot: BotStateStruct,
302
+ marketExt: MarketExtStateStruct,
303
+ specs: LongTradingSpecsStruct,
304
+ overrides?: CallOverrides
305
+ ): Promise<
306
+ [StrategyStateStructOutput] & { currentState: StrategyStateStructOutput }
307
+ >;
308
+ };
309
+
310
+ actionToTake(
311
+ botState: BotStateStruct,
312
+ currentState: StrategyStateStruct,
313
+ overrides?: CallOverrides
314
+ ): Promise<number>;
315
+
316
+ botExtStats(
317
+ bot: BotStateStruct,
318
+ marketExt: MarketExtStateStruct,
319
+ overrides?: CallOverrides
320
+ ): Promise<
321
+ [BigNumber, BigNumber, BigNumber, BigNumber] & {
322
+ tvlInSy: BigNumber;
323
+ iy: BigNumber;
324
+ currentSyRatio: BigNumber;
325
+ currentYtPtRatio: BigNumber;
326
+ }
327
+ >;
328
+
329
+ previewAction(
330
+ botData: BotStateStruct,
331
+ marketExtData: MarketExtStateStruct,
332
+ action: BigNumberish,
333
+ botParam: BigNumberish,
334
+ swapApproxParams: ApproxParamsStruct,
335
+ overrides?: CallOverrides
336
+ ): Promise<
337
+ [boolean, BotStateStructOutput, MarketExtStateStructOutput] & {
338
+ success: boolean;
339
+ bot: BotStateStructOutput;
340
+ marketExt: MarketExtStateStructOutput;
341
+ }
342
+ >;
343
+
344
+ searchForBotParam(
345
+ bot: BotStateStruct,
346
+ marketExt: MarketExtStateStruct,
347
+ specs: LongTradingSpecsStruct,
348
+ action: BigNumberish,
349
+ botParams: ApproxParamsStruct,
350
+ intParams: ApproxParamsStruct,
351
+ overrides?: CallOverrides
352
+ ): Promise<[BigNumber, number]>;
353
+
354
+ searchForIntParam(
355
+ marketExt: MarketExtStateStruct,
356
+ action: BigNumberish,
357
+ botParam: BigNumberish,
358
+ intParams: ApproxParamsStruct,
359
+ overrides?: CallOverrides
360
+ ): Promise<BigNumber>;
361
+
362
+ strategyState(
363
+ bot: BotStateStruct,
364
+ marketExt: MarketExtStateStruct,
365
+ specs: LongTradingSpecsStruct,
366
+ overrides?: CallOverrides
367
+ ): Promise<StrategyStateStructOutput>;
368
+
369
+ callStatic: {
370
+ actionToTake(
371
+ botState: BotStateStruct,
372
+ currentState: StrategyStateStruct,
373
+ overrides?: CallOverrides
374
+ ): Promise<number>;
375
+
376
+ botExtStats(
377
+ bot: BotStateStruct,
378
+ marketExt: MarketExtStateStruct,
379
+ overrides?: CallOverrides
380
+ ): Promise<
381
+ [BigNumber, BigNumber, BigNumber, BigNumber] & {
382
+ tvlInSy: BigNumber;
383
+ iy: BigNumber;
384
+ currentSyRatio: BigNumber;
385
+ currentYtPtRatio: BigNumber;
386
+ }
387
+ >;
388
+
389
+ previewAction(
390
+ botData: BotStateStruct,
391
+ marketExtData: MarketExtStateStruct,
392
+ action: BigNumberish,
393
+ botParam: BigNumberish,
394
+ swapApproxParams: ApproxParamsStruct,
395
+ overrides?: CallOverrides
396
+ ): Promise<
397
+ [boolean, BotStateStructOutput, MarketExtStateStructOutput] & {
398
+ success: boolean;
399
+ bot: BotStateStructOutput;
400
+ marketExt: MarketExtStateStructOutput;
401
+ }
402
+ >;
403
+
404
+ searchForBotParam(
405
+ bot: BotStateStruct,
406
+ marketExt: MarketExtStateStruct,
407
+ specs: LongTradingSpecsStruct,
408
+ action: BigNumberish,
409
+ botParams: ApproxParamsStruct,
410
+ intParams: ApproxParamsStruct,
411
+ overrides?: CallOverrides
412
+ ): Promise<[BigNumber, number]>;
413
+
414
+ searchForIntParam(
415
+ marketExt: MarketExtStateStruct,
416
+ action: BigNumberish,
417
+ botParam: BigNumberish,
418
+ intParams: ApproxParamsStruct,
419
+ overrides?: CallOverrides
420
+ ): Promise<BigNumber>;
421
+
422
+ strategyState(
423
+ bot: BotStateStruct,
424
+ marketExt: MarketExtStateStruct,
425
+ specs: LongTradingSpecsStruct,
426
+ overrides?: CallOverrides
427
+ ): Promise<StrategyStateStructOutput>;
428
+ };
429
+
430
+ filters: {};
431
+
432
+ estimateGas: {
433
+ actionToTake(
434
+ botState: BotStateStruct,
435
+ currentState: StrategyStateStruct,
436
+ overrides?: CallOverrides
437
+ ): Promise<BigNumber>;
438
+
439
+ botExtStats(
440
+ bot: BotStateStruct,
441
+ marketExt: MarketExtStateStruct,
442
+ overrides?: CallOverrides
443
+ ): Promise<BigNumber>;
444
+
445
+ previewAction(
446
+ botData: BotStateStruct,
447
+ marketExtData: MarketExtStateStruct,
448
+ action: BigNumberish,
449
+ botParam: BigNumberish,
450
+ swapApproxParams: ApproxParamsStruct,
451
+ overrides?: CallOverrides
452
+ ): Promise<BigNumber>;
453
+
454
+ searchForBotParam(
455
+ bot: BotStateStruct,
456
+ marketExt: MarketExtStateStruct,
457
+ specs: LongTradingSpecsStruct,
458
+ action: BigNumberish,
459
+ botParams: ApproxParamsStruct,
460
+ intParams: ApproxParamsStruct,
461
+ overrides?: CallOverrides
462
+ ): Promise<BigNumber>;
463
+
464
+ searchForIntParam(
465
+ marketExt: MarketExtStateStruct,
466
+ action: BigNumberish,
467
+ botParam: BigNumberish,
468
+ intParams: ApproxParamsStruct,
469
+ overrides?: CallOverrides
470
+ ): Promise<BigNumber>;
471
+
472
+ strategyState(
473
+ bot: BotStateStruct,
474
+ marketExt: MarketExtStateStruct,
475
+ specs: LongTradingSpecsStruct,
476
+ overrides?: CallOverrides
477
+ ): Promise<BigNumber>;
478
+ };
479
+
480
+ populateTransaction: {
481
+ actionToTake(
482
+ botState: BotStateStruct,
483
+ currentState: StrategyStateStruct,
484
+ overrides?: CallOverrides
485
+ ): Promise<PopulatedTransaction>;
486
+
487
+ botExtStats(
488
+ bot: BotStateStruct,
489
+ marketExt: MarketExtStateStruct,
490
+ overrides?: CallOverrides
491
+ ): Promise<PopulatedTransaction>;
492
+
493
+ previewAction(
494
+ botData: BotStateStruct,
495
+ marketExtData: MarketExtStateStruct,
496
+ action: BigNumberish,
497
+ botParam: BigNumberish,
498
+ swapApproxParams: ApproxParamsStruct,
499
+ overrides?: CallOverrides
500
+ ): Promise<PopulatedTransaction>;
501
+
502
+ searchForBotParam(
503
+ bot: BotStateStruct,
504
+ marketExt: MarketExtStateStruct,
505
+ specs: LongTradingSpecsStruct,
506
+ action: BigNumberish,
507
+ botParams: ApproxParamsStruct,
508
+ intParams: ApproxParamsStruct,
509
+ overrides?: CallOverrides
510
+ ): Promise<PopulatedTransaction>;
511
+
512
+ searchForIntParam(
513
+ marketExt: MarketExtStateStruct,
514
+ action: BigNumberish,
515
+ botParam: BigNumberish,
516
+ intParams: ApproxParamsStruct,
517
+ overrides?: CallOverrides
518
+ ): Promise<PopulatedTransaction>;
519
+
520
+ strategyState(
521
+ bot: BotStateStruct,
522
+ marketExt: MarketExtStateStruct,
523
+ specs: LongTradingSpecsStruct,
524
+ overrides?: CallOverrides
525
+ ): Promise<PopulatedTransaction>;
526
+ };
527
+ }