I will make an attempt at explaining. Please ask all the questions that you need, so we can find a good way to explain this to the community.
A single transaction can include execution of multiple smart contract functions. When a transaction is included in a block, a node runs all of the transactions in that block. This happens very quickly.
When you talk about the time taken to transfer funds, the time taken is mostly the time to include your transaction in a block (plus waiting a number of confirmations), whilst the time to actually do the transaction is relatively tiny. During network congestion, depending on the gas price you set, it might be several blocks (or longer) before your transaction is included.
Basically, I was confused because when I called my flash loan arbitrage function, it instantly told me that it was not going to be profitable (and thereby allowed me to avoid approving the call and paying for the gas). This meant that it somehow INSTANTLY went through the motions of calling the loan, getting the money, swapping on uniswap and then swapping that new token on Kyber and then evaluating whether any profit was made.
The SPEED of this seemed illogical and impossible, because I was comparing it to the simple action of sending tokens to another person or doing just ONE swap on uniswap, and how that alone can take minutes.
But this was an incorrect comparison on my part, because the truth is that sending tokens to someone else or swapping on uniswap ACTUALLY DOES happen instantaneously. What takes long is HAVING THE ACTION APPROVED AND FINALIZED ON THE BLOCKCHAIN.
So it is true that my flash loan contract instantly takes all the steps I laid out for it when I call the function and can immediately report on the result.
I was following your bug discussion from the beginning hoping to see where you resolved it and what you did since I'm having the same issue with my flash function.
Now I see you resolved it. But please can you reply me with what you did to resolve it?
Did you send your contract some ETH to be used as gas fee?
I'm having the same problem. I also can't see why I need to send my contract some ETH for gas fee. Maybe I'm missing something too.
Just like you, the function I call to initiate the whole process is not getting to the callback function for the arbitrage to be executed.
I'm not getting the loan. So the loan contract is not calling the callback function to profit on an arbitrage and payback the loan.
I am not sure why you want to transfer some ETH to your flashloan contract, generally speaking, it is the caller account which will call the flashloan contract rather than flashloan contract should has some ETH as the gas fee, and as for your flashloan contract, when it executes a flash loan, you need to repay money back with some fee, that is, if you use flashloan to get 100 DAI, when you repay money back, it needs 101 DAI, so you flashloan contract need flashloan fee rather than gas fee.
Hi,
I am trying to run flashloan arbitrage on Furucombo but i dont have money to pay huge gas fees...so while searching on google I found your support team talking about "you just have to pay the transaction fee 0.009 & gas fees will be automatically debited from the contract "Hassan Isa" from support team .
So can you please help me to bypass the gas fees or get paid automatically from profit or which protocol I have to use?