@pendle/core-v2 0.16.2-testnet → 0.16.3-testnet
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 +15 -2
- 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/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json +13 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +13 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +15 -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 +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +15 -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/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +695 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +531 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +10 -0
- 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/OracleLib.sol/OracleLib.json +2 -2
- 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 +15 -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/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- 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/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +89 -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/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/PendlePrincipalToken.sol/PendlePrincipalToken.json +15 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +15 -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/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.json +13 -0
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +208 -2
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +30 -83
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +91 -17
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +50 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +181 -17
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +173 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +86 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.json +34 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.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/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/ISJoe.sol/ISJoe.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.json +45 -0
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +15 -2
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +67 -0
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -36
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +237 -61
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +120 -41
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +79 -24
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +49 -24
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +49 -24
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +15 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.json +14 -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/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +191 -2
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +35 -0
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json +1 -1
- package/contracts/core/BulkSeller/BulkSeller.sol +250 -0
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +89 -0
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +143 -0
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol +2 -4
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +107 -0
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +19 -4
- package/contracts/core/libraries/Errors.sol +17 -0
- package/contracts/interfaces/Curve/ICrvPool.sol +9 -27
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +3 -5
- package/contracts/interfaces/IPActionMintRedeem.sol +2 -0
- package/contracts/interfaces/IPBulkSeller.sol +28 -0
- package/contracts/interfaces/IPBulkSellerFactory.sol +12 -0
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +10 -0
- package/contracts/interfaces/IStETH.sol +6 -0
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +43 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +0 -144
- package/contracts/offchain-helpers/RouterStatic.sol +167 -51
- package/contracts/router/ActionAddRemoveLiq.sol +60 -44
- package/contracts/router/ActionMintRedeem.sol +19 -15
- package/contracts/router/ActionSwapPT.sol +3 -3
- package/contracts/router/ActionSwapYT.sol +11 -4
- package/contracts/router/base/ActionBaseMintRedeem.sol +73 -74
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +17 -1
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +10 -0
- package/contracts/router/kyberswap/KyberSwapHelper.sol +17 -8
- package/deployments/43113-core.json +3 -2
- package/deployments/43113-markets/benqi-market-QI-AVAX-FEB-2ND.json +9 -0
- package/deployments/80001-core.json +3 -2
- package/package.json +3 -2
- package/typechain-types/AccessControl.ts +360 -0
- package/typechain-types/ActionAddRemoveLiq.ts +83 -52
- package/typechain-types/ActionBaseMintRedeem.ts +27 -8
- package/typechain-types/ActionMintRedeem.ts +68 -17
- package/typechain-types/ActionSwapPT.ts +53 -12
- package/typechain-types/ActionSwapYT.ts +53 -12
- package/typechain-types/AggregationRouterHelper.ts +287 -3
- package/typechain-types/BaseSplitCodeFactoryContract.ts +9 -0
- package/typechain-types/BeaconProxy.ts +97 -0
- package/typechain-types/BoringOwnableUpgradeable.ts +9 -0
- package/typechain-types/BulkSeller.ts +776 -0
- package/typechain-types/BulkSellerFactory.ts +707 -0
- package/typechain-types/BulkSellerOffchain.ts +117 -0
- package/typechain-types/Curve3CrvPoolHelper.ts +236 -0
- package/typechain-types/CurveFraxUsdcPoolHelper.ts +158 -0
- package/typechain-types/CurveUsdd3CrvPoolHelper.ts +184 -0
- package/typechain-types/ERC165.ts +102 -0
- package/typechain-types/IAccessControl.ts +305 -0
- package/typechain-types/IAggregationRouterHelper.ts +108 -0
- package/typechain-types/ICrvPool.ts +66 -164
- package/typechain-types/IERC165.ts +102 -0
- package/typechain-types/IPActionAddRemoveLiq.ts +56 -44
- package/typechain-types/IPActionMintRedeem.ts +41 -9
- package/typechain-types/IPActionSwapPT.ts +26 -4
- package/typechain-types/IPActionSwapYT.ts +26 -4
- package/typechain-types/IPAllAction.ts +77 -55
- package/typechain-types/IPBulkSeller.ts +290 -0
- package/typechain-types/IPBulkSellerCallback.ts +115 -0
- package/typechain-types/IPBulkSellerFactory.ts +147 -0
- package/typechain-types/IStETH.ts +56 -0
- package/typechain-types/ITriCrvPool.ts +345 -0
- package/typechain-types/Initializable.ts +68 -0
- package/typechain-types/KyberSwapHelper.ts +8 -8
- package/typechain-types/MarketMathStatic.ts +0 -50
- package/typechain-types/PendleCurveFraxUsdcSY.ts +1228 -0
- package/typechain-types/PendleCurveUsdd3CrvSY.ts +1299 -0
- package/typechain-types/PendleFeeDistributor.ts +9 -0
- package/typechain-types/PendleFeeDistributorFactory.ts +9 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +9 -0
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +9 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +9 -0
- package/typechain-types/PendleMarketFactory.ts +9 -0
- package/typechain-types/PendleMsgReceiveEndpointUpg.ts +9 -0
- package/typechain-types/PendleMsgSendEndpointUpg.ts +9 -0
- package/typechain-types/PendleMsgSenderAppUpg.ts +9 -0
- package/typechain-types/PendlePrincipalToken.ts +9 -0
- package/typechain-types/PendleRouter.ts +9 -0
- package/typechain-types/PendleVotingControllerUpg.ts +9 -0
- package/typechain-types/PendleYieldContractFactory.ts +9 -0
- package/typechain-types/ReentrancyGuardUpgradeable.ts +68 -0
- package/typechain-types/RouterStatic.ts +203 -22
- package/typechain-types/VotingEscrowPendleMainchain.ts +9 -0
- package/typechain-types/VotingEscrowPendleSidechain.ts +9 -0
- package/typechain-types/factories/AccessControl__factory.ts +227 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +131 -59
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +14 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +90 -42
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +60 -42
- package/typechain-types/factories/ActionSwapYT__factory.ts +60 -42
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +190 -1
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +14 -1
- package/typechain-types/factories/BaseSplitCodeFactory__factory.ts +1 -1
- package/typechain-types/factories/BeaconProxy__factory.ts +141 -0
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeable__factory.ts +13 -0
- package/typechain-types/factories/BulkSellerFactory__factory.ts +584 -0
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +120 -0
- package/typechain-types/factories/BulkSeller__factory.ts +745 -0
- package/typechain-types/factories/Curve3CrvPoolHelper__factory.ts +220 -0
- package/typechain-types/factories/CurveFraxUsdcPoolHelper__factory.ts +146 -0
- package/typechain-types/factories/CurveUsdd3CrvPoolHelper__factory.ts +172 -0
- package/typechain-types/factories/ERC165__factory.ts +39 -0
- package/typechain-types/factories/ERC20__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +207 -1
- package/typechain-types/factories/IAccessControl__factory.ts +198 -0
- package/typechain-types/factories/IAggregationRouterHelper__factory.ts +54 -0
- package/typechain-types/factories/ICrvPool__factory.ts +30 -83
- package/typechain-types/factories/IERC165__factory.ts +42 -0
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +91 -17
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +50 -0
- package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -0
- package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -0
- package/typechain-types/factories/IPAllAction__factory.ts +181 -17
- package/typechain-types/factories/IPBulkSellerCallback__factory.ts +53 -0
- package/typechain-types/factories/IPBulkSellerFactory__factory.ts +101 -0
- package/typechain-types/factories/IPBulkSeller__factory.ts +185 -0
- package/typechain-types/factories/IStETH__factory.ts +45 -0
- package/typechain-types/factories/ITriCrvPool__factory.ts +225 -0
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +1 -1
- package/typechain-types/factories/Initializable__factory.ts +36 -0
- package/typechain-types/factories/KyberSwapHelper__factory.ts +1 -1
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -35
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1068 -0
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1168 -0
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +14 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +13 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMsgSenderAppUpg__factory.ts +13 -0
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +14 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +14 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/ReentrancyGuardUpgradeable__factory.ts +43 -0
- package/typechain-types/factories/RouterStatic__factory.ts +182 -2
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +14 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +14 -1
- package/typechain-types/hardhat.d.ts +139 -13
- package/typechain-types/index.ts +30 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +0 -1018
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +0 -76
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +0 -167
- package/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol +0 -83
|
@@ -6,6 +6,12 @@ interface ICrvPool {
|
|
|
6
6
|
|
|
7
7
|
function get_virtual_price() external view returns (uint256);
|
|
8
8
|
|
|
9
|
+
function lp_token() external view returns (address);
|
|
10
|
+
|
|
11
|
+
function fee() external view returns (uint256);
|
|
12
|
+
|
|
13
|
+
function admin_fee() external view returns (uint256);
|
|
14
|
+
|
|
9
15
|
function get_dy(
|
|
10
16
|
int128 i,
|
|
11
17
|
int128 j,
|
|
@@ -20,52 +26,28 @@ interface ICrvPool {
|
|
|
20
26
|
address _receiver
|
|
21
27
|
) external returns (uint256);
|
|
22
28
|
|
|
23
|
-
function add_liquidity(
|
|
24
|
-
uint256[] memory _deposit_amount,
|
|
25
|
-
uint256 _min_amount,
|
|
26
|
-
address _receiver
|
|
27
|
-
) external returns (uint256);
|
|
28
|
-
|
|
29
29
|
function add_liquidity(
|
|
30
30
|
uint256[2] memory _deposit_amount,
|
|
31
31
|
uint256 _min_amount
|
|
32
32
|
) external;
|
|
33
33
|
|
|
34
|
-
function add_liquidity(
|
|
35
|
-
uint256[3] memory _deposit_amount,
|
|
36
|
-
uint256 _min_amount
|
|
37
|
-
) external;
|
|
38
|
-
|
|
39
|
-
function remove_liquidity(
|
|
40
|
-
uint256 _burn_amount,
|
|
41
|
-
uint256[] memory _min_amounts,
|
|
42
|
-
address _receiver
|
|
43
|
-
) external returns (uint256[] memory);
|
|
44
|
-
|
|
45
34
|
function remove_liquidity_one_coin(
|
|
46
35
|
uint256 _burn_amount,
|
|
47
36
|
int128 i,
|
|
48
37
|
uint256 _min_amount
|
|
49
38
|
) external;
|
|
50
39
|
|
|
51
|
-
function calc_token_amount(uint256[] memory _amounts, bool _is_deposit)
|
|
52
|
-
external
|
|
53
|
-
view
|
|
54
|
-
returns (uint256);
|
|
55
|
-
|
|
56
40
|
function calc_token_amount(uint256[2] memory _amounts, bool _is_deposit)
|
|
57
41
|
external
|
|
58
42
|
view
|
|
59
43
|
returns (uint256);
|
|
60
44
|
|
|
61
|
-
function
|
|
45
|
+
function calc_withdraw_one_coin(uint256 _burn_amount, int128 i)
|
|
62
46
|
external
|
|
63
47
|
view
|
|
64
48
|
returns (uint256);
|
|
65
49
|
|
|
50
|
+
function balances(uint256 i) external view returns (uint256);
|
|
66
51
|
|
|
67
|
-
function
|
|
68
|
-
external
|
|
69
|
-
view
|
|
70
|
-
returns (uint256);
|
|
52
|
+
function A_precise() external view returns (uint256);
|
|
71
53
|
}
|
|
@@ -19,7 +19,7 @@ interface IPActionAddRemoveLiq {
|
|
|
19
19
|
address indexed market,
|
|
20
20
|
address indexed receiver,
|
|
21
21
|
address tokenIn,
|
|
22
|
-
uint256
|
|
22
|
+
uint256 netTokenUsed,
|
|
23
23
|
uint256 netPtUsed,
|
|
24
24
|
uint256 netLpOut
|
|
25
25
|
);
|
|
@@ -110,8 +110,7 @@ interface IPActionAddRemoveLiq {
|
|
|
110
110
|
function addLiquidityDualTokenAndPt(
|
|
111
111
|
address receiver,
|
|
112
112
|
address market,
|
|
113
|
-
|
|
114
|
-
uint256 netTokenDesired,
|
|
113
|
+
TokenInput calldata input,
|
|
115
114
|
uint256 netPtDesired,
|
|
116
115
|
uint256 minLpOut
|
|
117
116
|
)
|
|
@@ -159,8 +158,7 @@ interface IPActionAddRemoveLiq {
|
|
|
159
158
|
address receiver,
|
|
160
159
|
address market,
|
|
161
160
|
uint256 netLpToRemove,
|
|
162
|
-
|
|
163
|
-
uint256 minTokenOut,
|
|
161
|
+
TokenOutput calldata output,
|
|
164
162
|
uint256 minPtOut
|
|
165
163
|
) external returns (uint256 netTokenOut, uint256 netPtOut);
|
|
166
164
|
|
|
@@ -138,6 +138,7 @@ interface IPActionMintRedeem {
|
|
|
138
138
|
// key-value pair
|
|
139
139
|
address[] syAddrs;
|
|
140
140
|
address[] tokenRedeemSys;
|
|
141
|
+
bool[] useBulks;
|
|
141
142
|
//
|
|
142
143
|
}
|
|
143
144
|
|
|
@@ -146,6 +147,7 @@ interface IPActionMintRedeem {
|
|
|
146
147
|
address[] tokens;
|
|
147
148
|
bytes[] kybercalls;
|
|
148
149
|
//
|
|
150
|
+
address kyberRouter;
|
|
149
151
|
address outputToken;
|
|
150
152
|
uint256 minTokenOut;
|
|
151
153
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../core/BulkSeller/BulkSellerMathCore.sol";
|
|
5
|
+
|
|
6
|
+
interface IPBulkSeller {
|
|
7
|
+
function swapExactSyForToken(
|
|
8
|
+
address receiver,
|
|
9
|
+
uint256 exactSyIn,
|
|
10
|
+
uint256 minTokenOut
|
|
11
|
+
) external returns (uint256 netTokenOut);
|
|
12
|
+
|
|
13
|
+
function swapExactTokenForSy(
|
|
14
|
+
address receiver,
|
|
15
|
+
uint256 netTokenIn,
|
|
16
|
+
uint256 minSyOut
|
|
17
|
+
) external returns (uint256 netSyOut);
|
|
18
|
+
|
|
19
|
+
function calcSwapExactTokenForSy(uint256 netTokenIn) external view returns (uint256 netSyOut);
|
|
20
|
+
|
|
21
|
+
function calcSwapExactSyForToken(uint256 netSyIn) external view returns (uint256 netTokenOut);
|
|
22
|
+
|
|
23
|
+
function SY() external view returns (address);
|
|
24
|
+
|
|
25
|
+
function token() external view returns (address);
|
|
26
|
+
|
|
27
|
+
function readState() external view returns (BulkSellerState memory);
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
interface IPBulkSellerFactory {
|
|
5
|
+
event UpgradedBeacon(address indexed implementation);
|
|
6
|
+
|
|
7
|
+
function get(address token, address SY) external view returns (address);
|
|
8
|
+
|
|
9
|
+
function isMaintainer(address addr) external view returns (bool);
|
|
10
|
+
|
|
11
|
+
function isAdmin(address addr) external view returns (bool);
|
|
12
|
+
}
|
|
@@ -11,4 +11,10 @@ interface IStETH {
|
|
|
11
11
|
function burnShares(address _account, uint256 _sharesAmount)
|
|
12
12
|
external
|
|
13
13
|
returns (uint256 newTotalShares);
|
|
14
|
+
|
|
15
|
+
function sharesOf(address account) external view returns (uint256);
|
|
16
|
+
|
|
17
|
+
function getTotalShares() external view returns (uint256);
|
|
18
|
+
|
|
19
|
+
function getTotalPooledEther() external view returns (uint256);
|
|
14
20
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../core/BulkSeller/BulkSellerMathCore.sol";
|
|
5
|
+
import "../core/BulkSeller/BulkSeller.sol";
|
|
6
|
+
|
|
7
|
+
// upgradable bla bla
|
|
8
|
+
contract BulkSellerOffchain {
|
|
9
|
+
using BulkSellerMathCore for BulkSellerState;
|
|
10
|
+
using Math for uint256;
|
|
11
|
+
|
|
12
|
+
// rmb to add fee here
|
|
13
|
+
function calcCurrentRates(IPBulkSeller bulk)
|
|
14
|
+
external
|
|
15
|
+
view
|
|
16
|
+
returns (uint256 rateTokenToSy, uint256 rateSyToToken)
|
|
17
|
+
{
|
|
18
|
+
BulkSellerState memory state = bulk.readState();
|
|
19
|
+
address SY = bulk.SY();
|
|
20
|
+
address token = bulk.token();
|
|
21
|
+
|
|
22
|
+
{
|
|
23
|
+
uint256 hypoTotalToken = state.totalToken +
|
|
24
|
+
state.calcSwapExactSyForToken(state.totalSy);
|
|
25
|
+
uint256 netSyFromToken = IStandardizedYield(SY).previewDeposit(token, hypoTotalToken);
|
|
26
|
+
|
|
27
|
+
rateTokenToSy = netSyFromToken.divDown(hypoTotalToken);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
{
|
|
31
|
+
uint256 hypoTotalSy = state.totalSy + state.calcSwapExactTokenForSy(state.totalToken);
|
|
32
|
+
uint256 netTokenFromSy = IStandardizedYield(SY).previewRedeem(token, hypoTotalSy);
|
|
33
|
+
|
|
34
|
+
rateSyToToken = netTokenFromSy.divDown(hypoTotalSy);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// TODO: pause contract when rate is bad compared to market
|
|
39
|
+
// TODO: Sound alarm if updates fail
|
|
40
|
+
// TODO: audit even the typescript code
|
|
41
|
+
// TODO: add a max with currentRate to guarantee no loss?
|
|
42
|
+
// TODO: pause immediately if lost enough money
|
|
43
|
+
}
|
|
@@ -140,31 +140,6 @@ library MarketMathStatic {
|
|
|
140
140
|
priceImpact = calcPriceImpact(market, netPtFromSwap.Int());
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
/// @dev netPtFromSwap is the parameter to approx
|
|
144
|
-
function addLiquiditySingleBaseTokenStatic(
|
|
145
|
-
address market,
|
|
146
|
-
address baseToken,
|
|
147
|
-
uint256 netBaseTokenIn,
|
|
148
|
-
ApproxParams memory approxParams
|
|
149
|
-
)
|
|
150
|
-
external
|
|
151
|
-
returns (
|
|
152
|
-
uint256 netLpOut,
|
|
153
|
-
uint256 netPtFromSwap,
|
|
154
|
-
uint256 netSyFee,
|
|
155
|
-
uint256 priceImpact
|
|
156
|
-
)
|
|
157
|
-
{
|
|
158
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
159
|
-
|
|
160
|
-
return
|
|
161
|
-
addLiquiditySingleSyStatic(
|
|
162
|
-
market,
|
|
163
|
-
SY.previewDeposit(baseToken, netBaseTokenIn),
|
|
164
|
-
approxParams
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
143
|
function removeLiquidityDualSyAndPtStatic(address market, uint256 netLpToRemove)
|
|
169
144
|
external
|
|
170
145
|
view
|
|
@@ -174,20 +149,6 @@ library MarketMathStatic {
|
|
|
174
149
|
(netSyOut, netPtOut) = state.removeLiquidity(netLpToRemove);
|
|
175
150
|
}
|
|
176
151
|
|
|
177
|
-
function removeLiquidityDualTokenAndPtStatic(
|
|
178
|
-
address market,
|
|
179
|
-
uint256 metLpToRemove,
|
|
180
|
-
address tokenOut
|
|
181
|
-
) external view returns (uint256 netTokenOut, uint256 netPtOut) {
|
|
182
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
183
|
-
|
|
184
|
-
uint256 netSyOut;
|
|
185
|
-
MarketState memory state = IPMarket(market).readState();
|
|
186
|
-
(netSyOut, netPtOut) = state.removeLiquidity(metLpToRemove);
|
|
187
|
-
|
|
188
|
-
netTokenOut = SY.previewRedeem(tokenOut, netSyOut);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
152
|
/// @dev netPtFromSwap is the parameter to approx
|
|
192
153
|
function removeLiquiditySinglePtStatic(
|
|
193
154
|
address market,
|
|
@@ -243,25 +204,6 @@ library MarketMathStatic {
|
|
|
243
204
|
}
|
|
244
205
|
}
|
|
245
206
|
|
|
246
|
-
function removeLiquiditySingleBaseTokenStatic(
|
|
247
|
-
address market,
|
|
248
|
-
uint256 netLpToRemove,
|
|
249
|
-
address baseToken
|
|
250
|
-
)
|
|
251
|
-
external
|
|
252
|
-
returns (
|
|
253
|
-
uint256 netBaseTokenOut,
|
|
254
|
-
uint256 netSyFee,
|
|
255
|
-
uint256 priceImpact
|
|
256
|
-
)
|
|
257
|
-
{
|
|
258
|
-
uint256 netSyOut;
|
|
259
|
-
(netSyOut, netSyFee, priceImpact) = removeLiquiditySingleSyStatic(market, netLpToRemove);
|
|
260
|
-
|
|
261
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
262
|
-
netBaseTokenOut = SY.previewRedeem(baseToken, netSyOut);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
207
|
function swapExactPtForSyStatic(address market, uint256 exactPtIn)
|
|
266
208
|
public
|
|
267
209
|
returns (
|
|
@@ -335,49 +277,6 @@ library MarketMathStatic {
|
|
|
335
277
|
priceImpact = calcPriceImpact(market, netPtIn.neg());
|
|
336
278
|
}
|
|
337
279
|
|
|
338
|
-
/// @dev netPtOut is the parameter to approx
|
|
339
|
-
function swapExactBaseTokenForPtStatic(
|
|
340
|
-
address market,
|
|
341
|
-
address baseToken,
|
|
342
|
-
uint256 amountBaseToken,
|
|
343
|
-
ApproxParams memory approxParams
|
|
344
|
-
)
|
|
345
|
-
external
|
|
346
|
-
returns (
|
|
347
|
-
uint256 netPtOut,
|
|
348
|
-
uint256 netSyFee,
|
|
349
|
-
uint256 priceImpact
|
|
350
|
-
)
|
|
351
|
-
{
|
|
352
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
353
|
-
|
|
354
|
-
return
|
|
355
|
-
swapExactSyForPtStatic(
|
|
356
|
-
market,
|
|
357
|
-
SY.previewDeposit(baseToken, amountBaseToken),
|
|
358
|
-
approxParams
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
function swapExactPtForBaseTokenStatic(
|
|
363
|
-
address market,
|
|
364
|
-
uint256 exactPtIn,
|
|
365
|
-
address baseToken
|
|
366
|
-
)
|
|
367
|
-
external
|
|
368
|
-
returns (
|
|
369
|
-
uint256 netBaseTokenOut,
|
|
370
|
-
uint256 netSyFee,
|
|
371
|
-
uint256 priceImpact
|
|
372
|
-
)
|
|
373
|
-
{
|
|
374
|
-
uint256 netSyOut;
|
|
375
|
-
(netSyOut, netSyFee, priceImpact) = swapExactPtForSyStatic(market, exactPtIn);
|
|
376
|
-
|
|
377
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
378
|
-
netBaseTokenOut = SY.previewRedeem(baseToken, netSyOut);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
280
|
function swapSyForExactYtStatic(address market, uint256 exactYtOut)
|
|
382
281
|
external
|
|
383
282
|
returns (
|
|
@@ -477,49 +376,6 @@ library MarketMathStatic {
|
|
|
477
376
|
priceImpact = calcPriceImpact(market, netYtIn.Int());
|
|
478
377
|
}
|
|
479
378
|
|
|
480
|
-
function swapExactYtForBaseTokenStatic(
|
|
481
|
-
address market,
|
|
482
|
-
uint256 exactYtIn,
|
|
483
|
-
address baseToken
|
|
484
|
-
)
|
|
485
|
-
external
|
|
486
|
-
returns (
|
|
487
|
-
uint256 netBaseTokenOut,
|
|
488
|
-
uint256 netSyFee,
|
|
489
|
-
uint256 priceImpact
|
|
490
|
-
)
|
|
491
|
-
{
|
|
492
|
-
uint256 netSyOut;
|
|
493
|
-
(netSyOut, netSyFee, priceImpact) = swapExactYtForSyStatic(market, exactYtIn);
|
|
494
|
-
|
|
495
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
496
|
-
netBaseTokenOut = SY.previewRedeem(baseToken, netSyOut);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/// @dev netYtOut is the parameter to approx
|
|
500
|
-
function swapExactBaseTokenForYtStatic(
|
|
501
|
-
address market,
|
|
502
|
-
address baseToken,
|
|
503
|
-
uint256 amountBaseToken,
|
|
504
|
-
ApproxParams memory approxParams
|
|
505
|
-
)
|
|
506
|
-
external
|
|
507
|
-
returns (
|
|
508
|
-
uint256 netYtOut,
|
|
509
|
-
uint256 netSyFee,
|
|
510
|
-
uint256 priceImpact
|
|
511
|
-
)
|
|
512
|
-
{
|
|
513
|
-
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
514
|
-
|
|
515
|
-
return
|
|
516
|
-
swapExactSyForYtStatic(
|
|
517
|
-
market,
|
|
518
|
-
SY.previewDeposit(baseToken, amountBaseToken),
|
|
519
|
-
approxParams
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
379
|
// totalPtToSwap is the param to approx
|
|
524
380
|
function swapExactPtForYt(
|
|
525
381
|
address market,
|