Skip to content

Commit

Permalink
Merge pull request #29 from jorgejch/develop
Browse files Browse the repository at this point in the history
Minor adjustments
  • Loading branch information
jorgejch authored Dec 15, 2024
2 parents 6529012 + abdc5c4 commit d477eae
Show file tree
Hide file tree
Showing 5 changed files with 334 additions and 135 deletions.
11 changes: 9 additions & 2 deletions contracts/UniswapV3Arbitrage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,21 @@ contract UniswapV3Arbitrage is FlashLoanSimpleReceiverBase, Ownable2Step {
);
int256 profit = int256(swap3AmountOut) -
int256(amountOwned + decoded.extraCost);

emit ArbitrageConcluded(
_executionCounter,
amount,
swap3AmountOut,
profit
);
require(profit > 0, string(abi.encodePacked("not profitable:", Strings.toString(uint256(profit)))));
require(
profit > 0,
string(
abi.encodePacked(
"not profitable by: ",
Strings.toString(uint256(-profit))
)
)
);
IERC20(asset).approve(_poolAddress, amountOwned);
return true;
}
Expand Down
76 changes: 0 additions & 76 deletions contracts/tests/test_UniswapV3Arbitrage.sol

This file was deleted.

Loading

0 comments on commit d477eae

Please sign in to comment.