@pendle/core-v2 2.21.1 → 2.22.1
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/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- 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/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- 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/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- 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/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
- 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/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.json +19 -0
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +21 -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/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.json +1027 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.json +1171 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.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/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.json +2 -2
- 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/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
- 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/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +2 -2
- 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/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +2 -2
- 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/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.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/GLP/PendleGlpSY.sol/PendleGlpSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.json +979 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.json +961 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.json +1266 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol/ThenaLpHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol/ThenaLpHelper.json +128 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol/ThenaMath.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol/ThenaMath.json +24 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/IThenaSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/IThenaSY.json +24 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/ThenaPreview.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/ThenaPreview.json +267 -0
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.json +2 -2
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.json +2 -2
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrBNB.sol/IAnkrBNB.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrBNB.sol/IAnkrBNB.json +62 -0
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol/IAnkrLiquidStaking.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol/IAnkrLiquidStaking.json +108 -0
- package/build/artifacts/contracts/interfaces/BinanceEth/IWBETH.sol/IWBETH.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/BinanceEth/IWBETH.sol/IWBETH.json +42 -0
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.json +13 -0
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.json +13 -0
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.json +26 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.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/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.json +19 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +19 -0
- 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/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPendlePreviewHelper.sol/IPendlePreviewHelper.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPendlePreviewHelper.sol/IPendlePreviewHelper.json +59 -0
- package/build/artifacts/contracts/interfaces/ISwETH.sol/ISwETH.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ISwETH.sol/ISwETH.json +44 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaFactory.sol/IThenaFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaFactory.sol/IThenaFactory.json +152 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaGaugeV2.sol/IThenaGaugeV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaGaugeV2.sol/IThenaGaugeV2.json +71 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaPair.sol/IThenaPair.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaPair.sol/IThenaPair.json +409 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaRouter.sol/IThenaRouter.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Thena/IThenaRouter.sol/IThenaRouter.json +188 -0
- 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/Broadcaster.sol/Broadcaster.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
- 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/PtAndLpToAsset.sol/PtAndLpToAsset.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.json +2 -2
- 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/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.json +2 -2
- 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/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/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/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.json +160 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +18 -2
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.json +76 -118
- 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/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.json +2 -2
- package/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol +163 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol +153 -0
- package/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol +102 -0
- package/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol +202 -0
- package/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol +156 -0
- package/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol +128 -0
- package/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol +193 -0
- package/contracts/core/libraries/math/Math.sol +4 -0
- package/contracts/interfaces/Ankr/IAnkrBNB.sol +11 -0
- package/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol +21 -0
- package/contracts/interfaces/Camelot/ICamelotNFTPool.sol +2 -0
- package/contracts/interfaces/Camelot/ICamelotNitroPool.sol +3 -0
- package/contracts/interfaces/Camelot/ICamelotPair.sol +4 -0
- package/contracts/interfaces/IPendlePreviewHelper.sol +14 -0
- package/contracts/interfaces/ISwETH.sol +10 -0
- package/contracts/interfaces/Thena/IThenaFactory.sol +23 -0
- package/contracts/interfaces/Thena/IThenaGaugeV2.sol +18 -0
- package/contracts/interfaces/Thena/IThenaPair.sol +30 -0
- package/contracts/interfaces/Thena/IThenaRouter.sol +38 -0
- package/contracts/oracles/PendleLpOracleLib.sol +21 -40
- package/contracts/oracles/PendlePtOracleLib.sol +33 -28
- package/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol +45 -0
- package/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol +67 -0
- package/contracts/router/swap-aggregator/PendleSwap.sol +3 -2
- package/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol +110 -118
- package/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol +22 -21
- package/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol +22 -2
- package/deployments/1-core.json +4 -3
- package/deployments/1-markets/BALANCER-LP-AURA-WSTETH-ANKRETH-JUNE-27-2024.json +10 -0
- package/deployments/1-markets/SWETH-DEC2024.json +12 -0
- package/deployments/42161-core.json +4 -3
- package/deployments/42161-markets/WSTETH-ARBITRUM-DEC2023.json +10 -0
- package/deployments/56-core.json +3 -3
- package/deployments/56-markets/ANKRBNB-26JUN2025.json +10 -0
- package/package.json +1 -1
- package/typechain-types/IAnkrBNB.ts +150 -0
- package/typechain-types/IAnkrLiquidStaking.ts +253 -0
- package/typechain-types/ICamelotNFTPool.ts +19 -0
- package/typechain-types/ICamelotNitroPool.ts +19 -0
- package/typechain-types/ICamelotPair.ts +42 -0
- package/typechain-types/IExecutorHelper.ts +310 -331
- package/typechain-types/IPGauge.ts +23 -3
- package/typechain-types/IPMarket.ts +18 -0
- package/typechain-types/IPendlePreviewHelper.ts +147 -0
- package/typechain-types/ISwETH.ts +123 -0
- package/typechain-types/IThenaFactory.ts +245 -0
- package/typechain-types/IThenaGaugeV2.ts +206 -0
- package/typechain-types/IThenaPair.ts +579 -0
- package/typechain-types/IThenaRouter.ts +313 -0
- package/typechain-types/IThenaSY.ts +81 -0
- package/typechain-types/IWBETH.ts +128 -0
- package/typechain-types/PendleAnkrBNBSY.ts +1235 -0
- package/typechain-types/PendleAuraWstethAnkreth.ts +1511 -0
- package/typechain-types/PendleGauge.ts +23 -3
- package/typechain-types/PendleMarket.ts +18 -0
- package/typechain-types/PendleThenaSY.ts +1598 -0
- package/typechain-types/PendleWbEthSY.ts +1229 -0
- package/typechain-types/SwETHSY.ts +1216 -0
- package/typechain-types/ThenaLpHelper.ts +191 -0
- package/typechain-types/ThenaMath.ts +87 -0
- package/typechain-types/ThenaPreview.ts +450 -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/Broadcaster__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -1
- package/typechain-types/factories/CamelotRewardHelper__factory.ts +1 -1
- package/typechain-types/factories/CamelotV1VolatilePreview__factory.ts +1 -1
- package/typechain-types/factories/IAnkrBNB__factory.ts +74 -0
- package/typechain-types/factories/IAnkrLiquidStaking__factory.ts +123 -0
- package/typechain-types/factories/ICamelotNFTPool__factory.ts +13 -0
- package/typechain-types/factories/ICamelotNitroPool__factory.ts +13 -0
- package/typechain-types/factories/ICamelotPair__factory.ts +26 -0
- package/typechain-types/factories/IExecutorHelper__factory.ts +74 -116
- package/typechain-types/factories/IPGauge__factory.ts +19 -0
- package/typechain-types/factories/IPMarket__factory.ts +19 -0
- package/typechain-types/factories/IPendlePreviewHelper__factory.ts +78 -0
- package/typechain-types/factories/ISwETH__factory.ts +53 -0
- package/typechain-types/factories/IThenaFactory__factory.ts +164 -0
- package/typechain-types/factories/IThenaGaugeV2__factory.ts +83 -0
- package/typechain-types/factories/IThenaPair__factory.ts +421 -0
- package/typechain-types/factories/IThenaRouter__factory.ts +200 -0
- package/typechain-types/factories/IThenaSY__factory.ts +36 -0
- package/typechain-types/factories/IWBETH__factory.ts +51 -0
- package/typechain-types/factories/PendleAnkrBNBSY__factory.ts +1100 -0
- package/typechain-types/factories/PendleArbitrumStakedEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraBbAWethSwethSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethAnkrethSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethRocketEthSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethStafiEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethWstethSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +1244 -0
- package/typechain-types/factories/PendleCamelotV1VolatileSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGDaiSY__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGauge__factory.ts +19 -0
- package/typechain-types/factories/PendleGlpSY__factory.ts +1 -1
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleLpGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +20 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePtGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePtOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePtUsdChainlinkOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__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/PendleSfrxEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleStargateLPSY__factory.ts +1 -1
- package/typechain-types/factories/PendleSwap__factory.ts +17 -1
- package/typechain-types/factories/PendleThenaSY__factory.ts +1352 -0
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWbEthSY__factory.ts +1049 -0
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/PtAndLpToAsset__factory.ts +1 -1
- package/typechain-types/factories/SAPE__factory.ts +1 -1
- package/typechain-types/factories/SwETHSY__factory.ts +1022 -0
- package/typechain-types/factories/ThenaLpHelper__factory.ts +140 -0
- package/typechain-types/factories/ThenaMath__factory.ts +36 -0
- package/typechain-types/factories/ThenaPreview__factory.ts +319 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +162 -99
- package/typechain-types/index.ts +38 -12
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IHashflow.sol/IHashflow.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IHashflow.sol/IHashflow.json +0 -101
- package/contracts/router/swap-aggregator/kyberswap/IHashflow.sol +0 -30
- /package/deployments/1-markets/{APE-JUNE-29.json → deprecated/APE-JUNE-29.json} +0 -0
- /package/deployments/1-markets/{STETH-JUNE29.json → deprecated/STETH-JUNE29.json} +0 -0
package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "./base/PendleAuraBalancerStableLPSYV2.sol";
|
|
5
|
+
import "./base/ComposableStable/ComposableStablePreview.sol";
|
|
6
|
+
import "../../StEthHelper.sol";
|
|
7
|
+
|
|
8
|
+
contract PendleAuraWstethAnkreth is PendleAuraBalancerStableLPSYV2, StEthHelper {
|
|
9
|
+
uint256 internal constant AURA_PID = 125;
|
|
10
|
+
address internal constant LP = 0xdfE6e7e18f6Cc65FA13C8D8966013d4FdA74b6ba;
|
|
11
|
+
address internal constant ANKRETH = 0xE95A203B1a91a908F9B9CE46459d101078c2c3cb;
|
|
12
|
+
|
|
13
|
+
bool internal constant NO_TOKENS_EXEMPT = true;
|
|
14
|
+
bool internal constant ALL_TOKENS_EXEMPT = false;
|
|
15
|
+
|
|
16
|
+
constructor(
|
|
17
|
+
string memory _name,
|
|
18
|
+
string memory _symbol,
|
|
19
|
+
ComposableStablePreview _composablePreviewHelper
|
|
20
|
+
)
|
|
21
|
+
PendleAuraBalancerStableLPSYV2(_name, _symbol, LP, AURA_PID, _composablePreviewHelper)
|
|
22
|
+
//solhint-disable-next-line
|
|
23
|
+
{
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function _deposit(address tokenIn, uint256 amount)
|
|
28
|
+
internal
|
|
29
|
+
override
|
|
30
|
+
returns (uint256 amountSharesOut)
|
|
31
|
+
{
|
|
32
|
+
if (tokenIn == NATIVE || tokenIn == STETH) {
|
|
33
|
+
uint256 amountWstETH = _depositWstETH(tokenIn, amount);
|
|
34
|
+
amountSharesOut = super._deposit(WSTETH, amountWstETH);
|
|
35
|
+
} else {
|
|
36
|
+
amountSharesOut = super._deposit(tokenIn, amount);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _redeem(
|
|
41
|
+
address receiver,
|
|
42
|
+
address tokenOut,
|
|
43
|
+
uint256 amountSharesToRedeem
|
|
44
|
+
) internal override returns (uint256 amountTokenOut) {
|
|
45
|
+
if (tokenOut == STETH) {
|
|
46
|
+
uint256 amountWstETH = super._redeem(address(this), WSTETH, amountSharesToRedeem);
|
|
47
|
+
amountTokenOut = _redeemWstETH(receiver, amountWstETH);
|
|
48
|
+
} else {
|
|
49
|
+
amountTokenOut = super._redeem(receiver, tokenOut, amountSharesToRedeem);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
|
|
54
|
+
internal
|
|
55
|
+
view
|
|
56
|
+
override
|
|
57
|
+
returns (uint256)
|
|
58
|
+
{
|
|
59
|
+
if (tokenIn == NATIVE || tokenIn == STETH) {
|
|
60
|
+
uint256 amountWstETH = _previewDepositWstETH(tokenIn, amountTokenToDeposit);
|
|
61
|
+
return super._previewDeposit(WSTETH, amountWstETH);
|
|
62
|
+
} else {
|
|
63
|
+
return super._previewDeposit(tokenIn, amountTokenToDeposit);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
|
|
68
|
+
internal
|
|
69
|
+
view
|
|
70
|
+
override
|
|
71
|
+
returns (uint256)
|
|
72
|
+
{
|
|
73
|
+
if (tokenOut == STETH) {
|
|
74
|
+
uint256 amountWstETH = super._previewRedeem(WSTETH, amountSharesToRedeem);
|
|
75
|
+
return _previewRedeemWstETH(amountWstETH);
|
|
76
|
+
} else {
|
|
77
|
+
return super._previewRedeem(tokenOut, amountSharesToRedeem);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function _getImmutablePoolData() internal pure override returns (bytes memory ret) {
|
|
82
|
+
ComposableStablePreview.ImmutableData memory res;
|
|
83
|
+
res.poolTokens = _getPoolTokenAddresses();
|
|
84
|
+
res.rateProviders = _getRateProviders();
|
|
85
|
+
res.rawScalingFactors = _getRawScalingFactors();
|
|
86
|
+
res.isExemptFromYieldProtocolFee = _getExemption();
|
|
87
|
+
res.LP = LP;
|
|
88
|
+
res.noTokensExempt = NO_TOKENS_EXEMPT;
|
|
89
|
+
res.allTokensExempt = ALL_TOKENS_EXEMPT;
|
|
90
|
+
res.bptIndex = _getBPTIndex();
|
|
91
|
+
res.totalTokens = res.poolTokens.length;
|
|
92
|
+
|
|
93
|
+
return abi.encode(res);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// --------------------------------- POOL CONSTANTS ---------------------------------
|
|
97
|
+
function _getPoolTokenAddresses() internal pure override returns (address[] memory res) {
|
|
98
|
+
res = new address[](3);
|
|
99
|
+
res[0] = WSTETH;
|
|
100
|
+
res[1] = LP;
|
|
101
|
+
res[2] = ANKRETH;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _getBPTIndex() internal pure override returns (uint256) {
|
|
105
|
+
return 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function _getRateProviders() internal pure returns (address[] memory res) {
|
|
109
|
+
res = new address[](3);
|
|
110
|
+
res[0] = 0x72D07D7DcA67b8A406aD1Ec34ce969c90bFEE768;
|
|
111
|
+
res[1] = 0x0000000000000000000000000000000000000000;
|
|
112
|
+
res[2] = 0x00F8e64a8651E3479A0B20F46b1D462Fe29D6aBc;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function _getRawScalingFactors() internal pure returns (uint256[] memory res) {
|
|
116
|
+
res = new uint256[](3);
|
|
117
|
+
res[0] = res[1] = res[2] = 1e18;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function _getExemption() internal pure returns (bool[] memory res) {
|
|
121
|
+
res = new bool[](3);
|
|
122
|
+
res[0] = res[1] = res[2] = false;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function getTokensIn() public pure override returns (address[] memory res) {
|
|
126
|
+
res = new address[](5);
|
|
127
|
+
res[0] = NATIVE;
|
|
128
|
+
res[1] = STETH;
|
|
129
|
+
res[2] = WSTETH;
|
|
130
|
+
res[3] = ANKRETH;
|
|
131
|
+
res[4] = LP;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function getTokensOut() public pure override returns (address[] memory res) {
|
|
135
|
+
res = new address[](4);
|
|
136
|
+
res[0] = STETH;
|
|
137
|
+
res[1] = WSTETH;
|
|
138
|
+
res[2] = ANKRETH;
|
|
139
|
+
res[3] = LP;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function isValidTokenIn(address token) public pure override returns (bool) {
|
|
143
|
+
return (token == NATIVE ||
|
|
144
|
+
token == STETH ||
|
|
145
|
+
token == WSTETH ||
|
|
146
|
+
token == ANKRETH ||
|
|
147
|
+
token == LP);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function isValidTokenOut(address token) public pure override returns (bool) {
|
|
151
|
+
return (token == STETH || token == WSTETH || token == ANKRETH || token == LP);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
import "../../SYBase.sol";
|
|
4
|
+
import "../../../../interfaces/ISwETH.sol";
|
|
5
|
+
|
|
6
|
+
contract SwETHSY is SYBase {
|
|
7
|
+
using Math for uint256;
|
|
8
|
+
|
|
9
|
+
address public immutable swETH;
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
string memory _name,
|
|
13
|
+
string memory _symbol,
|
|
14
|
+
address _swETH
|
|
15
|
+
) SYBase(_name, _symbol, _swETH) {
|
|
16
|
+
swETH = _swETH;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/*///////////////////////////////////////////////////////////////
|
|
20
|
+
DEPOSIT/REDEEM USING BASE TOKENS
|
|
21
|
+
//////////////////////////////////////////////////////////////*/
|
|
22
|
+
|
|
23
|
+
function _deposit(
|
|
24
|
+
address tokenIn,
|
|
25
|
+
uint256 amountDeposited
|
|
26
|
+
) internal virtual override returns (uint256 /*amountSharesOut*/) {
|
|
27
|
+
if (tokenIn == NATIVE) {
|
|
28
|
+
uint256 preBalance = _selfBalance(swETH);
|
|
29
|
+
ISwETH(swETH).deposit{ value: amountDeposited }();
|
|
30
|
+
return _selfBalance(swETH) - preBalance;
|
|
31
|
+
} else {
|
|
32
|
+
// sweth
|
|
33
|
+
return amountDeposited;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function _redeem(
|
|
38
|
+
address receiver,
|
|
39
|
+
address /*tokenOut*/,
|
|
40
|
+
uint256 amountSharesToRedeem
|
|
41
|
+
) internal virtual override returns (uint256 /*amountTokenOut*/) {
|
|
42
|
+
_transferOut(swETH, receiver, amountSharesToRedeem);
|
|
43
|
+
return amountSharesToRedeem;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/*///////////////////////////////////////////////////////////////
|
|
47
|
+
EXCHANGE-RATE
|
|
48
|
+
//////////////////////////////////////////////////////////////*/
|
|
49
|
+
|
|
50
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
51
|
+
return ISwETH(swETH).getRate();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/*///////////////////////////////////////////////////////////////
|
|
55
|
+
MISC FUNCTIONS FOR METADATA
|
|
56
|
+
//////////////////////////////////////////////////////////////*/
|
|
57
|
+
|
|
58
|
+
function _previewDeposit(
|
|
59
|
+
address tokenIn,
|
|
60
|
+
uint256 amountTokenToDeposit
|
|
61
|
+
) internal view override returns (uint256 /*amountSharesOut*/) {
|
|
62
|
+
if (tokenIn == NATIVE) {
|
|
63
|
+
return amountTokenToDeposit.divDown(ISwETH(swETH).getRate());
|
|
64
|
+
} else {
|
|
65
|
+
return amountTokenToDeposit;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function _previewRedeem(
|
|
70
|
+
address /*tokenOut*/,
|
|
71
|
+
uint256 amountSharesToRedeem
|
|
72
|
+
) internal pure override returns (uint256 /*amountTokenOut*/) {
|
|
73
|
+
return amountSharesToRedeem;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
77
|
+
res = new address[](2);
|
|
78
|
+
res[0] = swETH;
|
|
79
|
+
res[1] = NATIVE;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
83
|
+
res = new address[](1);
|
|
84
|
+
res[0] = swETH;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
88
|
+
return token == NATIVE || token == swETH;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
92
|
+
return token == swETH;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function assetInfo()
|
|
96
|
+
external
|
|
97
|
+
pure
|
|
98
|
+
returns (AssetType assetType, address assetAddress, uint8 assetDecimals)
|
|
99
|
+
{
|
|
100
|
+
return (AssetType.TOKEN, NATIVE, 18);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
pragma solidity 0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../../SYBaseWithRewards.sol";
|
|
6
|
+
import "./ThenaLpHelper.sol";
|
|
7
|
+
import "../../../../interfaces/IPendlePreviewHelper.sol";
|
|
8
|
+
import "../../../../interfaces/Thena/IThenaGaugeV2.sol";
|
|
9
|
+
import "../../../libraries/ArrayLib.sol";
|
|
10
|
+
|
|
11
|
+
contract PendleThenaSY is ThenaLpHelper, SYBaseWithRewards {
|
|
12
|
+
event SetNewBinarySearchEps(uint256 newEps);
|
|
13
|
+
event AddExternalRewardToken(address indexed token);
|
|
14
|
+
|
|
15
|
+
using Math for uint256;
|
|
16
|
+
using ArrayLib for address[];
|
|
17
|
+
|
|
18
|
+
address[] public externalRewardTokens;
|
|
19
|
+
address public immutable gauge;
|
|
20
|
+
address public immutable THENA;
|
|
21
|
+
IPendlePreviewHelper public immutable previewHelper;
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
string memory _name,
|
|
25
|
+
string memory _symbol,
|
|
26
|
+
address _pair,
|
|
27
|
+
address _factory,
|
|
28
|
+
address _router,
|
|
29
|
+
address _gauge,
|
|
30
|
+
address _THENA,
|
|
31
|
+
IPendlePreviewHelper _previewHelper
|
|
32
|
+
) SYBaseWithRewards(_name, _symbol, _pair) ThenaLpHelper(_pair, _factory, _router) {
|
|
33
|
+
THENA = _THENA;
|
|
34
|
+
gauge = _gauge;
|
|
35
|
+
previewHelper = _previewHelper;
|
|
36
|
+
_safeApproveInf(_pair, _gauge);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @dev See {SYBase-_deposit}
|
|
41
|
+
*/
|
|
42
|
+
function _deposit(address tokenIn, uint256 amountDeposited)
|
|
43
|
+
internal
|
|
44
|
+
virtual
|
|
45
|
+
override
|
|
46
|
+
returns (uint256 amountLpDeposited)
|
|
47
|
+
{
|
|
48
|
+
_withdrawAllFromGauge();
|
|
49
|
+
if (tokenIn == pair) {
|
|
50
|
+
amountLpDeposited = amountDeposited;
|
|
51
|
+
} else {
|
|
52
|
+
amountLpDeposited = _zapIn(tokenIn, amountDeposited);
|
|
53
|
+
}
|
|
54
|
+
_depositToGaugeIfNotEmergency();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @dev See {SYBase-_redeem}
|
|
59
|
+
*/
|
|
60
|
+
function _redeem(
|
|
61
|
+
address receiver,
|
|
62
|
+
address tokenOut,
|
|
63
|
+
uint256 amountSharesToRedeem
|
|
64
|
+
) internal virtual override returns (uint256 amountTokenOut) {
|
|
65
|
+
_withdrawAllFromGauge();
|
|
66
|
+
if (tokenOut == pair) {
|
|
67
|
+
amountTokenOut = amountSharesToRedeem;
|
|
68
|
+
} else {
|
|
69
|
+
amountTokenOut = _zapOut(tokenOut, amountSharesToRedeem);
|
|
70
|
+
}
|
|
71
|
+
_transferOut(tokenOut, receiver, amountTokenOut);
|
|
72
|
+
_depositToGaugeIfNotEmergency();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function exchangeRate() public view virtual override returns (uint256) {
|
|
76
|
+
return Math.ONE;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/*///////////////////////////////////////////////////////////////
|
|
80
|
+
REWARDS-RELATED
|
|
81
|
+
//////////////////////////////////////////////////////////////*/
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @dev See {IStandardizedYield-getRewardTokens}
|
|
85
|
+
*/
|
|
86
|
+
function _getRewardTokens() internal view virtual override returns (address[] memory res) {
|
|
87
|
+
res = new address[](1 + externalRewardTokens.length);
|
|
88
|
+
res[0] = THENA;
|
|
89
|
+
for(uint256 i = 1; i < res.length; ++i) {
|
|
90
|
+
res[i] = externalRewardTokens[i - 1];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _redeemExternalReward() internal override {
|
|
95
|
+
IThenaGaugeV2(gauge).getReward();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/*///////////////////////////////////////////////////////////////
|
|
99
|
+
PREVIEW-RELATED
|
|
100
|
+
//////////////////////////////////////////////////////////////*/
|
|
101
|
+
|
|
102
|
+
function _previewDeposit(address tokenIn, uint256 amountTokenToDeposit)
|
|
103
|
+
internal
|
|
104
|
+
view
|
|
105
|
+
override
|
|
106
|
+
returns (uint256)
|
|
107
|
+
{
|
|
108
|
+
if (tokenIn == pair) {
|
|
109
|
+
return amountTokenToDeposit;
|
|
110
|
+
} else {
|
|
111
|
+
return previewHelper.previewDeposit(tokenIn, amountTokenToDeposit);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function _previewRedeem(address tokenOut, uint256 amountSharesToRedeem)
|
|
116
|
+
internal
|
|
117
|
+
view
|
|
118
|
+
override
|
|
119
|
+
returns (uint256)
|
|
120
|
+
{
|
|
121
|
+
if (tokenOut == pair) {
|
|
122
|
+
return amountSharesToRedeem;
|
|
123
|
+
} else {
|
|
124
|
+
return previewHelper.previewRedeem(tokenOut, amountSharesToRedeem);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/*///////////////////////////////////////////////////////////////
|
|
129
|
+
MISC FUNCTIONS FOR METADATA
|
|
130
|
+
//////////////////////////////////////////////////////////////*/
|
|
131
|
+
|
|
132
|
+
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
133
|
+
res = new address[](3);
|
|
134
|
+
res[0] = token0;
|
|
135
|
+
res[1] = token1;
|
|
136
|
+
res[2] = pair;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
140
|
+
res = new address[](3);
|
|
141
|
+
res[0] = token0;
|
|
142
|
+
res[1] = token1;
|
|
143
|
+
res[2] = pair;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function isValidTokenIn(address token) public view virtual override returns (bool) {
|
|
147
|
+
return token == token0 || token == token1 || token == pair;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function isValidTokenOut(address token) public view virtual override returns (bool) {
|
|
151
|
+
return token == token0 || token == token1 || token == pair;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function assetInfo()
|
|
155
|
+
external
|
|
156
|
+
view
|
|
157
|
+
returns (
|
|
158
|
+
AssetType assetType,
|
|
159
|
+
address assetAddress,
|
|
160
|
+
uint8 assetDecimals
|
|
161
|
+
)
|
|
162
|
+
{
|
|
163
|
+
return (AssetType.LIQUIDITY, pair, IERC20Metadata(pair).decimals());
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/*///////////////////////////////////////////////////////////////
|
|
167
|
+
REWARD RELATED FUNCTIONS
|
|
168
|
+
//////////////////////////////////////////////////////////////*/
|
|
169
|
+
|
|
170
|
+
function _withdrawAllFromGauge() internal {
|
|
171
|
+
if (IThenaGaugeV2(gauge).balanceOf(address(this)) == 0) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (IThenaGaugeV2(gauge).emergency()) {
|
|
176
|
+
IThenaGaugeV2(gauge).emergencyWithdraw();
|
|
177
|
+
} else {
|
|
178
|
+
IThenaGaugeV2(gauge).withdrawAll();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function _depositToGaugeIfNotEmergency() internal {
|
|
183
|
+
if (!IThenaGaugeV2(gauge).emergency()) {
|
|
184
|
+
IThenaGaugeV2(gauge).depositAll();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function setBinarySearchEps(uint256 newEps) external onlyOwner {
|
|
189
|
+
require(newEps > 0 && newEps < 1e18, "invalid newEps");
|
|
190
|
+
binarySearchEps = newEps;
|
|
191
|
+
|
|
192
|
+
emit SetNewBinarySearchEps(newEps);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function addExternalRewardToken(address token) external onlyOwner {
|
|
196
|
+
// prevent adding THE as well
|
|
197
|
+
require(!_getRewardTokens().contains(token), "rewardToken existed");
|
|
198
|
+
externalRewardTokens.push(token);
|
|
199
|
+
|
|
200
|
+
emit AddExternalRewardToken(token);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
pragma solidity >=0.8.0;
|
|
4
|
+
|
|
5
|
+
import "../../../../interfaces/Thena/IThenaPair.sol";
|
|
6
|
+
import "../../../../interfaces/Thena/IThenaRouter.sol";
|
|
7
|
+
import "../../../../interfaces/Thena/IThenaFactory.sol";
|
|
8
|
+
import "../../../libraries/TokenHelper.sol";
|
|
9
|
+
import "../../../libraries/math/Math.sol";
|
|
10
|
+
import "./ThenaMath.sol";
|
|
11
|
+
|
|
12
|
+
abstract contract ThenaLpHelper is TokenHelper, ThenaMath {
|
|
13
|
+
address public immutable factory;
|
|
14
|
+
address public immutable pair;
|
|
15
|
+
|
|
16
|
+
bool public immutable isStable;
|
|
17
|
+
address public immutable token0;
|
|
18
|
+
address public immutable token1;
|
|
19
|
+
uint256 public immutable decimals0;
|
|
20
|
+
uint256 public immutable decimals1;
|
|
21
|
+
address public immutable router;
|
|
22
|
+
|
|
23
|
+
constructor(address _pair, address _factory, address _router) {
|
|
24
|
+
factory = _factory;
|
|
25
|
+
pair = _pair;
|
|
26
|
+
router = _router;
|
|
27
|
+
|
|
28
|
+
isStable = IThenaPair(pair).isStable();
|
|
29
|
+
token0 = IThenaPair(pair).token0();
|
|
30
|
+
token1 = IThenaPair(pair).token1();
|
|
31
|
+
decimals0 = 10 ** IERC20Metadata(token0).decimals();
|
|
32
|
+
decimals1 = 10 ** IERC20Metadata(token1).decimals();
|
|
33
|
+
|
|
34
|
+
_safeApproveInf(token0, router);
|
|
35
|
+
_safeApproveInf(token1, router);
|
|
36
|
+
_safeApproveInf(pair, router);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* ==================================================================
|
|
41
|
+
* ZAP ACTION RELATED
|
|
42
|
+
* ==================================================================
|
|
43
|
+
*/
|
|
44
|
+
function _zapIn(address tokenIn, uint256 amountIn) internal returns (uint256) {
|
|
45
|
+
(uint256 amount0ToAddLiq, uint256 amount1ToAddLiq) = _swapZapIn(tokenIn, amountIn);
|
|
46
|
+
return _addLiquidity(amount0ToAddLiq, amount1ToAddLiq);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function _zapOut(address tokenOut, uint256 amountLpIn) internal returns (uint256) {
|
|
50
|
+
(uint256 amount0, uint256 amount1) = _removeLiquidity(amountLpIn);
|
|
51
|
+
if (tokenOut == token0) {
|
|
52
|
+
return amount0 + _swap(token1, amount1);
|
|
53
|
+
} else {
|
|
54
|
+
return amount1 + _swap(token0, amount0);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _swapZapIn(
|
|
59
|
+
address tokenIn,
|
|
60
|
+
uint256 amountIn
|
|
61
|
+
) private returns (uint256 amount0ToAddLiq, uint256 amount1ToAddLiq) {
|
|
62
|
+
ThenaData memory data = _getNormalizedThenaData(tokenIn);
|
|
63
|
+
if (tokenIn == token0) {
|
|
64
|
+
uint256 amount0ToSwap = _getZapInSwapAmount(data, tokenIn, amountIn);
|
|
65
|
+
amount0ToAddLiq = amountIn - amount0ToSwap;
|
|
66
|
+
amount1ToAddLiq = _swap(token0, amount0ToSwap);
|
|
67
|
+
} else {
|
|
68
|
+
uint256 amount1ToSwap = _getZapInSwapAmount(data, tokenIn, amountIn);
|
|
69
|
+
amount0ToAddLiq = _swap(token1, amount1ToSwap);
|
|
70
|
+
amount1ToAddLiq = amountIn - amount1ToSwap;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* ==================================================================
|
|
76
|
+
* CAMELOT ROUTER RELATED
|
|
77
|
+
* ==================================================================
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
function _addLiquidity(
|
|
81
|
+
uint256 amount0ToAddLiq,
|
|
82
|
+
uint256 amount1ToAddLiq
|
|
83
|
+
) private returns (uint256 amountLpOut) {
|
|
84
|
+
(, , amountLpOut) = IThenaRouter(router).addLiquidity(
|
|
85
|
+
token0,
|
|
86
|
+
token1,
|
|
87
|
+
isStable,
|
|
88
|
+
amount0ToAddLiq,
|
|
89
|
+
amount1ToAddLiq,
|
|
90
|
+
0,
|
|
91
|
+
0,
|
|
92
|
+
address(this),
|
|
93
|
+
block.timestamp
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function _removeLiquidity(
|
|
98
|
+
uint256 amountLpToRemove
|
|
99
|
+
) private returns (uint256 amountTokenA, uint256 amountTokenB) {
|
|
100
|
+
return
|
|
101
|
+
IThenaRouter(router).removeLiquidity(
|
|
102
|
+
token0,
|
|
103
|
+
token1,
|
|
104
|
+
isStable,
|
|
105
|
+
amountLpToRemove,
|
|
106
|
+
0,
|
|
107
|
+
0,
|
|
108
|
+
address(this),
|
|
109
|
+
block.timestamp
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function _swap(address tokenIn, uint256 amountTokenIn) private returns (uint256) {
|
|
114
|
+
address tokenOut = tokenIn == token0 ? token1 : token0;
|
|
115
|
+
uint256 preBalance = _selfBalance(tokenOut);
|
|
116
|
+
|
|
117
|
+
IThenaRouter(router).swapExactTokensForTokensSimple(
|
|
118
|
+
amountTokenIn,
|
|
119
|
+
0,
|
|
120
|
+
tokenIn,
|
|
121
|
+
tokenOut,
|
|
122
|
+
isStable,
|
|
123
|
+
address(this),
|
|
124
|
+
block.timestamp
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
return _selfBalance(tokenOut) - preBalance;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* ==================================================================
|
|
132
|
+
* CAMELOT PAIR DATA READ
|
|
133
|
+
* ==================================================================
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
function _getNormalizedThenaData(
|
|
137
|
+
address tokenIn
|
|
138
|
+
) internal view returns (ThenaData memory data) {
|
|
139
|
+
data.pair = pair;
|
|
140
|
+
data.isStable = isStable;
|
|
141
|
+
data.fee = IThenaFactory(factory).getFee(data.isStable);
|
|
142
|
+
(data.reserve0, data.reserve1, ) = IThenaPair(pair).getReserves();
|
|
143
|
+
|
|
144
|
+
if (data.isStable) {
|
|
145
|
+
// if not stable, skip reading these data
|
|
146
|
+
data.decimals0 = decimals0;
|
|
147
|
+
data.decimals1 = decimals1;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Normalize token order
|
|
151
|
+
if (tokenIn == token1) {
|
|
152
|
+
(data.reserve0, data.reserve1) = (data.reserve1, data.reserve0);
|
|
153
|
+
(data.decimals0, data.decimals1) = (data.decimals1, data.decimals0);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|