From nothing, $360,000 has gone into the pocket of someone in seven steps.
One, get out a flashloan for 10,000 eth (worth about $3 million) from trading platform DyDx.
Send half to Compound and half to bZx. With the Compound half borrow 112 WBTC. With the bZx half, short 112 WBTC. Now send this Compound 112 WBTC to Uniswap to lower price. Profit from the short and finally pay back that 10,000 eth loan.
Easy right? Except you have to do all of this in a single transaction because that’s how flash loans work:
This entire operation cost the hacker just $8.71 in transaction fees and it was possible only because of this new invention of flash loans.
We’re still trying to wrap our head around what flash loans are, but basically you can borrow an asset without putting down any collateral, so for free, but only if you pay it back in the same transaction.
You basically code a smart contract that tells the ethereum network you’re going to send the borrowed eth to one exchange to buy at a lower price and sell at a higher price on another exchange and since the exchanges are open source and the network knows everything they figure out whether what you say is true or not, and so you can flash borrow.
This flashloan thing sounds incredible because it is an actual loan without requiring credit etc, but a loan for a few seconds with the lender certain they’ll be paid back because of the contract conditions as the transaction just doesn’t happen, reverts, if the loans is not paid back.
That this can be done is a bit wow even if in this case it was used for that old trick of half long and half short because with this invention it is truly a meritocracy where even a very poor kid can take advantage of arbitrage opportunities without needing any upfront funds.