From 2bf6ec05e91abe04115d7fcec0742b3e16a16ba8 Mon Sep 17 00:00:00 2001 From: SolidityDrone Date: Wed, 30 Oct 2024 18:39:07 +0100 Subject: [PATCH] removed market fee when selling shares back to the market --- src/MultiOutcomePredictionMarket.sol | 8 ++++---- test/MultiOutcomePredictionMarket.t.sol | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/MultiOutcomePredictionMarket.sol b/src/MultiOutcomePredictionMarket.sol index ef59451..b5db0d4 100644 --- a/src/MultiOutcomePredictionMarket.sol +++ b/src/MultiOutcomePredictionMarket.sol @@ -168,12 +168,12 @@ contract MultiOutcomePredictionMarket is IMultiOutcomePredictionMarket { uint sellReturn = calculateSellReturn(marketId, optionId, quantity); market.options[optionId].shares -= quantity; - uint sellReturnAfterFees = (sellReturn * 90 / 100); + - userVolume[msg.sender] -= sellReturnAfterFees; - market.prizePool -= sellReturnAfterFees; + userVolume[msg.sender] -= sellReturn; + market.prizePool -= sellReturn; - IERC20(USDC_BASE_SEPOLIA).transfer(msg.sender, sellReturnAfterFees); + IERC20(USDC_BASE_SEPOLIA).transfer(msg.sender, sellReturn); _updateMarketPrices(marketId); } diff --git a/test/MultiOutcomePredictionMarket.t.sol b/test/MultiOutcomePredictionMarket.t.sol index 8f2caf5..20dd207 100644 --- a/test/MultiOutcomePredictionMarket.t.sol +++ b/test/MultiOutcomePredictionMarket.t.sol @@ -127,6 +127,8 @@ contract MultiOutcomePredictionMarketTest is Test { uint256 rewardForNextShare = predictionMarket.calculateSellReturn(1, 0, 1); predictionMarket.sell(1,0,1); + assertEq(rewardForNextShare, 125000); + } function testOptionMarketResolutoin() public {