@pendle/core-v2 0.15.2-mainnet → 0.16.0-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 +48 -110
- 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 +21 -75
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json +0 -39
- 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 +2 -15
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +0 -13
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -15
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -46
- 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 +8 -52
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -15
- 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/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 +17 -77
- 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/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1018 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/{base → ConvexCurveLP}/PendleConvexLPSY.sol/PendleConvexLPSY.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +76 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStaking.sol/PendleLooksStaking.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/{PendleLooksStakingSY.sol/PendleLooksStakingSY.json → PendleLooksStaking.sol/PendleLooksStaking.json} +4 -4
- 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 +2 -15
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -85
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +4 -17
- 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 +38 -3
- 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 +0 -13
- 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 +35 -319
- 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/ConvexCurve/IBooster.sol/IBooster.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 +85 -39
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.json +53 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.json +45 -0
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.json +0 -7
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +17 -91
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +0 -50
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +0 -20
- 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 +0 -20
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +17 -181
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.json +2 -2
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.json +2 -12
- 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/IPYieldContractFactory.sol/IPYieldContractFactory.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 +0 -45
- 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 +2 -15
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +80 -2
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +60 -299
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +41 -118
- 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 +24 -61
- 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 +24 -31
- 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 +24 -31
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -15
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.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/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -191
- 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/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +1 -1
- package/contracts/core/Market/PendleMarket.sol +7 -18
- package/contracts/core/Market/PendleMarketFactory.sol +5 -15
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
- package/contracts/core/StandardizedYield/implementations/Convex/{base → ConvexCurveLP}/PendleConvexLPSY.sol +4 -2
- package/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol +83 -0
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +4 -19
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +7 -21
- package/contracts/core/YieldContracts/PendleYieldToken.sol +21 -54
- package/contracts/core/erc20/PendleERC20.sol +7 -4
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +1 -1
- package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -1
- package/contracts/core/libraries/Errors.sol +2 -28
- package/contracts/core/libraries/TokenHelper.sol +0 -9
- package/contracts/interfaces/ConvexCurve/IBooster.sol +1 -1
- package/contracts/interfaces/Curve/ICrvPool.sol +31 -12
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +5 -3
- package/contracts/interfaces/IPActionMintRedeem.sol +0 -2
- package/contracts/interfaces/IPMarketFactory.sol +1 -1
- package/contracts/interfaces/IPYieldContractFactory.sol +1 -1
- package/contracts/interfaces/IStETH.sol +0 -6
- package/contracts/interfaces/IStandardizedYield.sol +10 -15
- package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +30 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +173 -0
- package/contracts/offchain-helpers/RouterStatic.sol +50 -189
- package/contracts/router/ActionAddRemoveLiq.sol +52 -71
- package/contracts/router/ActionCallback.sol +8 -4
- package/contracts/router/ActionMintRedeem.sol +18 -27
- package/contracts/router/ActionSwapPT.sol +9 -8
- package/contracts/router/ActionSwapPTYT.sol +7 -3
- package/contracts/router/ActionSwapYT.sol +10 -15
- package/contracts/router/PendleRouter.sol +0 -3
- package/contracts/router/base/ActionBaseMintRedeem.sol +83 -78
- package/contracts/router/base/MarketApproxLib.sol +1 -1
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +1 -17
- package/contracts/router/kyberswap/KyberSwapHelper.sol +8 -21
- package/deployments/43113-core.json +16 -0
- package/deployments/43113-helper.json +3 -0
- package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/deployments/43113-testenv.json +22 -0
- package/deployments/80001-core.json +15 -0
- package/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/deployments/80001-testenv.json +22 -0
- package/package.json +2 -3
- package/typechain-types/ActionAddRemoveLiq.ts +52 -64
- package/typechain-types/ActionBaseMintRedeem.ts +8 -8
- package/typechain-types/ActionMintRedeem.ts +16 -48
- package/typechain-types/ActionSwapPT.ts +12 -34
- package/typechain-types/ActionSwapYT.ts +12 -34
- package/typechain-types/AggregationRouterHelper.ts +3 -287
- package/typechain-types/BaseSplitCodeFactoryContract.ts +0 -9
- package/typechain-types/BoringOwnableUpgradeable.ts +0 -9
- package/typechain-types/IBooster.ts +3 -9
- package/typechain-types/ICrvPool.ts +172 -69
- package/typechain-types/ILooksStaking.ts +0 -27
- package/typechain-types/IPActionAddRemoveLiq.ts +44 -56
- package/typechain-types/IPActionMintRedeem.ts +8 -40
- package/typechain-types/IPActionSwapPT.ts +4 -26
- package/typechain-types/IPActionSwapYT.ts +4 -26
- package/typechain-types/IPAllAction.ts +54 -76
- package/typechain-types/IPMarketFactory.ts +2 -2
- package/typechain-types/IPMsgSendEndpoint.ts +14 -24
- package/typechain-types/IPYieldContractFactory.ts +3 -3
- package/typechain-types/IStETH.ts +0 -56
- package/typechain-types/ImplicitSwapfeeContract.ts +17 -9
- package/typechain-types/KyberSwapHelper.ts +8 -8
- package/typechain-types/MarketMathStatic.ts +117 -0
- package/typechain-types/PendleFeeDistributor.ts +0 -9
- package/typechain-types/PendleFeeDistributorFactory.ts +0 -9
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +0 -9
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +0 -9
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +0 -9
- package/typechain-types/PendleMarketFactory.ts +2 -51
- package/typechain-types/PendleMsgReceiveEndpointUpg.ts +68 -135
- package/typechain-types/PendleMsgSendEndpointUpg.ts +39 -108
- package/typechain-types/PendleMsgSenderAppUpg.ts +0 -64
- package/typechain-types/PendlePrincipalToken.ts +0 -9
- package/typechain-types/PendleRouter.ts +0 -9
- package/typechain-types/PendleVotingControllerUpg.ts +0 -64
- package/typechain-types/PendleYieldContractFactory.ts +8 -57
- package/typechain-types/PendleYieldToken.ts +0 -21
- package/typechain-types/RouterStatic.ts +20 -302
- package/typechain-types/VotingEscrowPendleMainchain.ts +6 -70
- package/typechain-types/VotingEscrowPendleSidechain.ts +0 -9
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +59 -122
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +42 -65
- 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 +42 -35
- package/typechain-types/factories/ActionSwapYT__factory.ts +42 -35
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -190
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +1 -14
- package/typechain-types/factories/BaseSplitCodeFactory__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeable__factory.ts +0 -13
- package/typechain-types/factories/ERC20__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +34 -318
- package/typechain-types/factories/IBooster__factory.ts +1 -1
- package/typechain-types/factories/ICrvPool__factory.ts +85 -39
- package/typechain-types/factories/ILooksStaking__factory.ts +0 -7
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +17 -91
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +0 -50
- package/typechain-types/factories/IPActionSwapPT__factory.ts +0 -20
- package/typechain-types/factories/IPActionSwapYT__factory.ts +0 -20
- package/typechain-types/factories/IPAllAction__factory.ts +17 -181
- package/typechain-types/factories/IPMarketFactory__factory.ts +2 -2
- package/typechain-types/factories/IPMsgSendEndpoint__factory.ts +2 -12
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/IStETH__factory.ts +0 -45
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +12 -4
- package/typechain-types/factories/KyberSwapHelper__factory.ts +1 -1
- package/typechain-types/factories/MarketMathStatic__factory.ts +79 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1 -1
- 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 +1 -14
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -14
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +0 -13
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -14
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -14
- package/typechain-types/factories/PendleMarketFactory__factory.ts +16 -76
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +51 -113
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +23 -84
- package/typechain-types/factories/PendleMsgSenderAppUpg__factory.ts +0 -39
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -14
- 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 +1 -14
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +2 -57
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -84
- package/typechain-types/factories/PendleYieldToken__factory.ts +3 -16
- package/typechain-types/factories/RouterStatic__factory.ts +1 -244
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +8 -63
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -14
- package/typechain-types/hardhat.d.ts +39 -219
- package/typechain-types/index.ts +12 -48
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.json +0 -10
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +0 -10
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +0 -4
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +0 -699
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +0 -4
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +0 -515
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +0 -4
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +0 -1003
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +0 -1068
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.json +0 -213
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.json +0 -119
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.json +0 -39
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +0 -173
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +0 -86
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.json +0 -34
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +0 -35
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +0 -35
- package/contracts/core/BulkSeller/BulkSeller.sol +0 -259
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +0 -88
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +0 -143
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol +0 -102
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol +0 -160
- package/contracts/core/StandardizedYield/implementations/Convex/README.md +0 -29
- package/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol +0 -215
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +0 -127
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +0 -152
- package/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol +0 -122
- package/contracts/interfaces/Curve/ITriCrvPool.sol +0 -41
- package/contracts/interfaces/ILooksFeeSharing.sol +0 -5
- package/contracts/interfaces/ILooksStaking.sol +0 -13
- package/contracts/interfaces/IPBulkSeller.sol +0 -28
- package/contracts/interfaces/IPBulkSellerFactory.sol +0 -12
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +0 -10
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +0 -43
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +0 -10
- package/deployments/1-core.json +0 -16
- package/deployments/1-markets/FRAX_30_MAR_23.json +0 -8
- package/deployments/1-markets/LOOKS_30_MAR_23.json +0 -8
- package/deployments/1-markets/STETH_MARCH_30.json +0 -8
- package/deployments/1-markets/USDD_MARCH_30.json +0 -8
- package/deployments/1-offchain-helper.json +0 -3
- package/typechain-types/AccessControl.ts +0 -360
- package/typechain-types/AccessControlUpgradeable.ts +0 -369
- package/typechain-types/BeaconProxy.ts +0 -97
- package/typechain-types/BulkSeller.ts +0 -777
- package/typechain-types/BulkSellerFactory.ts +0 -707
- package/typechain-types/BulkSellerOffchain.ts +0 -117
- package/typechain-types/ContextUpgradeable.ts +0 -68
- package/typechain-types/Curve3CrvPoolHelper.ts +0 -236
- package/typechain-types/CurveFraxUsdcPoolHelper.ts +0 -158
- package/typechain-types/CurveUsdd3CrvPoolHelper.ts +0 -184
- package/typechain-types/ERC165.ts +0 -102
- package/typechain-types/ERC165Upgradeable.ts +0 -113
- package/typechain-types/IAccessControl.ts +0 -305
- package/typechain-types/IAccessControlUpgradeable.ts +0 -305
- package/typechain-types/IAggregationRouterHelper.ts +0 -108
- package/typechain-types/IERC165.ts +0 -102
- package/typechain-types/IERC165Upgradeable.ts +0 -102
- package/typechain-types/IPBulkSeller.ts +0 -290
- package/typechain-types/IPBulkSellerCallback.ts +0 -115
- package/typechain-types/IPBulkSellerFactory.ts +0 -147
- package/typechain-types/ITriCrvPool.ts +0 -345
- package/typechain-types/Initializable.ts +0 -68
- package/typechain-types/PendleConvex2TokensSY.ts +0 -1215
- package/typechain-types/PendleCurveFraxUsdcSY.ts +0 -1228
- package/typechain-types/PendleCurveUsdd3CrvSY.ts +0 -1299
- package/typechain-types/PendleLooksStakingSY.ts +0 -1052
- package/typechain-types/ReentrancyGuardUpgradeable.ts +0 -68
- package/typechain-types/factories/AccessControlUpgradeable__factory.ts +0 -247
- package/typechain-types/factories/AccessControl__factory.ts +0 -227
- package/typechain-types/factories/BeaconProxy__factory.ts +0 -141
- package/typechain-types/factories/BulkSellerFactory__factory.ts +0 -568
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +0 -88
- package/typechain-types/factories/BulkSeller__factory.ts +0 -749
- package/typechain-types/factories/ContextUpgradeable__factory.ts +0 -39
- package/typechain-types/factories/Curve3CrvPoolHelper__factory.ts +0 -220
- package/typechain-types/factories/CurveFraxUsdcPoolHelper__factory.ts +0 -146
- package/typechain-types/factories/CurveUsdd3CrvPoolHelper__factory.ts +0 -172
- package/typechain-types/factories/ERC165Upgradeable__factory.ts +0 -58
- package/typechain-types/factories/ERC165__factory.ts +0 -39
- package/typechain-types/factories/IAccessControlUpgradeable__factory.ts +0 -202
- package/typechain-types/factories/IAccessControl__factory.ts +0 -198
- package/typechain-types/factories/IAggregationRouterHelper__factory.ts +0 -54
- package/typechain-types/factories/IERC165Upgradeable__factory.ts +0 -45
- package/typechain-types/factories/IERC165__factory.ts +0 -42
- package/typechain-types/factories/IPBulkSellerCallback__factory.ts +0 -53
- package/typechain-types/factories/IPBulkSellerFactory__factory.ts +0 -101
- package/typechain-types/factories/IPBulkSeller__factory.ts +0 -185
- package/typechain-types/factories/ITriCrvPool__factory.ts +0 -225
- package/typechain-types/factories/Initializable__factory.ts +0 -36
- package/typechain-types/factories/PendleConvex2TokensSY__factory.ts +0 -1093
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +0 -1068
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +0 -1133
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +0 -937
- package/typechain-types/factories/ReentrancyGuardUpgradeable__factory.ts +0 -43
|
@@ -4,20 +4,6 @@ pragma solidity 0.8.17;
|
|
|
4
4
|
/// Adapted from UniswapV3's Oracle
|
|
5
5
|
|
|
6
6
|
library Errors {
|
|
7
|
-
// BulkSeller
|
|
8
|
-
error BulkInsufficientSyForTrade(uint256 currentAmount, uint256 requiredAmount);
|
|
9
|
-
error BulkInsufficientTokenForTrade(uint256 currentAmount, uint256 requiredAmount);
|
|
10
|
-
error BulkInSufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
|
|
11
|
-
error BulkInSufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
|
|
12
|
-
error BulkInsufficientTokenReceived(uint256 actualBalance, uint256 requiredBalance);
|
|
13
|
-
error BulkInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
|
|
14
|
-
error BulkNotMaintainer();
|
|
15
|
-
error BulkNotAdmin();
|
|
16
|
-
error BulkSellerAlreadyExisted(address token, address SY, address bulk);
|
|
17
|
-
error BulkSellerInvalidToken(address token, address SY);
|
|
18
|
-
error BulkBadRateTokenToSy(uint256 actualRate, uint256 currentRate, uint256 eps);
|
|
19
|
-
error BulkBadRateSyToToken(uint256 actualRate, uint256 currentRate, uint256 eps);
|
|
20
|
-
|
|
21
7
|
// APPROX
|
|
22
8
|
error ApproxFail();
|
|
23
9
|
error ApproxParamsInvalid(uint256 guessMin, uint256 guessMax, uint256 eps);
|
|
@@ -45,13 +31,8 @@ library Errors {
|
|
|
45
31
|
error MarketFactoryInvalidPt();
|
|
46
32
|
error MarketFactoryMarketExists();
|
|
47
33
|
|
|
48
|
-
error
|
|
49
|
-
error
|
|
50
|
-
uint8 reserveFeePercent,
|
|
51
|
-
uint8 maxReserveFeePercent
|
|
52
|
-
);
|
|
53
|
-
error MarketFactoryZeroTreasury();
|
|
54
|
-
error MarketFactoryInitialAnchorTooLow(int256 initialAnchor, int256 minInitialAnchor);
|
|
34
|
+
error MFactoryLnFeeRateRootTooHigh(uint88 lnFeeRateRoot, uint256 maxLnFeeRateRoot);
|
|
35
|
+
error MFactoryReserveFeePercentTooHigh(uint8 reserveFeePercent, uint8 maxReserveFeePercent);
|
|
55
36
|
|
|
56
37
|
// ROUTER
|
|
57
38
|
error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
|
|
@@ -65,14 +46,11 @@ library Errors {
|
|
|
65
46
|
error RouterExceededLimitYtIn(uint256 actualYtIn, uint256 limitYtIn);
|
|
66
47
|
error RouterInsufficientSyRepay(uint256 actualSyRepay, uint256 requiredSyRepay);
|
|
67
48
|
error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
|
|
68
|
-
error RouterNotAllSyUsed(uint256 netSyDesired, uint256 netSyUsed);
|
|
69
49
|
|
|
70
50
|
error RouterTimeRangeZero();
|
|
71
51
|
error RouterCallbackNotPendleMarket(address caller);
|
|
72
52
|
error RouterInvalidAction(bytes4 selector);
|
|
73
53
|
|
|
74
|
-
error RouterKyberSwapDataZero();
|
|
75
|
-
|
|
76
54
|
// YIELD CONTRACT
|
|
77
55
|
error YCExpired();
|
|
78
56
|
error YCNotExpired();
|
|
@@ -84,10 +62,6 @@ library Errors {
|
|
|
84
62
|
// YieldFactory
|
|
85
63
|
error YCFactoryInvalidExpiry();
|
|
86
64
|
error YCFactoryYieldContractExisted();
|
|
87
|
-
error YCFactoryZeroExpiryDivisor();
|
|
88
|
-
error YCFactoryZeroTreasury();
|
|
89
|
-
error YCFactoryInterestFeeRateTooHigh(uint256 interestFeeRate, uint256 maxInterestFeeRate);
|
|
90
|
-
error YCFactoryRewardFeeRateTooHigh(uint256 newRewardFeeRate, uint256 maxRewardFeeRate);
|
|
91
65
|
|
|
92
66
|
// SY
|
|
93
67
|
error SYInvalidTokenIn(address token);
|
|
@@ -17,15 +17,6 @@ abstract contract TokenHelper {
|
|
|
17
17
|
else if (amount != 0) IERC20(token).safeTransferFrom(from, address(this), amount);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function _transferFrom(
|
|
21
|
-
IERC20 token,
|
|
22
|
-
address from,
|
|
23
|
-
address to,
|
|
24
|
-
uint256 amount
|
|
25
|
-
) internal {
|
|
26
|
-
if (amount != 0) token.safeTransferFrom(from, to, amount);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
20
|
function _transferOut(
|
|
30
21
|
address token,
|
|
31
22
|
address to,
|
|
@@ -6,12 +6,6 @@ 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
|
-
|
|
15
9
|
function get_dy(
|
|
16
10
|
int128 i,
|
|
17
11
|
int128 j,
|
|
@@ -22,31 +16,56 @@ interface ICrvPool {
|
|
|
22
16
|
int128 i,
|
|
23
17
|
int128 j,
|
|
24
18
|
uint256 dx,
|
|
25
|
-
uint256 min_dy // The amount of i being exchanged.
|
|
19
|
+
uint256 min_dy, // The amount of i being exchanged.
|
|
20
|
+
address _receiver
|
|
21
|
+
) external returns (uint256);
|
|
22
|
+
|
|
23
|
+
function add_liquidity(
|
|
24
|
+
uint256[] memory _deposit_amount,
|
|
25
|
+
uint256 _min_amount,
|
|
26
|
+
address _receiver
|
|
26
27
|
) external returns (uint256);
|
|
27
28
|
|
|
28
29
|
function add_liquidity(
|
|
29
30
|
uint256[2] memory _deposit_amount,
|
|
30
31
|
uint256 _min_amount
|
|
31
|
-
) external
|
|
32
|
+
) external;
|
|
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);
|
|
32
44
|
|
|
33
45
|
function remove_liquidity_one_coin(
|
|
34
46
|
uint256 _burn_amount,
|
|
35
47
|
int128 i,
|
|
36
48
|
uint256 _min_amount
|
|
37
|
-
) external
|
|
49
|
+
) external;
|
|
50
|
+
|
|
51
|
+
function calc_token_amount(uint256[] memory _amounts, bool _is_deposit)
|
|
52
|
+
external
|
|
53
|
+
view
|
|
54
|
+
returns (uint256);
|
|
38
55
|
|
|
39
56
|
function calc_token_amount(uint256[2] memory _amounts, bool _is_deposit)
|
|
40
57
|
external
|
|
41
58
|
view
|
|
42
59
|
returns (uint256);
|
|
43
60
|
|
|
44
|
-
function
|
|
61
|
+
function calc_token_amount(uint256[3] memory _amounts, bool _is_deposit)
|
|
45
62
|
external
|
|
46
63
|
view
|
|
47
64
|
returns (uint256);
|
|
48
65
|
|
|
49
|
-
function balances(uint256 i) external view returns (uint256);
|
|
50
66
|
|
|
51
|
-
function
|
|
67
|
+
function calc_withdraw_one_coin(uint256 _burn_amount, int128 i)
|
|
68
|
+
external
|
|
69
|
+
view
|
|
70
|
+
returns (uint256);
|
|
52
71
|
}
|
|
@@ -19,7 +19,7 @@ interface IPActionAddRemoveLiq {
|
|
|
19
19
|
address indexed market,
|
|
20
20
|
address indexed receiver,
|
|
21
21
|
address tokenIn,
|
|
22
|
-
uint256
|
|
22
|
+
uint256 tokenUsed,
|
|
23
23
|
uint256 netPtUsed,
|
|
24
24
|
uint256 netLpOut
|
|
25
25
|
);
|
|
@@ -110,7 +110,8 @@ interface IPActionAddRemoveLiq {
|
|
|
110
110
|
function addLiquidityDualTokenAndPt(
|
|
111
111
|
address receiver,
|
|
112
112
|
address market,
|
|
113
|
-
|
|
113
|
+
address tokenIn,
|
|
114
|
+
uint256 netTokenDesired,
|
|
114
115
|
uint256 netPtDesired,
|
|
115
116
|
uint256 minLpOut
|
|
116
117
|
)
|
|
@@ -158,7 +159,8 @@ interface IPActionAddRemoveLiq {
|
|
|
158
159
|
address receiver,
|
|
159
160
|
address market,
|
|
160
161
|
uint256 netLpToRemove,
|
|
161
|
-
|
|
162
|
+
address tokenOut,
|
|
163
|
+
uint256 minTokenOut,
|
|
162
164
|
uint256 minPtOut
|
|
163
165
|
) external returns (uint256 netTokenOut, uint256 netPtOut);
|
|
164
166
|
|
|
@@ -138,7 +138,6 @@ interface IPActionMintRedeem {
|
|
|
138
138
|
// key-value pair
|
|
139
139
|
address[] syAddrs;
|
|
140
140
|
address[] tokenRedeemSys;
|
|
141
|
-
address[] bulks;
|
|
142
141
|
//
|
|
143
142
|
}
|
|
144
143
|
|
|
@@ -147,7 +146,6 @@ interface IPActionMintRedeem {
|
|
|
147
146
|
address[] tokens;
|
|
148
147
|
bytes[] kybercalls;
|
|
149
148
|
//
|
|
150
|
-
address kyberRouter;
|
|
151
149
|
address outputToken;
|
|
152
150
|
uint256 minTokenOut;
|
|
153
151
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
4
|
interface IPMarketFactory {
|
|
5
|
-
event NewMarketConfig(address indexed treasury,
|
|
5
|
+
event NewMarketConfig(address indexed treasury, uint96 lnFeeRateRoot, uint8 reserveFeePercent);
|
|
6
6
|
|
|
7
7
|
event CreateNewMarket(
|
|
8
8
|
address indexed market,
|
|
@@ -11,10 +11,4 @@ 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);
|
|
20
14
|
}
|
|
@@ -43,7 +43,7 @@ interface IStandardizedYield is IERC20Metadata {
|
|
|
43
43
|
uint256 amountTokenOut
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
/// @dev check
|
|
46
|
+
/// @dev check assetInfo for more information
|
|
47
47
|
enum AssetType {
|
|
48
48
|
TOKEN,
|
|
49
49
|
LIQUIDITY
|
|
@@ -74,10 +74,9 @@ interface IStandardizedYield is IERC20Metadata {
|
|
|
74
74
|
/**
|
|
75
75
|
* @notice redeems an amount of base tokens by burning some shares
|
|
76
76
|
* @param receiver recipient address
|
|
77
|
-
* @param amountSharesToRedeem amount of shares to be burned
|
|
77
|
+
* @param amountSharesToRedeem amount of shares to be burned from (`msg.sender`)
|
|
78
78
|
* @param tokenOut address of the base token to be redeemed
|
|
79
79
|
* @param minTokenOut reverts if amount of base token redeemed is lower than this
|
|
80
|
-
* @param burnFromInternalBalance if true, burns from balance of `address(this)`, otherwise burns from `msg.sender`
|
|
81
80
|
* @return amountTokenOut amount of base tokens redeemed
|
|
82
81
|
* @dev Emits a {Redeem} event
|
|
83
82
|
*
|
|
@@ -106,7 +105,7 @@ interface IStandardizedYield is IERC20Metadata {
|
|
|
106
105
|
* @param user the user receiving their rewards
|
|
107
106
|
* @return rewardAmounts an array of reward amounts in the same order as `getRewardTokens`
|
|
108
107
|
* @dev
|
|
109
|
-
* Emits a `
|
|
108
|
+
* Emits a `ClaimRewardss` event
|
|
110
109
|
* See {getRewardTokens} for list of reward tokens
|
|
111
110
|
*/
|
|
112
111
|
function claimRewards(address user) external returns (uint256[] memory rewardAmounts);
|
|
@@ -132,14 +131,8 @@ interface IStandardizedYield is IERC20Metadata {
|
|
|
132
131
|
*/
|
|
133
132
|
function yieldToken() external view returns (address);
|
|
134
133
|
|
|
135
|
-
/**
|
|
136
|
-
* @notice returns all tokens that can mint this SY
|
|
137
|
-
*/
|
|
138
134
|
function getTokensIn() external view returns (address[] memory res);
|
|
139
135
|
|
|
140
|
-
/**
|
|
141
|
-
* @notice returns all tokens that can be redeemed by this SY
|
|
142
|
-
*/
|
|
143
136
|
function getTokensOut() external view returns (address[] memory res);
|
|
144
137
|
|
|
145
138
|
function isValidTokenIn(address token) external view returns (bool);
|
|
@@ -157,11 +150,13 @@ interface IStandardizedYield is IERC20Metadata {
|
|
|
157
150
|
returns (uint256 amountTokenOut);
|
|
158
151
|
|
|
159
152
|
/**
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
* @notice This function contains information to interpret what the asset is
|
|
154
|
+
* @notice decimals is the decimals to format asset balances
|
|
155
|
+
* @notice if asset is an ERC20 token, assetType = 0, assetAddress is the address of the token
|
|
156
|
+
* @notice if asset is liquidity of an AMM (like sqrt(k) in UniswapV2 forks), assetType = 1,
|
|
157
|
+
assetAddress is the address of the LP token
|
|
158
|
+
* @notice assetDecimals is the decimals of the asset
|
|
159
|
+
*/
|
|
165
160
|
function assetInfo()
|
|
166
161
|
external
|
|
167
162
|
view
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../interfaces/IPMarket.sol";
|
|
5
|
+
|
|
6
|
+
contract ImplicitSwapfeeContract {
|
|
7
|
+
using Math for int256;
|
|
8
|
+
using MarketMathCore for MarketState;
|
|
9
|
+
|
|
10
|
+
constructor() {}
|
|
11
|
+
|
|
12
|
+
function execute(
|
|
13
|
+
int256 K,
|
|
14
|
+
address market,
|
|
15
|
+
MarketState memory prevState,
|
|
16
|
+
int256 netPtToAccount
|
|
17
|
+
) external view returns (int256 netScyToAccount) {
|
|
18
|
+
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
19
|
+
PYIndex index = PYIndex.wrap(YT.pyIndexStored());
|
|
20
|
+
|
|
21
|
+
for (int256 i = 0; i < K; ++i) {
|
|
22
|
+
(int256 scyToAccount, ) = prevState.executeTradeCore(
|
|
23
|
+
index,
|
|
24
|
+
netPtToAccount / K,
|
|
25
|
+
block.timestamp
|
|
26
|
+
);
|
|
27
|
+
netScyToAccount += scyToAccount;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -35,6 +35,35 @@ library MarketMathStatic {
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function addLiquidityDualTokenAndPtStatic(
|
|
39
|
+
address market,
|
|
40
|
+
address tokenIn,
|
|
41
|
+
uint256 netTokenDesired,
|
|
42
|
+
uint256 netPtDesired
|
|
43
|
+
)
|
|
44
|
+
external
|
|
45
|
+
view
|
|
46
|
+
returns (
|
|
47
|
+
uint256 netLpOut,
|
|
48
|
+
uint256 netTokenUsed,
|
|
49
|
+
uint256 netPtUsed
|
|
50
|
+
)
|
|
51
|
+
{
|
|
52
|
+
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
53
|
+
|
|
54
|
+
uint256 syDesired = SY.previewDeposit(tokenIn, netTokenDesired);
|
|
55
|
+
uint256 syUsed;
|
|
56
|
+
|
|
57
|
+
MarketState memory state = IPMarket(market).readState();
|
|
58
|
+
(, netLpOut, syUsed, netPtUsed) = state.addLiquidity(
|
|
59
|
+
syDesired,
|
|
60
|
+
netPtDesired,
|
|
61
|
+
block.timestamp
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
netTokenUsed = (netTokenDesired * syUsed).rawDivUp(syDesired);
|
|
65
|
+
}
|
|
66
|
+
|
|
38
67
|
/// @dev netPtToSwap is the parameter to approx
|
|
39
68
|
function addLiquiditySinglePtStatic(
|
|
40
69
|
address market,
|
|
@@ -111,6 +140,31 @@ library MarketMathStatic {
|
|
|
111
140
|
priceImpact = calcPriceImpact(market, netPtFromSwap.Int());
|
|
112
141
|
}
|
|
113
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
|
+
|
|
114
168
|
function removeLiquidityDualSyAndPtStatic(address market, uint256 netLpToRemove)
|
|
115
169
|
external
|
|
116
170
|
view
|
|
@@ -120,6 +174,20 @@ library MarketMathStatic {
|
|
|
120
174
|
(netSyOut, netPtOut) = state.removeLiquidity(netLpToRemove);
|
|
121
175
|
}
|
|
122
176
|
|
|
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
|
+
|
|
123
191
|
/// @dev netPtFromSwap is the parameter to approx
|
|
124
192
|
function removeLiquiditySinglePtStatic(
|
|
125
193
|
address market,
|
|
@@ -175,6 +243,25 @@ library MarketMathStatic {
|
|
|
175
243
|
}
|
|
176
244
|
}
|
|
177
245
|
|
|
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
|
+
|
|
178
265
|
function swapExactPtForSyStatic(address market, uint256 exactPtIn)
|
|
179
266
|
public
|
|
180
267
|
returns (
|
|
@@ -248,6 +335,49 @@ library MarketMathStatic {
|
|
|
248
335
|
priceImpact = calcPriceImpact(market, netPtIn.neg());
|
|
249
336
|
}
|
|
250
337
|
|
|
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
|
+
|
|
251
381
|
function swapSyForExactYtStatic(address market, uint256 exactYtOut)
|
|
252
382
|
external
|
|
253
383
|
returns (
|
|
@@ -347,6 +477,49 @@ library MarketMathStatic {
|
|
|
347
477
|
priceImpact = calcPriceImpact(market, netYtIn.Int());
|
|
348
478
|
}
|
|
349
479
|
|
|
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
|
+
|
|
350
523
|
// totalPtToSwap is the param to approx
|
|
351
524
|
function swapExactPtForYt(
|
|
352
525
|
address market,
|