This means you can't take the highly speculative trade, you can only go for a sure thing. But if you do have a sure thing, you can borrow as much currency as the lender can provide.
[1] https://etherscan.io/tx/0xfd35e99cbbefea68874391a14ddb09a289...
What sort of situation could this be used in? I'm having a hard time truly imagining use without any risk of transaction rollback.
The markets are not currently too efficient for that, and never will be. In fact Uniswap’s entire design depends heavily on arbitrageurs balancing out the markets between itself and other exchanges.
How are the transactions composed, with a smart contract/s, in combination with Dex API’s?
Then you would have a separate program running on your client machine to scan for market opportunities, and when it spots one, have that program send a transaction to your deployed smart contract to initiate the loan and set into action whatever logic you programmed into the smart contract that will yield a profit.
Yes, it’s quite a rabbit hole indeed. It is hard to believe that something like this is even possible, let alone profitable, but it really can be. I have seen single flash loan transactions yield up to $46k in profits. That profit is irrevocably delivered back to you in a couple of seconds.
What does this mean? If I'm poor (or rich), why not borrow hundreds of millions of dollars to make some highly speculative trade? If it goes well, I win big; if it goes tits up, the lender loses big (not me).
I'm certain that's an uncharitable reading of your comment - please take it in the spirit of "this is what I'm asking you to explain to me in simpler terms," not as an argument.