Skip to content

Commit

Permalink
removed market fee when selling shares back to the market
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidityDrone committed Oct 30, 2024
1 parent ffe04ef commit 2bf6ec0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MultiOutcomePredictionMarket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions test/MultiOutcomePredictionMarket.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2bf6ec0

Please sign in to comment.