Skip to content

Commit d48f42a

Browse files
committed
convert invariant to LP tokens in BaseBorroStrategy
1 parent 47aac2b commit d48f42a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

contracts/strategies/base/BaseBorrowStrategy.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ abstract contract BaseBorrowStrategy is BaseLongStrategy {
130130
uint256 lpInvariant = convertLPToInvariant(lpTokenBalance, lastCFMMInvariant, lastCFMMTotalSupply);
131131
s.LP_INVARIANT = uint128(lpInvariant);
132132

133-
// Add CFMM LP tokens borrowed (principal) plus origination fee to pool's total CFMM LP tokens borrowed including accrued interest
134-
s.LP_TOKEN_BORROWED_PLUS_INTEREST = s.LP_TOKEN_BORROWED_PLUS_INTEREST + lpTokens + lpTokenOrigFee;
133+
// convert borrowedInvariant including origination fee and accrued interest to CFMM LP tokens
134+
s.LP_TOKEN_BORROWED_PLUS_INTEREST = convertInvariantToLPRoundUp(borrowedInvariant, lastCFMMTotalSupply, lastCFMMInvariant);
135135

136136
liquidity = liquidity + liquidityBorrowed;
137137
if(liquidity < initLiquidity) revert MinBorrow();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gammaswap/v1-core",
3-
"version": "1.2.15",
3+
"version": "1.2.16",
44
"description": "Core smart contracts for the GammaSwap V1 protocol",
55
"homepage": "https://gammaswap.com",
66
"scripts": {

0 commit comments

Comments
 (0)