Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualMachineError: revert: Arbitrage not profitable #3

Closed
voltaxvoltax opened this issue May 12, 2022 · 4 comments
Closed

VirtualMachineError: revert: Arbitrage not profitable #3

voltaxvoltax opened this issue May 12, 2022 · 4 comments

Comments

@voltaxvoltax
Copy link

Hi!

I'm having the following error:

Transaction sent: 0x1c1d48dec4082b1f46b5a7b88adf3fac9105229389df25cb9f521d36217c27c3
Gas price: 0.0 gwei Gas limit: 12000000 Nonce: 6
SimpleArbitrage.makeArbitrage confirmed (Arbitrage not profitable) Block: 14762600 Gas used: 44416 (0.37%)

File "brownie/_cli/run.py", line 50, in main
args[""], method_name=args[""] or "main", _include_frame=True
File "brownie/project/scripts.py", line 103, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/arbitrage.py", line 37, in main
arbitrage_tx = arbitrage.makeArbitrage({"from": account})
File "brownie/network/contract.py", line 1693, in call
return self.transact(*args)
File "brownie/network/contract.py", line 1577, in transact
allow_revert=tx["allow_revert"],
File "brownie/network/account.py", line 680, in transfer
receipt._raise_if_reverted(exc)
File "brownie/network/transaction.py", line 421, in _raise_if_reverted
source=source, revert_msg=self._revert_msg, dev_revert_msg=self._dev_revert_msg
VirtualMachineError: revert: Arbitrage not profitable
Trace step -1, program counter 689:
File "contracts/SimpleArbitrage.sol", line 38, in SimpleArbitrage.withdraw:
}

    modifier onlyOwner() {
        require(msg.sender == owner, "only owner can call this");
        _;
    }

Terminating local RPC client...

The only thing that I haven't done, it's having WETH in my wallet, could be that?

@kaymen99
Copy link
Owner

No the contract reverts with "Arbitrage not profitable" which means that the current difference in price between the 2 exchanges is less than the transaction fee So the smart contract does not excute the arbitrage

@voltaxvoltax
Copy link
Author

Ah! Ok, need to look better at the code so I can put it running in a loop.
Good work you made here, thanks!

@christianduncan
Copy link

@aymen1001 what percentage of the time will an arbitrage opportunity actually be available? seems like with eth on these two exchanges it will always revert with "Arbitrage not profitable"

@kaymen99
Copy link
Owner

kaymen99 commented Jun 11, 2022 via email

@kaymen99 kaymen99 closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants