@pendle/core-v2 2.19.1-tradingbot → 2.20.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.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAWethHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearMath.sol/LinearMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol/LinearPreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileLpHelper.sol/CamelotV1VolatileLpHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/GLPPreviewHelper.sol/GLPPreviewHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/TradingBot/DecisionHelper/BotDecisionHelperBase.sol/BotDecisionHelperBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/TradingBot/{base → DecisionHelper}/BotDecisionHelperBase.sol/BotDecisionHelperBase.json +93 -66
- package/build/artifacts/contracts/core/TradingBot/DecisionHelper/LongYieldDecisionHelper.sol/LongYieldDecisionHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/TradingBot/DecisionHelper/LongYieldDecisionHelper.sol/LongYieldDecisionHelper.json +1411 -0
- package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.dbg.json +4 -0
- package/build/artifacts/contracts/core/TradingBot/LongYieldTradingBot.sol/LongYieldTradingBot.json +2332 -0
- package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/TradingBot/TradingBotBase.sol/TradingBotBase.json +1641 -0
- package/build/artifacts/contracts/core/TradingBot/libraries/BotSimulationLib.sol/BotSimulationLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/TradingBot/libraries/BotSimulationLib.sol/BotSimulationLib.json +2 -2
- package/build/artifacts/contracts/core/TradingBot/libraries/LongYieldActionLib.sol/LongYieldActionLib.dbg.json +4 -0
- package/build/artifacts/contracts/core/TradingBot/libraries/LongYieldActionLib.sol/LongYieldActionLib.json +154 -0
- package/build/artifacts/contracts/core/TradingBot/libraries/MarketExtLib.sol/MarketExtLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/TradingBot/libraries/MarketExtLib.sol/MarketExtLib.json +2 -2
- package/build/artifacts/contracts/core/TradingBot/libraries/SpecSegmentLib.sol/SpecSegmentLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/TradingBot/libraries/SpecSegmentLib.sol/SpecSegmentLib.json +2 -2
- package/build/artifacts/contracts/core/TradingBot/libraries/TvlLib.sol/TvlLib.dbg.json +4 -0
- package/build/artifacts/contracts/core/TradingBot/libraries/TvlLib.sol/TvlLib.json +262 -0
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenAmountLib.sol/TokenAmountLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IERC4626LinearPool.sol/IERC4626LinearPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotFactory.sol/ICamelotFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTFactory.sol/ICamelotNFTFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTHandler.sol/ICamelotNFTHandler.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPoolFactory.sol/ICamelotNitroPoolFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotRouter.sol/ICamelotRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotYieldBooster.sol/ICamelotYieldBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/IXGrail.sol/IXGrail.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Frax/IFrxEthMinter.sol/IFrxEthMinter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IGMXVault.sol/IGMXVault.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPtOracle.sol/IPPtOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateLP.sol/IStargateLP.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateStaking.sol/IStargateStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/IBotDecisionHelper.sol/IBotDecisionHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/IBotDecisionHelper.sol/IBotDecisionHelper.json +91 -64
- package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldDecisionHelper.sol/ILongYieldDecisionHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldDecisionHelper.sol/ILongYieldDecisionHelper.json +110 -83
- package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/ILongYieldTradingBot.sol/ILongYieldTradingBot.json +7 -171
- package/build/artifacts/contracts/interfaces/TradingBot/IShortYieldDecisionHelper.sol/IShortYieldDecisionHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/IShortYieldDecisionHelper.sol/IShortYieldDecisionHelper.json +91 -64
- package/build/artifacts/contracts/interfaces/TradingBot/IShortYieldTradingBot.sol/IShortYieldTradingBot.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/IShortYieldTradingBot.sol/IShortYieldTradingBot.json +7 -171
- package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/TradingBot/ITradingBotBase.sol/ITradingBotBase.json +7 -171
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IHashflow.sol/IHashflow.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol/KyberInputScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.dbg.json +1 -1
- package/contracts/core/StandardizedYield/PYIndex.sol +14 -0
- package/contracts/core/TradingBot/{base → DecisionHelper}/BotDecisionHelperBase.sol +60 -35
- package/contracts/core/TradingBot/{LongYield → DecisionHelper}/LongYieldDecisionHelper.sol +116 -41
- package/contracts/core/TradingBot/{LongYield/LongYieldTradingBot.sol → LongYieldTradingBot.sol} +41 -10
- package/contracts/core/TradingBot/TradingBotBase.sol +254 -0
- package/contracts/core/TradingBot/libraries/LongYieldActionLib.sol +279 -0
- package/contracts/core/TradingBot/libraries/SpecSegmentLib.sol +1 -1
- package/contracts/core/TradingBot/libraries/TvlLib.sol +57 -0
- package/contracts/interfaces/TradingBot/IBotDecisionHelper.sol +37 -19
- package/contracts/interfaces/TradingBot/ITradingBotBase.sol +6 -16
- package/contracts/oracles/PendleLpOracleLib.sol +1 -1
- package/deployments/core.ts +29 -0
- package/deployments/index.ts +4 -0
- package/deployments/markets/ape-june-29-2023.ts +3 -0
- package/deployments/markets/balancer-reth-dec-28-2023.ts +3 -0
- package/deployments/markets/balancer-wsteth-jun-27-2024.ts +3 -0
- package/deployments/markets/curve-fraxusdc-march-30-2023.ts +3 -0
- package/deployments/markets/index.ts +17 -0
- package/deployments/markets/looks-march-30-2023.ts +3 -0
- package/deployments/markets/steth-june-29-2023.ts +3 -0
- package/deployments/markets/steth-march-30-2023.ts +3 -0
- package/deployments/markets/types.ts +9 -0
- package/deployments/misc.ts +23 -0
- package/package.json +1 -1
- package/typechain-types/{PendleCamelotV1SY.ts → AuraEthxBbAWethSY.ts} +170 -599
- package/typechain-types/AuraSwEthBbAWethSYV2.ts +1532 -0
- package/typechain-types/AuraWethVethSY.ts +1598 -0
- package/typechain-types/AutomateReady.ts +102 -0
- package/typechain-types/AutomationBase.ts +57 -0
- package/typechain-types/AutomationCompatible.ts +140 -0
- package/typechain-types/AutomationCompatibleInterface.ts +141 -0
- package/typechain-types/BotActionCallbackLib.ts +57 -0
- package/typechain-types/BotDecisionHelperBase.ts +93 -69
- package/typechain-types/ChainlinkRelayerAutomation.ts +305 -0
- package/typechain-types/ChainlinkRelayerGelato.ts +311 -0
- package/typechain-types/{CamelotV1Preview.ts → ComposableStablePreviewProxy.ts} +5 -84
- package/typechain-types/ComposableStablePreviewV4.ts +217 -0
- package/typechain-types/ComposableStablePreviewV5.ts +217 -0
- package/typechain-types/IAutomate.ts +203 -0
- package/typechain-types/IBotDecisionHelper.ts +93 -69
- package/typechain-types/IFluxErc20.ts +298 -0
- package/typechain-types/{IExecutorHelper2.ts → IFluxInterestRateModel.ts} +35 -37
- package/typechain-types/ILongYieldDecisionHelper.ts +112 -86
- package/typechain-types/ILongYieldTradingBot.ts +28 -224
- package/typechain-types/IOpsProxyFactory.ts +93 -0
- package/typechain-types/IPComposableStablePreview.ts +217 -0
- package/typechain-types/IPExternalRewardDistributor.ts +38 -32
- package/typechain-types/{ICamelotSY.ts → IPOracleForSy.ts} +13 -26
- package/typechain-types/IShortYieldDecisionHelper.ts +93 -69
- package/typechain-types/IShortYieldTradingBot.ts +28 -224
- package/typechain-types/ITaskTreasuryUpgradable.ts +160 -0
- package/typechain-types/ITradingBotBase.ts +28 -224
- package/typechain-types/IVersion.ts +81 -0
- package/typechain-types/LegacyNFTHelper.ts +87 -0
- package/typechain-types/LongYieldActionLib.ts +57 -0
- package/typechain-types/LongYieldDecisionHelper.ts +139 -77
- package/typechain-types/LongYieldTradingBot.ts +1210 -154
- package/typechain-types/PendleAuraBalancerStableLPSYV3.ts +1599 -0
- package/typechain-types/PendleAuraWethVethSY.ts +1511 -0
- package/typechain-types/PendleBridgedLSDSY.ts +1222 -0
- package/typechain-types/PendleChainlinkReceiver.ts +239 -0
- package/typechain-types/PendleChainlinkRelayer.ts +158 -0
- package/typechain-types/PendleERC20PermitUpgradable.ts +452 -0
- package/typechain-types/PendleERC20Upgradable.ts +348 -0
- package/typechain-types/{PendleBinanceEth.ts → PendleERC4626SY.ts} +18 -31
- package/typechain-types/PendleExternalRewardDistributor.ts +136 -86
- package/typechain-types/PendleFluxLendingSY.ts +1232 -0
- package/typechain-types/PendleMantleStakedEthSY.ts +1222 -0
- package/typechain-types/PendleMarketFactoryV2.ts +26 -24
- package/typechain-types/PendleOracleForSyProxy.ts +275 -0
- package/typechain-types/SDKErrorsDirectory.ts +57 -0
- package/typechain-types/SYBaseUpgradable.ts +1132 -0
- package/typechain-types/SYBaseWithRewardsUpgradable.ts +1225 -0
- package/typechain-types/StarNFTV1.ts +880 -0
- package/typechain-types/{PendleSwETH.ts → SwETHSY.ts} +5 -5
- package/typechain-types/TradingBotBase.ts +1132 -151
- package/typechain-types/TvlLib.ts +215 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
- package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/AuraEthxBbAWethSY__factory.ts +1240 -0
- package/typechain-types/factories/AuraSwEthBbAWethSYV2__factory.ts +1244 -0
- package/typechain-types/factories/AuraWethVethSY__factory.ts +1270 -0
- package/typechain-types/factories/{ICamelotSY__factory.ts → AutomateReady__factory.ts} +9 -9
- package/typechain-types/factories/AutomationBase__factory.ts +69 -0
- package/typechain-types/factories/AutomationCompatibleInterface__factory.ts +67 -0
- package/typechain-types/factories/AutomationCompatible__factory.ts +72 -0
- package/typechain-types/factories/BotActionCallbackLib__factory.ts +84 -0
- package/typechain-types/factories/BotDecisionHelperBase__factory.ts +91 -64
- package/typechain-types/factories/ChainlinkRelayerAutomation__factory.ts +238 -0
- package/typechain-types/factories/ChainlinkRelayerGelato__factory.ts +263 -0
- package/typechain-types/factories/ComposableStablePreviewProxy__factory.ts +288 -0
- package/typechain-types/factories/ComposableStablePreviewV4__factory.ts +190 -0
- package/typechain-types/factories/ComposableStablePreviewV5__factory.ts +190 -0
- package/typechain-types/factories/IAutomate__factory.ts +126 -0
- package/typechain-types/factories/IBotDecisionHelper__factory.ts +90 -63
- package/typechain-types/factories/{CamelotV1LpHelper__factory.ts → IFluxErc20__factory.ts} +66 -31
- package/typechain-types/factories/{IExecutorHelper2__factory.ts → IFluxInterestRateModel__factory.ts} +19 -15
- package/typechain-types/factories/ILongYieldDecisionHelper__factory.ts +109 -82
- package/typechain-types/factories/ILongYieldTradingBot__factory.ts +7 -171
- package/typechain-types/factories/IOpsProxyFactory__factory.ts +50 -0
- package/typechain-types/factories/IPComposableStablePreview__factory.ts +152 -0
- package/typechain-types/factories/IPExternalRewardDistributor__factory.ts +32 -32
- package/typechain-types/factories/IPOracleForSy__factory.ts +36 -0
- package/typechain-types/factories/IShortYieldDecisionHelper__factory.ts +90 -63
- package/typechain-types/factories/IShortYieldTradingBot__factory.ts +7 -171
- package/typechain-types/factories/ITaskTreasuryUpgradable__factory.ts +76 -0
- package/typechain-types/factories/ITradingBotBase__factory.ts +7 -171
- package/typechain-types/factories/IVersion__factory.ts +36 -0
- package/typechain-types/factories/LegacyNFTHelper__factory.ts +83 -0
- package/typechain-types/factories/LongYieldActionLib__factory.ts +207 -0
- package/typechain-types/factories/LongYieldDecisionHelper__factory.ts +265 -69
- package/typechain-types/factories/LongYieldTradingBot__factory.ts +967 -271
- package/typechain-types/factories/MarketExtLib__factory.ts +1 -1
- package/typechain-types/factories/PendleAnkrBNBSY__factory.ts +1 -1
- package/typechain-types/factories/PendleArbitrumStakedEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraBalancerStableLPSYV3__factory.ts +1212 -0
- package/typechain-types/factories/PendleAuraWethVethSY__factory.ts +1231 -0
- package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +1 -1
- package/typechain-types/factories/PendleBridgedLSDSY__factory.ts +1064 -0
- package/typechain-types/factories/PendleChainlinkReceiver__factory.ts +216 -0
- package/typechain-types/factories/PendleChainlinkRelayer__factory.ts +180 -0
- package/typechain-types/factories/PendleERC20PermitUpgradable__factory.ts +401 -0
- package/typechain-types/factories/PendleERC20Upgradable__factory.ts +326 -0
- package/typechain-types/factories/PendleERC4626SY__factory.ts +1030 -0
- package/typechain-types/factories/PendleExternalRewardDistributor__factory.ts +91 -68
- package/typechain-types/factories/PendleFluxLendingSY__factory.ts +1038 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleLpGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleMantleStakedEthSY__factory.ts +1068 -0
- package/typechain-types/factories/PendleMarketFactoryV2__factory.ts +15 -15
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketV2__factory.ts +10 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleOracleForSyProxy__factory.ts +211 -0
- package/typechain-types/factories/PendlePtGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePtOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleThenaSY__factory.ts +1 -1
- package/typechain-types/factories/PendleWbEthSY__factory.ts +1 -1
- package/typechain-types/factories/PtAndLpToAsset__factory.ts +1 -1
- package/typechain-types/factories/SDKErrorsDirectory__factory.ts +1596 -0
- package/typechain-types/factories/SYBaseUpgradable__factory.ts +889 -0
- package/typechain-types/factories/SYBaseWithRewardsUpgradable__factory.ts +959 -0
- package/typechain-types/factories/StarNFTV1__factory.ts +584 -0
- package/typechain-types/factories/{PendleSwETH__factory.ts → SwETHSY__factory.ts} +19 -19
- package/typechain-types/factories/ThenaPreview__factory.ts +1 -1
- package/typechain-types/factories/TradingBotBase__factory.ts +1020 -144
- package/typechain-types/factories/TvlLib__factory.ts +309 -0
- package/typechain-types/hardhat.d.ts +56 -56
- package/typechain-types/index.ts +14 -16
- package/build/artifacts/contracts/core/TradingBot/LongYield/LongYieldActionHelper.sol/LongYieldActionHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/LongYield/LongYieldActionHelper.sol/LongYieldActionHelper.json +0 -815
- package/build/artifacts/contracts/core/TradingBot/LongYield/LongYieldDecisionHelper.sol/LongYieldDecisionHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/LongYield/LongYieldDecisionHelper.sol/LongYieldDecisionHelper.json +0 -1215
- package/build/artifacts/contracts/core/TradingBot/LongYield/LongYieldTradingBot.sol/LongYieldTradingBot.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/LongYield/LongYieldTradingBot.sol/LongYieldTradingBot.json +0 -1564
- package/build/artifacts/contracts/core/TradingBot/ShortYield/ShortYieldActionHelper.sol/ShortYieldActionHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/ShortYield/ShortYieldActionHelper.sol/ShortYieldActionHelper.json +0 -765
- package/build/artifacts/contracts/core/TradingBot/ShortYield/ShortYieldDecisionHelper.sol/ShortYieldDecisionHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/ShortYield/ShortYieldDecisionHelper.sol/ShortYieldDecisionHelper.json +0 -1215
- package/build/artifacts/contracts/core/TradingBot/ShortYield/ShortYieldTradingBot.sol/ShortYieldTradingBot.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/ShortYield/ShortYieldTradingBot.sol/ShortYieldTradingBot.json +0 -1368
- package/build/artifacts/contracts/core/TradingBot/base/BotActionCallback.sol/BotActionCallback.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/base/BotActionCallback.sol/BotActionCallback.json +0 -815
- package/build/artifacts/contracts/core/TradingBot/base/BotDecisionHelperBase.sol/BotDecisionHelperBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/base/TradingBotBase.sol/TradingBotBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/TradingBot/base/TradingBotBase.sol/TradingBotBase.json +0 -765
- package/contracts/core/TradingBot/LongYield/LongYieldActionHelper.sol +0 -101
- package/contracts/core/TradingBot/ShortYield/ShortYieldActionHelper.sol +0 -54
- package/contracts/core/TradingBot/ShortYield/ShortYieldDecisionHelper.sol +0 -198
- package/contracts/core/TradingBot/ShortYield/ShortYieldTradingBot.sol +0 -101
- package/contracts/core/TradingBot/base/BotActionCallback.sol +0 -112
- package/contracts/core/TradingBot/base/TradingBotBase.sol +0 -184
- package/typechain-types/BotActionCallback.ts +0 -900
- package/typechain-types/BotActionHelper.ts +0 -950
- package/typechain-types/BotDecisionHelper.ts +0 -561
- package/typechain-types/BotDecisionLib.ts +0 -335
- package/typechain-types/CamelotV1LpHelper.ts +0 -203
- package/typechain-types/IExecutorHelper1.ts +0 -643
- package/typechain-types/IExecutorHelperEthereum1.ts +0 -643
- package/typechain-types/LongYieldActionHelper.ts +0 -900
- package/typechain-types/PendleSwapArbitrum.ts +0 -126
- package/typechain-types/PendleSwapEthereum.ts +0 -126
- package/typechain-types/ShortYieldActionHelper.ts +0 -856
- package/typechain-types/ShortYieldDecisionHelper.ts +0 -601
- package/typechain-types/ShortYieldTradingBot.ts +0 -1212
- package/typechain-types/TradingBotOffchain.ts +0 -568
- package/typechain-types/factories/BotActionCallback__factory.ts +0 -830
- package/typechain-types/factories/BotActionHelper__factory.ts +0 -947
- package/typechain-types/factories/BotDecisionHelper__factory.ts +0 -1192
- package/typechain-types/factories/BotDecisionLib__factory.ts +0 -642
- package/typechain-types/factories/CamelotV1Preview__factory.ts +0 -309
- package/typechain-types/factories/IExecutorHelper1__factory.ts +0 -403
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +0 -407
- package/typechain-types/factories/LongYieldActionHelper__factory.ts +0 -834
- package/typechain-types/factories/PendleBinanceEth__factory.ts +0 -1052
- package/typechain-types/factories/PendleCamelotV1SY__factory.ts +0 -1595
- package/typechain-types/factories/PendleSwapArbitrum__factory.ts +0 -129
- package/typechain-types/factories/PendleSwapEthereum__factory.ts +0 -129
- package/typechain-types/factories/ShortYieldActionHelper__factory.ts +0 -784
- package/typechain-types/factories/ShortYieldDecisionHelper__factory.ts +0 -1272
- package/typechain-types/factories/ShortYieldTradingBot__factory.ts +0 -1445
- package/typechain-types/factories/TradingBotOffchain__factory.ts +0 -1133
|
@@ -4,7 +4,7 @@ pragma solidity ^0.8.0;
|
|
|
4
4
|
import "./../libraries/BotSimulationLib.sol";
|
|
5
5
|
import "../../libraries/Errors.sol";
|
|
6
6
|
import "../libraries/SpecSegmentLib.sol";
|
|
7
|
-
import "
|
|
7
|
+
import "./BotDecisionHelperBase.sol";
|
|
8
8
|
import "../../../interfaces/TradingBot/IBotDecisionHelper.sol";
|
|
9
9
|
import "../../../interfaces/TradingBot/ILongYieldTradingBot.sol";
|
|
10
10
|
|
|
@@ -20,14 +20,47 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
20
20
|
using LogExpMath for uint256;
|
|
21
21
|
using SpecSegmentLib for TradingSpecs;
|
|
22
22
|
|
|
23
|
+
function getRebalanceAction(
|
|
24
|
+
address botAddress
|
|
25
|
+
) public view returns (RebalanceOutput memory output) {
|
|
26
|
+
StrategyData memory strategyData = ITradingBotBase(botAddress).readStrategyData();
|
|
27
|
+
(uint256 tvlInSy, , uint256 syRatio, ) = _calcBotExtStats(
|
|
28
|
+
strategyData.botState,
|
|
29
|
+
strategyData.marketExt
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
uint256 lowerBound = strategyData.specs.targetSyRatio.mulDown(
|
|
33
|
+
Math.ONE - strategyData.specs.bufferSyRatio
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
uint256 upperBound = strategyData.specs.targetSyRatio.mulDown(
|
|
37
|
+
Math.ONE + strategyData.specs.bufferSyRatio
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (syRatio > upperBound) {
|
|
41
|
+
output.rebalanceType = RebalanceType.AddLiqKeepYt;
|
|
42
|
+
(output.amountIn, output.amountOut, output.amountOut2) = _getSyAmountForZPI(
|
|
43
|
+
strategyData.marketExt,
|
|
44
|
+
tvlInSy,
|
|
45
|
+
syRatio,
|
|
46
|
+
strategyData.specs.targetSyRatio
|
|
47
|
+
);
|
|
48
|
+
} else if (syRatio < lowerBound) {
|
|
49
|
+
(output.rebalanceType, output.amountIn, output.amountOut) = _getRemoveRebalance(
|
|
50
|
+
strategyData,
|
|
51
|
+
tvlInSy
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
23
56
|
// We dont care about AddLiqKeepYt here
|
|
24
|
-
function
|
|
57
|
+
function getTradeAction(address botAddress) public view returns (TradeResult memory res) {
|
|
25
58
|
StrategyData memory strategyData = ILongYieldTradingBot(botAddress).readStrategyData();
|
|
26
59
|
uint256 iy = strategyData.marketExt.impliedYield();
|
|
27
60
|
|
|
28
61
|
res.currentBin = _getCurrentBin(strategyData.botState, strategyData.specs, iy);
|
|
29
62
|
if (res.currentBin == 0) {
|
|
30
|
-
res.action =
|
|
63
|
+
res.action = TradeActionType.NONE;
|
|
31
64
|
return res;
|
|
32
65
|
}
|
|
33
66
|
res.targetIy = _getTargetImpliedYieldForBin(
|
|
@@ -40,8 +73,8 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
40
73
|
uint256 rebalanceAdditionalCheck;
|
|
41
74
|
|
|
42
75
|
if (res.currentBin < 0) {
|
|
43
|
-
res.action =
|
|
44
|
-
maxAmountForAction =
|
|
76
|
+
res.action = TradeActionType.RemoveLiqToYt;
|
|
77
|
+
maxAmountForAction = _calcTradeActionMaxAmount(
|
|
45
78
|
strategyData.botState.lpBalance,
|
|
46
79
|
res.currentBin,
|
|
47
80
|
strategyData.botState.buyBins,
|
|
@@ -49,13 +82,14 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
49
82
|
);
|
|
50
83
|
|
|
51
84
|
if (maxAmountForAction == 0) {
|
|
85
|
+
res.action = TradeActionType.NONE;
|
|
52
86
|
return res;
|
|
53
87
|
}
|
|
54
88
|
} else {
|
|
55
|
-
res.action =
|
|
56
|
-
uint256 maxYtToAddLiq =
|
|
89
|
+
res.action = TradeActionType.AddLiqFromYt;
|
|
90
|
+
uint256 maxYtToAddLiq = searchMaxYtToAddLiq(strategyData);
|
|
57
91
|
|
|
58
|
-
rebalanceAdditionalCheck =
|
|
92
|
+
rebalanceAdditionalCheck = _calcTradeActionMaxAmount(
|
|
59
93
|
maxYtToAddLiq,
|
|
60
94
|
res.currentBin,
|
|
61
95
|
strategyData.botState.buyBins,
|
|
@@ -63,6 +97,7 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
63
97
|
);
|
|
64
98
|
|
|
65
99
|
if (rebalanceAdditionalCheck == 0) {
|
|
100
|
+
res.action = TradeActionType.NONE;
|
|
66
101
|
return res;
|
|
67
102
|
}
|
|
68
103
|
}
|
|
@@ -75,7 +110,7 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
75
110
|
_getMockApproxParamsWithGuessMax(maxAmountForAction),
|
|
76
111
|
_getMockApproxParams()
|
|
77
112
|
);
|
|
78
|
-
(res.amountOut, res.guessIntParams) =
|
|
113
|
+
(res.amountOut, res.guessIntParams) = _calcTradeActionAmountOutAndIntParams(
|
|
79
114
|
strategyData.marketExt,
|
|
80
115
|
res.action,
|
|
81
116
|
res.guessBotParams
|
|
@@ -86,12 +121,12 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
86
121
|
* Given the rebalancing action and its `botParam`, binary search for the optimal internal
|
|
87
122
|
* parameter `intParam` for the internal action's approximation (e.g. for router's swap)
|
|
88
123
|
*/
|
|
89
|
-
function
|
|
124
|
+
function _calcTradeActionAmountOutAndIntParams(
|
|
90
125
|
MarketExtState memory marketExt,
|
|
91
|
-
|
|
126
|
+
TradeActionType action,
|
|
92
127
|
uint256 botParam
|
|
93
128
|
) public pure returns (uint256 amountOut, uint256 intParams) {
|
|
94
|
-
if (action ==
|
|
129
|
+
if (action == TradeActionType.RemoveLiqToYt) {
|
|
95
130
|
(amountOut, intParams) = marketExt.clone().removeLiqToYt(
|
|
96
131
|
botParam,
|
|
97
132
|
_getMockApproxParams()
|
|
@@ -101,9 +136,9 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
101
136
|
}
|
|
102
137
|
}
|
|
103
138
|
|
|
104
|
-
function
|
|
139
|
+
function searchMaxYtToAddLiq(
|
|
105
140
|
StrategyData memory strategyData
|
|
106
|
-
)
|
|
141
|
+
) public view returns (uint256 maxYtToAddLiq) {
|
|
107
142
|
(, , , uint256 ytPtRatioAfter) = _calcBotExtStats(
|
|
108
143
|
strategyData.botState,
|
|
109
144
|
strategyData.marketExt
|
|
@@ -113,19 +148,22 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
113
148
|
}
|
|
114
149
|
|
|
115
150
|
ApproxParams memory guessParams = _getMockApproxParamsWithGuessMax(
|
|
116
|
-
|
|
151
|
+
_weakUpperBound(
|
|
152
|
+
strategyData.botState,
|
|
153
|
+
strategyData.marketExt,
|
|
154
|
+
TradeActionType.AddLiqFromYt
|
|
155
|
+
)
|
|
117
156
|
);
|
|
118
157
|
ApproxParams memory mockSwapParams = _getMockApproxParams();
|
|
119
158
|
while (guessParams.guessMax > guessParams.guessMin + 1) {
|
|
120
159
|
uint256 guess = guessParams.guessMin +
|
|
121
160
|
(guessParams.guessMax - guessParams.guessMin) /
|
|
122
161
|
2;
|
|
123
|
-
|
|
124
162
|
(
|
|
125
163
|
bool success,
|
|
126
164
|
BotState memory botStateAfter,
|
|
127
165
|
MarketExtState memory marketExtAfter
|
|
128
|
-
) = previewAction(strategyData,
|
|
166
|
+
) = previewAction(strategyData, TradeActionType.AddLiqFromYt, guess, mockSwapParams);
|
|
129
167
|
|
|
130
168
|
if (!success) {
|
|
131
169
|
guessParams.guessMax = guess - 1;
|
|
@@ -135,26 +173,27 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
135
173
|
(, , , ytPtRatioAfter) = _calcBotExtStats(botStateAfter, marketExtAfter);
|
|
136
174
|
if (ytPtRatioAfter >= strategyData.specs.targetYtPtRatio) {
|
|
137
175
|
guessParams.guessMin = guess;
|
|
176
|
+
maxYtToAddLiq = strategyData.botState.ytBalance - botStateAfter.ytBalance;
|
|
138
177
|
} else {
|
|
139
178
|
guessParams.guessMax = guess - 1;
|
|
140
179
|
}
|
|
141
180
|
}
|
|
142
|
-
return
|
|
181
|
+
return maxYtToAddLiq;
|
|
143
182
|
}
|
|
144
183
|
|
|
145
184
|
/// @dev Does not modify params, structs are cloned before simulation
|
|
146
185
|
function previewAction(
|
|
147
186
|
StrategyData memory strategyData,
|
|
148
|
-
|
|
187
|
+
TradeActionType action,
|
|
149
188
|
uint256 botParam,
|
|
150
189
|
ApproxParams memory intParams
|
|
151
190
|
) public pure returns (bool success, BotState memory bot, MarketExtState memory marketExt) {
|
|
152
191
|
bot = strategyData.botState.clone();
|
|
153
192
|
marketExt = strategyData.marketExt.clone();
|
|
154
193
|
|
|
155
|
-
if (action ==
|
|
194
|
+
if (action == TradeActionType.AddLiqFromYt) {
|
|
156
195
|
success = bot.addLiqFromYt(marketExt, botParam);
|
|
157
|
-
} else if (action ==
|
|
196
|
+
} else if (action == TradeActionType.RemoveLiqToYt) {
|
|
158
197
|
success = bot.removeLiqToYt(marketExt, botParam, intParams);
|
|
159
198
|
} else {
|
|
160
199
|
success = false;
|
|
@@ -165,52 +204,88 @@ contract LongYieldDecisionHelper is BotDecisionHelperBase {
|
|
|
165
204
|
function _weakUpperBound(
|
|
166
205
|
BotState memory bot,
|
|
167
206
|
MarketExtState memory marketExt,
|
|
168
|
-
|
|
207
|
+
TradeActionType action
|
|
169
208
|
) internal pure override returns (uint256) {
|
|
170
|
-
if (action ==
|
|
209
|
+
if (action == TradeActionType.AddLiqFromYt) {
|
|
171
210
|
return marketExt.calcMaxPtOut();
|
|
172
211
|
} else {
|
|
173
212
|
return bot.lpBalance;
|
|
174
213
|
}
|
|
175
214
|
}
|
|
176
215
|
|
|
177
|
-
function
|
|
178
|
-
|
|
216
|
+
function _getTradeActionResult(
|
|
217
|
+
TradeParams memory params,
|
|
179
218
|
uint256 botParam,
|
|
180
219
|
uint256 rebalanceAdditionalCheck,
|
|
181
220
|
uint256 eps,
|
|
182
221
|
ApproxParams memory intParams
|
|
183
|
-
) internal pure override returns (
|
|
222
|
+
) internal pure override returns (TradeActionResult) {
|
|
184
223
|
(
|
|
185
224
|
bool success,
|
|
186
225
|
BotState memory newBotState,
|
|
187
226
|
MarketExtState memory marketExt
|
|
188
|
-
) = previewAction(
|
|
227
|
+
) = previewAction(params.strategyData, params.action, botParam, intParams);
|
|
189
228
|
|
|
190
|
-
if (!success) return
|
|
191
|
-
// return RebalanceResult.SUCCESS;
|
|
229
|
+
if (!success) return TradeActionResult.FAIL_OR_TARGET_EXCEED;
|
|
192
230
|
|
|
193
231
|
uint256 iy = marketExt.impliedYield();
|
|
194
|
-
if (
|
|
195
|
-
uint256 netYtSwapped =
|
|
196
|
-
newBotState.ytBalance;
|
|
232
|
+
if (params.action == TradeActionType.AddLiqFromYt) {
|
|
233
|
+
uint256 netYtSwapped = params.strategyData.botState.ytBalance - newBotState.ytBalance;
|
|
197
234
|
|
|
198
235
|
if (netYtSwapped > rebalanceAdditionalCheck) {
|
|
199
|
-
return
|
|
236
|
+
return TradeActionResult.FAIL_OR_TARGET_EXCEED;
|
|
200
237
|
}
|
|
201
|
-
if (Math.isAGreaterApproxB(iy,
|
|
202
|
-
return
|
|
238
|
+
if (Math.isAGreaterApproxB(iy, params.targetIy, eps)) {
|
|
239
|
+
return TradeActionResult.SUCCESS;
|
|
203
240
|
} else {
|
|
204
|
-
if (iy <
|
|
205
|
-
else return
|
|
241
|
+
if (iy < params.targetIy) return TradeActionResult.FAIL_OR_TARGET_EXCEED;
|
|
242
|
+
else return TradeActionResult.TARGET_NOT_REACHED;
|
|
206
243
|
}
|
|
207
244
|
} else {
|
|
208
|
-
if (Math.isASmallerApproxB(iy,
|
|
209
|
-
return
|
|
245
|
+
if (Math.isASmallerApproxB(iy, params.targetIy, eps)) {
|
|
246
|
+
return TradeActionResult.SUCCESS;
|
|
210
247
|
} else {
|
|
211
|
-
if (iy >
|
|
212
|
-
else return
|
|
248
|
+
if (iy > params.targetIy) return TradeActionResult.FAIL_OR_TARGET_EXCEED;
|
|
249
|
+
else return TradeActionResult.TARGET_NOT_REACHED;
|
|
213
250
|
}
|
|
214
251
|
}
|
|
215
252
|
}
|
|
253
|
+
|
|
254
|
+
function _getRemoveRebalance(
|
|
255
|
+
StrategyData memory strategyData,
|
|
256
|
+
uint256 tvl
|
|
257
|
+
) internal pure returns (RebalanceType rebalanceType, uint256 amountIn, uint256 amountOut) {
|
|
258
|
+
uint256 totalSyRequired = tvl.mulDown(strategyData.specs.targetSyRatio) -
|
|
259
|
+
strategyData.botState.syBalance;
|
|
260
|
+
|
|
261
|
+
if (strategyData.botState.lpBalance > 0) {
|
|
262
|
+
(int256 syFromLp, int256 ptFromLp) = strategyData
|
|
263
|
+
.marketExt
|
|
264
|
+
.clone()
|
|
265
|
+
.state
|
|
266
|
+
.removeLiquidityCore(strategyData.botState.lpBalance.Int());
|
|
267
|
+
|
|
268
|
+
uint256 availablePYToRedeem = Math.min(
|
|
269
|
+
strategyData.botState.ytBalance,
|
|
270
|
+
ptFromLp.Uint()
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
// PT should be zpi redeemed together with YT
|
|
274
|
+
uint256 totalSyZpi = syFromLp.Uint() +
|
|
275
|
+
strategyData.marketExt.index.assetToSyUp(availablePYToRedeem);
|
|
276
|
+
|
|
277
|
+
rebalanceType = RebalanceType.RemoveLpAndYt;
|
|
278
|
+
amountOut = Math.min(totalSyZpi, totalSyRequired);
|
|
279
|
+
amountIn = (strategyData.botState.lpBalance * amountOut) / totalSyZpi;
|
|
280
|
+
} else {
|
|
281
|
+
// Position now should only consist of SY & YT
|
|
282
|
+
uint256 syFromYT = strategyData.marketExt.clone().swapYtToSy(
|
|
283
|
+
strategyData.botState.ytBalance
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
rebalanceType = RebalanceType.SellYt;
|
|
287
|
+
amountIn = (totalSyRequired * strategyData.botState.ytBalance) / syFromYT;
|
|
288
|
+
amountOut = strategyData.marketExt.clone().swapYtToSy(amountIn);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
216
291
|
}
|
package/contracts/core/TradingBot/{LongYield/LongYieldTradingBot.sol → LongYieldTradingBot.sol}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "./
|
|
6
|
-
import "
|
|
4
|
+
import "./TradingBotBase.sol";
|
|
5
|
+
import "./libraries/LongYieldActionLib.sol";
|
|
6
|
+
import "../../interfaces/TradingBot/ILongYieldTradingBot.sol";
|
|
7
|
+
import "../../interfaces/IPMarketSwapCallback.sol";
|
|
7
8
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
8
9
|
|
|
9
10
|
contract LongYieldTradingBot is
|
|
10
11
|
TradingBotBase,
|
|
11
|
-
|
|
12
|
+
UUPSUpgradeable,
|
|
12
13
|
ILongYieldTradingBot,
|
|
13
|
-
|
|
14
|
+
IPMarketSwapCallback
|
|
14
15
|
{
|
|
15
16
|
using MarketExtLib for MarketExtState;
|
|
16
17
|
using Math for uint256;
|
|
@@ -30,12 +31,32 @@ contract LongYieldTradingBot is
|
|
|
30
31
|
__BoringOwnable_init();
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
function removeLiquidityToSy(
|
|
35
|
+
uint256 netLpToRemove,
|
|
36
|
+
uint256 minSyOut
|
|
37
|
+
) external onlyOwner returns (uint256 netSyOut) {
|
|
38
|
+
return LongYieldActionLib.removeLiquidityToSy(market, netLpToRemove, minSyOut);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
function swapYtToSy(
|
|
43
|
+
uint256 netYtToSell,
|
|
44
|
+
uint256 minSyOut
|
|
45
|
+
) external onlyOwner returns (uint256 netSyOut) {
|
|
46
|
+
return LongYieldActionLib.swapYtToSy(market, netYtToSell, minSyOut);
|
|
47
|
+
}
|
|
48
|
+
|
|
33
49
|
function addLiqKeepYt(
|
|
34
50
|
uint256 netSyIn,
|
|
35
51
|
uint256 minLpOut,
|
|
36
52
|
uint256 minYtOut
|
|
37
53
|
) external onlyOwner returns (uint256 netLpOut, uint256 netYtOut) {
|
|
38
|
-
(netLpOut, netYtOut) =
|
|
54
|
+
(netLpOut, netYtOut) = LongYieldActionLib.addLiqKeepYt(
|
|
55
|
+
market,
|
|
56
|
+
netSyIn,
|
|
57
|
+
minLpOut,
|
|
58
|
+
minYtOut
|
|
59
|
+
);
|
|
39
60
|
emit AddLiqKeepYt(netSyIn, netLpOut, netYtOut);
|
|
40
61
|
}
|
|
41
62
|
|
|
@@ -51,13 +72,17 @@ contract LongYieldTradingBot is
|
|
|
51
72
|
);
|
|
52
73
|
netPtFromSwap = decisionHelper.searchForBotParam(
|
|
53
74
|
readStrategyData(),
|
|
54
|
-
|
|
75
|
+
TradeActionType.AddLiqFromYt,
|
|
55
76
|
inputParams.targetIy,
|
|
56
77
|
type(uint256).max,
|
|
57
78
|
inputParams.botParams,
|
|
58
79
|
inputParams.botParams // only placeholder, value doesn't matter
|
|
59
80
|
);
|
|
60
|
-
(netLpOut, netYtIn) =
|
|
81
|
+
(netLpOut, netYtIn) = LongYieldActionLib.addLiqFromYt(
|
|
82
|
+
market,
|
|
83
|
+
netPtFromSwap,
|
|
84
|
+
inputParams.minLpOut
|
|
85
|
+
);
|
|
61
86
|
|
|
62
87
|
_updateSellBinAfterTrade();
|
|
63
88
|
|
|
@@ -77,14 +102,15 @@ contract LongYieldTradingBot is
|
|
|
77
102
|
|
|
78
103
|
netLpRemoved = decisionHelper.searchForBotParam(
|
|
79
104
|
strategyData,
|
|
80
|
-
|
|
105
|
+
TradeActionType.RemoveLiqToYt,
|
|
81
106
|
inputParams.targetIy,
|
|
82
107
|
type(uint256).max,
|
|
83
108
|
inputParams.botParams,
|
|
84
109
|
inputParams.guessTotalPtToSwap // value DOES matter
|
|
85
110
|
);
|
|
86
111
|
|
|
87
|
-
(netYtOut, ) =
|
|
112
|
+
(netYtOut, ) = LongYieldActionLib.removeLiqToYt(
|
|
113
|
+
market,
|
|
88
114
|
netLpRemoved,
|
|
89
115
|
inputParams.guessTotalPtToSwap,
|
|
90
116
|
inputParams.minYtOut
|
|
@@ -94,4 +120,9 @@ contract LongYieldTradingBot is
|
|
|
94
120
|
|
|
95
121
|
emit RemoveLiqToYt(inputParams.botParams, netLpRemoved, netYtOut);
|
|
96
122
|
}
|
|
123
|
+
|
|
124
|
+
function swapCallback(int256 ptToAccount, int256 syToAccount, bytes calldata data) external {
|
|
125
|
+
require(msg.sender == market, "not market");
|
|
126
|
+
LongYieldActionLib.swapCallback(market, ptToAccount, syToAccount, data);
|
|
127
|
+
}
|
|
97
128
|
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../libraries/BoringOwnableUpgradeable.sol";
|
|
5
|
+
import "../libraries/TokenHelper.sol";
|
|
6
|
+
import "../../interfaces/TradingBot/ITradingBotBase.sol";
|
|
7
|
+
import "../../interfaces/TradingBot/IBotDecisionHelper.sol";
|
|
8
|
+
import "../StandardizedYield/SYBaseWithRewards.sol";
|
|
9
|
+
import "./libraries/TvlLib.sol";
|
|
10
|
+
|
|
11
|
+
contract TradingBotBase is SYBaseWithRewards, ITradingBotBase {
|
|
12
|
+
using TokenAmountLib for TokenAmount[];
|
|
13
|
+
using PYIndexLib for IPYieldToken;
|
|
14
|
+
using MarketExtLib for MarketExtState;
|
|
15
|
+
using Math for uint256;
|
|
16
|
+
using Math for int256;
|
|
17
|
+
|
|
18
|
+
IBotDecisionHelper public immutable decisionHelper;
|
|
19
|
+
address public immutable market;
|
|
20
|
+
address public immutable router;
|
|
21
|
+
address public immutable SY;
|
|
22
|
+
address public immutable PT;
|
|
23
|
+
address public immutable YT;
|
|
24
|
+
address public immutable PENDLE;
|
|
25
|
+
|
|
26
|
+
TradingSpecs public specs;
|
|
27
|
+
uint256 public buyBins;
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
address _market,
|
|
31
|
+
address _router,
|
|
32
|
+
address _PENDLE,
|
|
33
|
+
address _decisionHelper
|
|
34
|
+
) SYBaseWithRewards("Fortknox Vault", "Fortknox Vault", _getSYAddress(_market)) {
|
|
35
|
+
(IStandardizedYield _SY, IPPrincipalToken _PT, IPYieldToken _YT) = IPMarket(_market)
|
|
36
|
+
.readTokens();
|
|
37
|
+
|
|
38
|
+
market = _market;
|
|
39
|
+
router = _router;
|
|
40
|
+
SY = address(_SY);
|
|
41
|
+
PT = address(_PT);
|
|
42
|
+
YT = address(_YT);
|
|
43
|
+
PENDLE = _PENDLE;
|
|
44
|
+
decisionHelper = IBotDecisionHelper(_decisionHelper);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function _getSYAddress(address _market) internal view returns (address) {
|
|
48
|
+
(IStandardizedYield _SY, , ) = IPMarket(_market).readTokens();
|
|
49
|
+
return address(_SY);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function approveInf(address token, address to) external onlyOwner {
|
|
53
|
+
_safeApproveInf(token, to);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function compound(
|
|
57
|
+
TokenInput calldata inp,
|
|
58
|
+
uint256 minSyOut
|
|
59
|
+
) external onlyOwner returns (uint256 netSyOut) {
|
|
60
|
+
netSyOut = _compoundSingle(inp, minSyOut);
|
|
61
|
+
_transferOut(PENDLE, owner, _selfBalance(PENDLE));
|
|
62
|
+
emit ClaimAndCompound(netSyOut);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function _readMarketExtState() internal view returns (MarketExtState memory marketExt) {
|
|
66
|
+
marketExt.state = IPMarket(market).readState(router);
|
|
67
|
+
marketExt.index = IPYieldToken(YT).newIndexView();
|
|
68
|
+
marketExt.blockTime = block.timestamp;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function _readBotState() internal view returns (BotState memory botState) {
|
|
72
|
+
botState.lpBalance = _selfBalance(market);
|
|
73
|
+
botState.syBalance = _selfBalance(SY);
|
|
74
|
+
botState.ytBalance = _selfBalance(YT);
|
|
75
|
+
botState.ptBalance = _selfBalance(PT);
|
|
76
|
+
botState.buyBins = buyBins;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function _setBuyBins(uint256 _buyBins) internal {
|
|
80
|
+
buyBins = _buyBins;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function _compoundSingle(
|
|
84
|
+
TokenInput memory inp,
|
|
85
|
+
uint256 minSyOut
|
|
86
|
+
) internal returns (uint256 /*netSyOut*/) {
|
|
87
|
+
if (inp.netTokenIn == type(uint256).max) inp.netTokenIn = _selfBalance(inp.tokenIn);
|
|
88
|
+
|
|
89
|
+
return
|
|
90
|
+
IPAllAction(router).mintSyFromToken{
|
|
91
|
+
value: inp.tokenIn == NATIVE ? inp.netTokenIn : 0
|
|
92
|
+
}(address(this), SY, minSyOut, inp);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function setSpecs(TradingSpecs calldata _specs) external onlyOwner {
|
|
96
|
+
_setSpecs(_specs);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function _setSpecs(TradingSpecs memory _specs) internal {
|
|
100
|
+
specs = _specs;
|
|
101
|
+
_setBuyBins(specs.numOfBins);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function readStrategyData() public view returns (StrategyData memory strategyData) {
|
|
105
|
+
strategyData.botState = _readBotState();
|
|
106
|
+
strategyData.marketExt = _readMarketExtState();
|
|
107
|
+
strategyData.specs = specs;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _updateSellBinAfterTrade() internal {
|
|
111
|
+
int256 binShift = IBotDecisionHelper(decisionHelper).getCurrentBin(readStrategyData());
|
|
112
|
+
_setBuyBins((buyBins.Int() + binShift).Uint());
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function getTvl(bool isLiquidateTvl) external view returns (uint256) {
|
|
116
|
+
if (isLiquidateTvl) {
|
|
117
|
+
return TvlLib.getLiquidateTvl(_readBotState(), _readMarketExtState());
|
|
118
|
+
} else {
|
|
119
|
+
return TvlLib.getOracleTvl(market, _readBotState());
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function getMaxAmountSharesToRedeem() external view returns (uint256) {
|
|
124
|
+
uint256 liquidateTvl = TvlLib.getLiquidateTvl(_readBotState(), _readMarketExtState());
|
|
125
|
+
return (_selfBalance(SY) * totalSupply()) / liquidateTvl;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/*///////////////////////////////////////////////////////////////
|
|
129
|
+
EIP-5115
|
|
130
|
+
//////////////////////////////////////////////////////////////*/
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The underlying yield token is startgateLP. If the base token deposited is underlying, the function
|
|
134
|
+
* deposits received underlying into the startgateLP contract.
|
|
135
|
+
*/
|
|
136
|
+
function _deposit(
|
|
137
|
+
address,
|
|
138
|
+
uint256 amountDeposited
|
|
139
|
+
) internal virtual override returns (uint256 amountSharesOut) {
|
|
140
|
+
BotState memory botState = _readBotState();
|
|
141
|
+
MarketExtState memory marketExt = _readMarketExtState();
|
|
142
|
+
|
|
143
|
+
uint256 supply = totalSupply();
|
|
144
|
+
if (supply == 0) return amountDeposited;
|
|
145
|
+
|
|
146
|
+
uint256 tvl = Math.max(
|
|
147
|
+
TvlLib.getOracleTvl(market, botState),
|
|
148
|
+
TvlLib.getLiquidateTvl(botState, marketExt)
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
return (amountDeposited * totalSupply()) / (tvl - amountDeposited);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function _redeem(
|
|
155
|
+
address receiver,
|
|
156
|
+
address,
|
|
157
|
+
uint256 amountSharesToRedeem
|
|
158
|
+
) internal virtual override returns (uint256 amountTokenOut) {
|
|
159
|
+
uint256 tvlLiquidate = TvlLib.getLiquidateTvl(_readBotState(), _readMarketExtState());
|
|
160
|
+
amountTokenOut =
|
|
161
|
+
(tvlLiquidate * amountSharesToRedeem) /
|
|
162
|
+
(totalSupply() + amountSharesToRedeem);
|
|
163
|
+
_transferOut(SY, receiver, amountTokenOut);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function _previewDeposit(
|
|
167
|
+
address,
|
|
168
|
+
uint256 amountTokenToDeposit
|
|
169
|
+
) internal view override returns (uint256 amountSharesOut) {
|
|
170
|
+
uint256 supply = totalSupply();
|
|
171
|
+
if (supply == 0) return amountTokenToDeposit;
|
|
172
|
+
|
|
173
|
+
BotState memory botState = _readBotState();
|
|
174
|
+
MarketExtState memory marketExt = _readMarketExtState();
|
|
175
|
+
|
|
176
|
+
uint256 tvl = Math.max(
|
|
177
|
+
TvlLib.getOracleTvl(market, botState),
|
|
178
|
+
TvlLib.getLiquidateTvl(botState, marketExt)
|
|
179
|
+
);
|
|
180
|
+
return (amountTokenToDeposit * supply) / tvl;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function _previewRedeem(
|
|
184
|
+
address,
|
|
185
|
+
uint256 amountSharesToRedeem
|
|
186
|
+
) internal view override returns (uint256 amountTokenOut) {
|
|
187
|
+
uint256 tvlLiquidate = TvlLib.getLiquidateTvl(_readBotState(), _readMarketExtState());
|
|
188
|
+
return (tvlLiquidate * amountSharesToRedeem) / totalSupply();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
192
|
+
return TvlLib.getOracleTvl(market, _readBotState()).divDown(totalSupply());
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function _redeemExternalReward() internal override {
|
|
196
|
+
IPYieldToken(YT).redeemDueInterestAndRewards(address(this), true, true);
|
|
197
|
+
IPMarket(market).redeemRewards(address(this));
|
|
198
|
+
IStandardizedYield(SY).claimRewards(address(this));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function _getRewardTokens() internal view virtual override returns (address[] memory res) {
|
|
202
|
+
res = new address[](1);
|
|
203
|
+
res[0] = PENDLE;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
207
|
+
res = new address[](1);
|
|
208
|
+
res[0] = SY;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
212
|
+
res = new address[](1);
|
|
213
|
+
res[0] = SY;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
217
|
+
return token == SY;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
221
|
+
return token == SY;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function assetInfo()
|
|
225
|
+
external
|
|
226
|
+
view
|
|
227
|
+
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
228
|
+
{
|
|
229
|
+
return (AssetType.TOKEN, SY, IERC20Metadata(SY).decimals());
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* ERC20 overrides
|
|
234
|
+
*/
|
|
235
|
+
function name()
|
|
236
|
+
public
|
|
237
|
+
view
|
|
238
|
+
virtual
|
|
239
|
+
override(PendleERC20, IERC20Metadata)
|
|
240
|
+
returns (string memory)
|
|
241
|
+
{
|
|
242
|
+
return "Fortknox Vault";
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function symbol()
|
|
246
|
+
public
|
|
247
|
+
view
|
|
248
|
+
virtual
|
|
249
|
+
override(PendleERC20, IERC20Metadata)
|
|
250
|
+
returns (string memory)
|
|
251
|
+
{
|
|
252
|
+
return "Fortknox Vault";
|
|
253
|
+
}
|
|
254
|
+
}
|