3 ms·
At a high level, "flash loans" work by being acquired and repayed atomically. For example, this is useful for arbitrageurs
by hcks 4y ago
At a high level, "flash loans" work by being acquired and repayed atomically. For example, this is useful for arbitrageurs
- diogenescynic 4y agoWhat does atomically mean in this context? Automatically? Can't tell if that's a typo or not.
- almostkorean 4y agoI think automatically is not the best term here. I'm not an expert, but there are borrowing and lending protocols that let you borrow a large amount of their token pool as long as it is paid back within the same block (plus some fee). So you can write a script to run a transaction that: 1. borrows a large amount of money 2. use the large amount of money to do arbitrage 3. pays back the large amount of money plus any fees 4. keep profits and it does so "atomically", so if you can't repay the loan then the transaction fails and the whole thing never happened. or you could lose money if the transaction is successful but the trade is not profitable. like I said, I'm not an expert so someone correct me if I'm wrong
- tromp 4y agoIt means the tx consists of 1. take out huge loan 2. do a bunch of things with huge loan and exhaust gas fees if any of them have don't have desired effect 3. replay loan The only way miners can include the tx with the loan taken out, is if all the things the attacker does in step 2 do have the desired effect. Otherwise the attacker pays the gas fees of a failed tx.
- c22 4y agoAn atomic operation is one where multiple actions occur "simultaneously", or, rather, where none of the actions occur if any one of them fails. There should be no risk in offering an "atomic" loan because the loan will be disbursed and repaid in a single "step".