@pendle/core-v2 0.9.2-beta → 0.9.4-beta
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/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol/PendleYearnVaultSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.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/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.json +35 -19
- package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.json +33 -17
- package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +33 -17
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.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/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.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/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.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/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +48 -9
- package/build/artifacts/contracts/periphery/PermissionsV2Upg.sol/PermissionsV2Upg.dbg.json +1 -1
- package/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol +1 -1
- package/contracts/core/PendleRouter.sol +2 -2
- package/contracts/core/actions/ActionCore.sol +18 -13
- package/contracts/core/actions/base/ActionSCYAndPTBase.sol +15 -15
- package/contracts/interfaces/IPActionCore.sol +12 -11
- package/contracts/offchain-helpers/RouterStatic.sol +17 -10
- package/deployments/43113-benqi.json +2 -2
- package/deployments/43113-core.json +1 -1
- package/deployments/43113-markets/benqi-market-95E744.json +7 -0
- package/deployments/43113-markets/benqi-market-D91a3F.json +7 -0
- package/package.json +1 -1
- package/typechain-types/ActionCore.ts +95 -84
- package/typechain-types/IPActionCore.ts +95 -84
- package/typechain-types/IPAllAction.ts +95 -84
- package/typechain-types/RouterStatic.ts +86 -31
- package/typechain-types/factories/ActionCore__factory.ts +34 -18
- package/typechain-types/factories/IPActionCore__factory.ts +33 -17
- package/typechain-types/factories/IPAllAction__factory.ts +33 -17
- package/typechain-types/factories/PendleAaveV3SCY__factory.ts +1 -1
- package/typechain-types/factories/PendleQiSAvaxSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleSJoeSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleStargateSCY__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +47 -8
|
@@ -44,32 +44,35 @@ contract ActionCore is IPActionCore, ActionSCYAndPTBase {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/// @dev refer to the internal function
|
|
47
|
-
function
|
|
47
|
+
function addLiquidityDualTokenAndPt(
|
|
48
48
|
address receiver,
|
|
49
49
|
address market,
|
|
50
|
-
|
|
50
|
+
address tokenIn,
|
|
51
|
+
uint256 tokenDesired,
|
|
51
52
|
uint256 ptDesired,
|
|
52
53
|
uint256 minLpOut
|
|
53
54
|
)
|
|
54
55
|
external
|
|
55
56
|
returns (
|
|
56
57
|
uint256 netLpOut,
|
|
57
|
-
uint256
|
|
58
|
+
uint256 tokenUsed,
|
|
58
59
|
uint256 ptUsed
|
|
59
60
|
)
|
|
60
61
|
{
|
|
61
|
-
(netLpOut,
|
|
62
|
+
(netLpOut, tokenUsed, ptUsed) = _addLiquidityDualTokenAndPt(
|
|
62
63
|
receiver,
|
|
63
64
|
market,
|
|
64
|
-
|
|
65
|
+
tokenIn,
|
|
66
|
+
tokenDesired,
|
|
65
67
|
ptDesired,
|
|
66
68
|
minLpOut
|
|
67
69
|
);
|
|
68
|
-
emit
|
|
70
|
+
emit AddLiquidityDualTokenAndPt(
|
|
69
71
|
msg.sender,
|
|
70
72
|
market,
|
|
71
73
|
receiver,
|
|
72
|
-
|
|
74
|
+
tokenIn,
|
|
75
|
+
tokenDesired,
|
|
73
76
|
ptUsed,
|
|
74
77
|
netLpOut
|
|
75
78
|
);
|
|
@@ -131,18 +134,20 @@ contract ActionCore is IPActionCore, ActionSCYAndPTBase {
|
|
|
131
134
|
}
|
|
132
135
|
|
|
133
136
|
/// @dev refer to the internal function
|
|
134
|
-
function
|
|
137
|
+
function removeLiquidityDualTokenAndPt(
|
|
135
138
|
address receiver,
|
|
136
139
|
address market,
|
|
137
140
|
uint256 lpToRemove,
|
|
138
|
-
|
|
141
|
+
address tokenOut,
|
|
142
|
+
uint256 tokenOutMin,
|
|
139
143
|
uint256 ptOutMin
|
|
140
|
-
) external returns (uint256
|
|
141
|
-
(
|
|
144
|
+
) external returns (uint256 netTokenOut, uint256 netPtOut) {
|
|
145
|
+
(netTokenOut, netPtOut) = _removeLiquidityDualTokenAndPt(
|
|
142
146
|
receiver,
|
|
143
147
|
market,
|
|
144
148
|
lpToRemove,
|
|
145
|
-
|
|
149
|
+
tokenOut,
|
|
150
|
+
tokenOutMin,
|
|
146
151
|
ptOutMin
|
|
147
152
|
);
|
|
148
153
|
emit RemoveLiquidityDualIbTokenAndPt(
|
|
@@ -151,7 +156,7 @@ contract ActionCore is IPActionCore, ActionSCYAndPTBase {
|
|
|
151
156
|
receiver,
|
|
152
157
|
lpToRemove,
|
|
153
158
|
netPtOut,
|
|
154
|
-
|
|
159
|
+
netTokenOut
|
|
155
160
|
);
|
|
156
161
|
}
|
|
157
162
|
|
|
@@ -63,25 +63,25 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
63
63
|
require(netLpOut >= minLpOut, "FS insufficient lp out");
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
function
|
|
66
|
+
function _addLiquidityDualTokenAndPt(
|
|
67
67
|
address receiver,
|
|
68
68
|
address market,
|
|
69
|
-
|
|
69
|
+
address tokenIn,
|
|
70
|
+
uint256 tokenDesired,
|
|
70
71
|
uint256 ptDesired,
|
|
71
72
|
uint256 minLpOut
|
|
72
73
|
)
|
|
73
74
|
internal
|
|
74
75
|
returns (
|
|
75
76
|
uint256 netLpOut,
|
|
76
|
-
uint256
|
|
77
|
+
uint256 tokenUsed,
|
|
77
78
|
uint256 ptUsed
|
|
78
79
|
)
|
|
79
80
|
{
|
|
80
81
|
(ISuperComposableYield SCY, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market)
|
|
81
82
|
.readTokens();
|
|
82
83
|
|
|
83
|
-
|
|
84
|
-
uint256 scyDesired = SCY.previewDeposit(ibToken, ibTokenDesired);
|
|
84
|
+
uint256 scyDesired = SCY.previewDeposit(tokenIn, tokenDesired);
|
|
85
85
|
uint256 scyUsed;
|
|
86
86
|
|
|
87
87
|
{
|
|
@@ -99,14 +99,14 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
99
99
|
|
|
100
100
|
IERC20(PT).safeTransferFrom(msg.sender, market, ptUsed);
|
|
101
101
|
|
|
102
|
-
// convert
|
|
103
|
-
|
|
102
|
+
// convert tokenIn to SCY to deposit
|
|
103
|
+
tokenUsed = (tokenDesired * scyUsed).rawDivUp(scyDesired);
|
|
104
104
|
|
|
105
|
-
IERC20(
|
|
105
|
+
IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), tokenUsed);
|
|
106
106
|
|
|
107
|
-
_safeApproveInf(
|
|
107
|
+
_safeApproveInf(tokenIn, address(SCY));
|
|
108
108
|
|
|
109
|
-
SCY.deposit(market,
|
|
109
|
+
SCY.deposit(market, tokenIn, tokenUsed, scyUsed);
|
|
110
110
|
|
|
111
111
|
netLpOut = IPMarket(market).mint(receiver);
|
|
112
112
|
// fail-safe
|
|
@@ -128,21 +128,21 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
|
|
|
128
128
|
require(netPtOut >= ptOutMin, "insufficient PT out");
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
function
|
|
131
|
+
function _removeLiquidityDualTokenAndPt(
|
|
132
132
|
address receiver,
|
|
133
133
|
address market,
|
|
134
134
|
uint256 lpToRemove,
|
|
135
|
-
|
|
135
|
+
address tokenOut,
|
|
136
|
+
uint256 tokenOutMin,
|
|
136
137
|
uint256 ptOutMin
|
|
137
|
-
) internal returns (uint256
|
|
138
|
+
) internal returns (uint256 netTokenOut, uint256 netPtOut) {
|
|
138
139
|
(ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
|
|
139
|
-
address ibToken = SCY.yieldToken();
|
|
140
140
|
|
|
141
141
|
IERC20(market).safeTransferFrom(msg.sender, market, lpToRemove);
|
|
142
142
|
|
|
143
143
|
(, netPtOut) = IPMarket(market).burn(address(SCY), receiver);
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
netTokenOut = SCY.redeemAfterTransfer(receiver, tokenOut, tokenOutMin);
|
|
146
146
|
|
|
147
147
|
require(netPtOut >= ptOutMin, "insufficient PT out");
|
|
148
148
|
}
|
|
@@ -14,11 +14,12 @@ interface IPActionCore {
|
|
|
14
14
|
uint256 lpOut
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
event
|
|
17
|
+
event AddLiquidityDualTokenAndPt(
|
|
18
18
|
address indexed caller,
|
|
19
19
|
address indexed market,
|
|
20
20
|
address indexed receiver,
|
|
21
|
-
|
|
21
|
+
address tokenIn,
|
|
22
|
+
uint256 tokenUsed,
|
|
22
23
|
uint256 ptUsed,
|
|
23
24
|
uint256 lpOut
|
|
24
25
|
);
|
|
@@ -27,7 +28,7 @@ interface IPActionCore {
|
|
|
27
28
|
address indexed caller,
|
|
28
29
|
address indexed market,
|
|
29
30
|
address receiver,
|
|
30
|
-
uint256
|
|
31
|
+
uint256 netlpIn,
|
|
31
32
|
uint256 amountPTOut,
|
|
32
33
|
uint256 amountSCYOut
|
|
33
34
|
);
|
|
@@ -124,18 +125,18 @@ interface IPActionCore {
|
|
|
124
125
|
uint256 ptUsed
|
|
125
126
|
);
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
function addLiquidityDualIbTokenAndPt(
|
|
128
|
+
function addLiquidityDualTokenAndPt(
|
|
129
129
|
address receiver,
|
|
130
130
|
address market,
|
|
131
|
-
|
|
131
|
+
address tokenIn,
|
|
132
|
+
uint256 tokenDesired,
|
|
132
133
|
uint256 ptDesired,
|
|
133
134
|
uint256 minLpOut
|
|
134
135
|
)
|
|
135
136
|
external
|
|
136
137
|
returns (
|
|
137
138
|
uint256 netLpOut,
|
|
138
|
-
uint256
|
|
139
|
+
uint256 tokenUsed,
|
|
139
140
|
uint256 ptUsed
|
|
140
141
|
);
|
|
141
142
|
|
|
@@ -171,14 +172,14 @@ interface IPActionCore {
|
|
|
171
172
|
uint256 ptOutMin
|
|
172
173
|
) external returns (uint256 netScyOut, uint256 netPtOut);
|
|
173
174
|
|
|
174
|
-
|
|
175
|
-
function removeLiquidityDualIbTokenAndPt(
|
|
175
|
+
function removeLiquidityDualTokenAndPt(
|
|
176
176
|
address receiver,
|
|
177
177
|
address market,
|
|
178
178
|
uint256 lpToRemove,
|
|
179
|
-
|
|
179
|
+
address tokenOut,
|
|
180
|
+
uint256 tokenOutMin,
|
|
180
181
|
uint256 ptOutMin
|
|
181
|
-
) external returns (uint256
|
|
182
|
+
) external returns (uint256 netTokenOut, uint256 netPtOut);
|
|
182
183
|
|
|
183
184
|
function removeLiquiditySinglePt(
|
|
184
185
|
address receiver,
|
|
@@ -160,22 +160,22 @@ contract RouterStatic is IPRouterStatic {
|
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
function
|
|
163
|
+
function addLiquidityDualTokenAndPtStatic(
|
|
164
164
|
address market,
|
|
165
|
-
|
|
165
|
+
address tokenIn,
|
|
166
|
+
uint256 tokenDesired,
|
|
166
167
|
uint256 ptDesired
|
|
167
168
|
)
|
|
168
169
|
external
|
|
169
170
|
returns (
|
|
170
171
|
uint256 netLpOut,
|
|
171
|
-
uint256
|
|
172
|
+
uint256 tokenUsed,
|
|
172
173
|
uint256 ptUsed
|
|
173
174
|
)
|
|
174
175
|
{
|
|
175
176
|
(ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
|
|
176
177
|
|
|
177
|
-
|
|
178
|
-
uint256 scyDesired = SCY.previewDeposit(ibToken, ibTokenDesired);
|
|
178
|
+
uint256 scyDesired = SCY.previewDeposit(tokenIn, tokenDesired);
|
|
179
179
|
uint256 scyUsed;
|
|
180
180
|
|
|
181
181
|
MarketState memory state = IPMarket(market).readState(false);
|
|
@@ -186,7 +186,7 @@ contract RouterStatic is IPRouterStatic {
|
|
|
186
186
|
block.timestamp
|
|
187
187
|
);
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
tokenUsed = (tokenDesired * scyUsed).rawDivUp(scyDesired);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
function addLiquiditySinglePtStatic(address market, uint256 netPtIn)
|
|
@@ -229,17 +229,24 @@ contract RouterStatic is IPRouterStatic {
|
|
|
229
229
|
function removeLiquidityDualScyAndPtStatic(address market, uint256 lpToRemove)
|
|
230
230
|
external
|
|
231
231
|
view
|
|
232
|
-
returns (uint256
|
|
232
|
+
returns (uint256 netScyOut, uint256 netPtOut)
|
|
233
233
|
{
|
|
234
|
-
|
|
234
|
+
MarketState memory state = IPMarket(market).readState(false);
|
|
235
|
+
(netScyOut, netPtOut) = state.removeLiquidity(lpToRemove);
|
|
236
|
+
}
|
|
235
237
|
|
|
236
|
-
|
|
238
|
+
function removeLiquidityDualTokenAndPtStatic(
|
|
239
|
+
address market,
|
|
240
|
+
uint256 lpToRemove,
|
|
241
|
+
address tokenOut
|
|
242
|
+
) external view returns (uint256 netTokenOut, uint256 netPtOut) {
|
|
243
|
+
(ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
|
|
237
244
|
|
|
238
245
|
uint256 netScyOut;
|
|
239
246
|
MarketState memory state = IPMarket(market).readState(false);
|
|
240
247
|
(netScyOut, netPtOut) = state.removeLiquidity(lpToRemove);
|
|
241
248
|
|
|
242
|
-
|
|
249
|
+
netTokenOut = SCY.previewRedeem(tokenOut, netScyOut);
|
|
243
250
|
}
|
|
244
251
|
|
|
245
252
|
function removeLiquiditySinglePtStatic(address market, uint256 lpToRemove)
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"QI": "0x09Fe18C4C0cFE929a6CD40903129F9bA3C837866",
|
|
4
4
|
"USD": "0x2018ecc38fbca2ce3A62f96f9F0D38F0DEE2f99D",
|
|
5
5
|
"qiUSD": "0x884f8d66862b03434E11f4Bd5527A1119c115D83",
|
|
6
|
-
"scyQiUSD": "
|
|
6
|
+
"scyQiUSD": "0xb58DAE6a0d929beE1C873C666D1958870e308a98",
|
|
7
7
|
"WAVAX": "0xD323E5337713D2e01fb341D960BC31e1FB42348d",
|
|
8
8
|
"qiAVAX": "0xABD65178Aa35051277b062327A70644F10D3cB9d",
|
|
9
|
-
"scyQiAVAX": "
|
|
9
|
+
"scyQiAVAX": "0xA58dD1b2aCa656C1A6FA281C7CAeC22eb66aE449"
|
|
10
10
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"yieldContractFactory": "0xf9397B3b93d118587c29bA2a166c0192251fc758",
|
|
9
9
|
"marketFactory": "0x2FfdD5E68ce0F668498029c1219Db39f79ebD5bd",
|
|
10
10
|
"router": "0xFEdBED4682D136925d30FFb9B8977CC9b3a6c406",
|
|
11
|
-
"routerStatic": "
|
|
11
|
+
"routerStatic": "0xfe2d379117895Fa6144B209C13894A17aB18C86c",
|
|
12
12
|
"startTime": 1657756800,
|
|
13
13
|
"vePendle": "0xa94936409d9B0633dB6271Fc2789aBa9C74bD729",
|
|
14
14
|
"votingController": "0x676A97883D396b21f3a7554A73F30187752c7C45",
|