Basically I am wondering how does it know when the loan is not paid back. I understand this is easy to check but how can it revert the transaction?
For example let's say I borrow 1M USDT, and then I will swap this to ETH on uniswap and then back to USDT on sushiswap for example. In the end I end up 10K USDT short, so then the transaction will revert, right?
But that means my trades on uniswap and sushiswap will revert back as well?
Because without executing my swaps how can it prove that I won't be able to pay it back? There are many factors that can affect this such as someone else doing arbitrage before me where I wouldn't have the same profit anymore, so how can it verify these without executing any transactions.
This is really confusing me.