diff --git a/contracts/strategies/vault/VaultShortStrategy.sol b/contracts/strategies/vault/VaultShortStrategy.sol index f0bb73a..9a3f74b 100644 --- a/contracts/strategies/vault/VaultShortStrategy.sol +++ b/contracts/strategies/vault/VaultShortStrategy.sol @@ -100,7 +100,7 @@ contract VaultShortStrategy is CPMMShortStrategy, VaultBaseStrategy, IVaultShort } // Total amount of GS LP tokens issued after protocol fees are paid assets = totalAssets(_params.BORROWED_INVARIANT, _params.LP_TOKEN_BALANCE + - convertInvariantToLP(_params.RESERVED_BORROWED_INVARIANT, _params.lastCFMMTotalSupply, _params.lastCFMMInvariant), + convertInvariantToLPRoundUp(_params.RESERVED_BORROWED_INVARIANT, _params.lastCFMMTotalSupply, _params.lastCFMMInvariant), _params.latestCfmmInvariant, _params.latestCfmmTotalSupply, lastFeeIndex); // Calculates total CFMM LP tokens, including accrued interest, using state variables @@ -116,7 +116,7 @@ contract VaultShortStrategy is CPMMShortStrategy, VaultBaseStrategy, IVaultShort function getLatestBalances(uint256 lastFeeIndex, uint256 borrowedInvariant, uint256 lpBalance, uint256 lastCFMMInvariant, uint256 lastCFMMTotalSupply) public virtual override view returns(uint256 lastLPBalance, uint256 lastBorrowedLPBalance, uint256 lastBorrowedInvariant) { lastBorrowedInvariant = _accrueBorrowedInvariant(borrowedInvariant, lastFeeIndex); - lastBorrowedLPBalance = convertInvariantToLP(lastBorrowedInvariant, lastCFMMTotalSupply, lastCFMMInvariant); + lastBorrowedLPBalance = convertInvariantToLPRoundUp(lastBorrowedInvariant, lastCFMMTotalSupply, lastCFMMInvariant); lastLPBalance = lpBalance + lastBorrowedLPBalance; } } diff --git a/package.json b/package.json index cc3d100..aedb6c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gammaswap/v1-implementations", - "version": "1.2.14", + "version": "1.2.15", "description": "Pool and strategies implementation contracts for GammaSwap V1 protocol", "homepage": "https://gammaswap.com", "scripts": { @@ -71,7 +71,7 @@ "typescript": "^4.7.4" }, "dependencies": { - "@gammaswap/v1-core": "^1.2.14", + "@gammaswap/v1-core": "^1.2.16", "@openzeppelin/contracts": "^4.7.0" } } diff --git a/yarn.lock b/yarn.lock index 2f293e8..2fcb589 100644 --- a/yarn.lock +++ b/yarn.lock @@ -449,10 +449,10 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@gammaswap/v1-core@^1.2.14": - version "1.2.14" - resolved "https://npm.pkg.github.com/download/@gammaswap/v1-core/1.2.14/a282b6841d31b06e9625f5dc3b979668febf1b5b#a282b6841d31b06e9625f5dc3b979668febf1b5b" - integrity sha512-CwsxyLQZmSPKiXWNllyaVXC+xIoX7agcWOF99l6V0gJCKfsNZfzNmiZzGzLQG46sOxa2Se1NPey4o/lOH/TNQg== +"@gammaswap/v1-core@^1.2.16": + version "1.2.16" + resolved "https://npm.pkg.github.com/download/@gammaswap/v1-core/1.2.16/c2b0db6f20caaccb7c6059a70a8e65f6cb072551#c2b0db6f20caaccb7c6059a70a8e65f6cb072551" + integrity sha512-ZnH3H7KlxRbxhjbSH199JSiPpK6j/7F6JtBoFRz+zTJP+lf8RQwwj6TmTa8dwMI1tLPeUx4zxV9W0IKCPuCesw== dependencies: "@openzeppelin/contracts" "^4.7.0"