Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Crypto bot borrows $200M in a flash loan to secure just $3 of profit (theblock.co)
74 points by malshe on June 14, 2023 | hide | past | favorite | 47 comments


The whole thing is atomic right? Who cares what the amount is if it's guaranteed to be paid back or the transaction doesn't go through. Profit is profit.


> The whole thing is atomic right?

Yes, by definition flash loans are atomic.

It's money borrowed and repaid within one transaction, which is atomic. One might wonder: is anything being borrowed at all?


I mean, there has to be actual capital at risk somewhere in this transaction, right? Something can’t come from nothing. Otherwise, someone could keep running this trade on repeat until they’ve accumulated an amount equal to the gross product of the universe.


> I mean, there has to be actual capital at risk somewhere in this transaction, right?

No, since all component operations to a given transaction happen atomically, there really is no counterparty risk: Either the proposing actor manages to make a profit and "pay back" the flash loan (plus interest, apparently), or the entire deal does not go through.

> Otherwise, someone could keep running this trade on repeat until they’ve accumulated an amount equal to the gross product of the universe.

No, they can keep on repeating the trade (which is usually arbitrage of some sorts) exactly until the arbitrage opportunity is gone, which usually is quite soon – unless somebody has made a serious pricing mistake somewhere.

> Something can’t come from nothing.

It (i.e. arbitrage profit) doesn't come from nothing – it comes from seeing a market inefficiency and a way to profit from it. The actor that sees it is rewarded by profit; the entire market (i.e. all of its participants) benefits from better price quality.

None of this is a crypto innovation either: This is exactly how traditional finance/payments multi-currency net settlement works.


Thanks for the detailed responses. A couple follow up questions. Or I guess two variants on the same deeply held instinct I hold, but maybe I need to expand beyond animal brain thinking?

OK, so real profits (due to a real pricing discontinuity) and no counterparty risk. Fair enough. But beyond that, in my mind it seems like there has to be some way for this trade to either blow up or that it has insane capital maintenance requirements for potential returns.


Imagine a market with three currencies/commodities: A, B, C.

One A trades for 10 B, one B trades for 10 C, but somehow one A trades for only 50 C when exchanged directly.

There's a clear arbitrage opportunity here: Sell one A for 10 B, sell the 10 B for 100 C, and finally go to the person willing to give you an A for 50 C – and buy two. You started out with one A and ended up with two. This is great! Now repeat that until the arbitrage opportunity disappears and get rich in the process.

Now here's the question/idea: If you can do these three trades atomically, why do you need a single A to being with?

This is what "flash loans" (or any equivalent system involving multilateral netting) allow.


The key being that you don't need any capital to perform the arbitrage. You just focus on finding on opportunities and aren't limited by your bank roll.

Meanwhile the lender just focuses on providing capital and is happy making a risk free loan for a fee.

And in this everyone is happy. You make money, lender makes money, and sellers and buyers get their asks.

Is that correct?


I'd say yes, except for this part:

> lender makes money,

Theoretically, there is no need for a lender.

"I borrow 1 trillion from pension funds X, do <some complex sequence of trades>, and in the end return the trillion to X, all within zero seconds" and "I perform <some complex sequence of trades>, requiring net-zero capital from my end" are equivalent statements.

Rational actors should recognize them as such, and the marginal cost of lending (interest) should converge to zero – in other words, X should concede that they do not provide anything valuable to the trade.

Practically, existing protocols might not be amenable to that insight, and the lending market is apparently too inefficient to support 0% flash loans – at least for now. So the value that X provides is protocol backwards compatibility, I suppose!


If a bank does this they can create and then delete their own money without having to pay anyone interest.


Of course there's a need for a lender, even at a microsecond transaction you do need funds to perform arbitrage, it's not just all theoretical funds - there's backing to them.

Else let's all just pretend trade on a real market until it collapses and just make sure they come a-knockin' on some non-existent firm...

Plus my conjecture, from my understanding, is the flash loan terms incentivise fast payback, whilst still retaining some fixed profit.

Akin to a credit card which has an effective 0% rate of you pay back within a certain time frame, but raises to 30% monthly after that.

I'd be happy to provide you with a flash loan at 0.001% fixed rate of profit for me/cost for you for the first 5mins and scare you with a 30% rate calculated every minute after that. For some pre-validated huge sum I know your business can be liable for, of course.

Which allows capital scarce firms to leverage these micro-loans on fast arbitrage opportunity where they should take any transaction that provides anything larger than that 0.001% in transacted profit. And let's them compete with larger firms on optimising pricing.


It’s not a microsecond, it is zero seconds. The entire series of trades either succeeds as a bundle, or does not happen at all.

This is quite different from "normal" arbitrage, which consists of a series of non-atomic trades. There’s various risks here, both on the side of the arbitrageur (offer books can change, making the trade non-profitable halfway through) and by extension for all counterparties (due to the arbitrageur not being able to settle for the promised/borrowed amount), as well as non-zero time of locking up capital. Both have a price.


Is this what MEV searchers do, they scour and analyse blockchain(s) to find what such sequences of sure-fire trades could be?


Crypto was a remarkably clever way to trick rich people into funding GPUs and legions of software devs.

But there’s real work to do now.


> Crypto was a remarkably clever way to trick rich people into funding GPUs and legions of software devs.

1) The usage of GPUs for compute is much more preferred to the ASIC-ification of certain computing workloads, as the hardware can be reused for better software / algorithms.

2) (Refer to below for personal views on effort prescriptivism.)

> But there’s real work to do now.

Heavily dislike the authoritarian-leaning connotations that anything other than "real work" is a waste of effort. People are allowed to use their time & effort to do whatever they want to do.


> People are allowed to use their time & effort to do whatever they want to do.

They are. If that's a good thing remains to be debated, given there are many urgent problems in the world to be solved.


> > People are allowed to use their time & effort to do whatever they want to do.

> They are. If that's a good thing remains to be debated, given there are many urgent problems in the world to be solved.

It is a good thing: Personal autonomy is a necessary right. When left alone, a person must be able to perform activities that they want to do.

The binary alternative is no personal autonomy, to which this conversation alone would be forbidden and we would be put to death, as it subtracts from the total efforts of "solving necessary problems". No other discrete or continuous values in between these two extremes can exist in terms of individual personal autonomy, as an atomic action can either be performed or cannot be performed by an individual, with any "half-steps" equivalent to non-performance of such an action.

Personal autonomy is necessary.


Ethereum, the chain this bot runs on, no longer has any connection to GPUs.


I have seen people who are serious about this narrative to the point that they are basically implying it was a conspiracy to bootstrap AI efforts.

That is not what happened, of course. But it's a rationalization that crypto folks would be fond of, I assume.


Ever since FTX, there’s no way that crypto is recovering in the United States. The public perception is completely ruined. It’s only a matter of time before all these services shut down.


Why is BTC/USD still $25k then?


People are still holding on with the hope that it’s going to rebound, after something that high profile it’s been tainted and it’s more associated now with scams. When the ”every day person” can’t find a use for it in their daily lives, there isn’t much value for it to grow beyond a specific subset of users, and that’s what FTX was trying to do, but ultimately failed at.


Bitcoin has way more baggage than FTX. I didn't even know they existed till they collapsed and I've been following BTC since 2014 haha.

We've been hearing these same arguments since the beginning... If nothing else Bitcoin has shown impressive sticking power, given all of its stumbles and uphill battles.


The network of belief people have in this is quite impressive even if I think they are fools.

Still though, in the grand scheme of things crypto just hasn't been around that long.

MSFT is so close to taking out its old high while crypto is all 2X away from the old highs. Over time, crypto is not going to be able to compete with stocks of cash producing businesses. Crypto fools have mostly confused commodity investing with stock investing and not understanding that the upward drift of the stock market is from the cash produced from business. Gold and silver looked like pretty genius long term holds in 1981 from being able to hold them again in 1974 but gold bugs paid an absolutely enormous opportunity cost over time.

The worst part to me for crypto fools is that because the anti-crypto people have a narrative that the price is going to zero, their false beliefs are reinforced when this doesn't happen and won't happen. The risk is not going to zero, it is the risk of trading ranges forever like gold and eating massive opportunity cost.


> People are still holding on with the hope that it’s going to rebound

How many people? How much are they holding?

Bitcoin's market cap is $485b. That's a whole lot of people and a whole lot of hope.


It's not.

BTC/USDT is still $25k though.


You don’t know that there are BTC/USD markets?


> After securing the flash loan, the bot employed it to deposit funds on Aave, a decentralized lending platform. It again borrowed a relatively small sum of $2,300 in Wrapped Ether (WETH) against the deposits, Arkham said. WETH, an ERC-20 token that can be used in smart contracts and is equivalent to Ethereum in price, was subsequently utilized to purchase Threshold Network (T) tokens on the Curve exchange.

> Upon completing the arbitrage loop, the bot sold the Threshold Network tokens on the Balancer exchange, generating a gain of 0.019 ETH,

Can someone explain this to me; it seems like all the profit came from the $2,300 worth if WETH. Why did it borrow $200M? Also how can this bot ensure all of those transactions happen within the same block?


It's a single atomic database transaction. The borrowing is for 0 second so almost virtual.

It's exactly what flashbots are meant for.

If you would ask ChatGPT to earn money trading, it definitely would do this... especially if this pattern is repeatable.


Interestingly, the interest rate charged seems to be 0.09% [1]. That's infinity percent when annualized!

Either I'm missing something, or this specific implementation isn't priced correctly/rationally – competition should drive the rate for this down to exactly zero (no risk because there is no chance of losing money; no opportunity cost because the "lending" party loses use of their capital for zero units of time).

In fact, some other blockchains/smart contracts do seem to price this capability at 0% [2].

[1] https://docs.aave.com/developers/v/2.0/guides/flash-loans

[2] https://developers.stellar.org/docs/encyclopedia/path-paymen...


Is there actually no opportunity cost? Do the funds not have to be available at the time of the transaction? They may never leave your account but they still need to be there no?


Theoretically, the funds don't need to "exist": They're a fictional quantity; a scribble in the margin of an intermediate calculation, never to be committed to any ledger.

Practically, I suppose that many smart contracts or blockchains don't see things that way and really do require the funds to be available in some account (that also consents to them being used in this way) to keep existing systems and protocols happy.

I'd still argue that the marginal interest here should be zero or very close to it, in an efficient market (due to the time being infinitely short) – so seeing quotes of 0.09% of interest for flash loans makes me suspect that there's non-negligible friction somewhere.


Nice website...

A cookie nag for no reason and then pop up for signing up that doesn't close with the "x" or "No Thanks". Man we need some form of great purge on the web to get rid of all of these awful shit websites.


Those pennies in front of that steamroller ain’t gonna pick themselves up.


Clearly the pennies couldn’t have been real or someone would have picked them up before crypto bot got to them.


Real arbitrage opportunities definitely do exist in all kinds of markets – or what do you think traditional finance HFTs do all day?

This is the same thing, just in crypto.


There are pennies, but the steamroller is not extant.


The economy makes no sense anymore. Add a fee to all financial transactions or financial transactions will eat the economy.


The fees exist. Crypto handling fees are not small. The market is so inflated that this nonsense happens regardless. Bitcoin doesn't have any more stability despite having ferocious transactions economics.


There are fees. The $3 in this case was the profit left over for the trader after all fees where paid.


crypto bot has to get its bag too, keep hustling king


Crypto bot apologies for nothing!


Seems like the financial version of hydraulic fracking.


Does the profit include the energy costs too?


Pennies add up. Money is money!


Crypto exchanges basically are giant bots, based upon massive technical investment over many years, whose purpose is to stay at the cutting-edge of manipulating billions in customer funds in such a way that their own profit is paramount.


This was a decentralized exchange. If you chose to run an open source program on your computer, you aren’t being manipulated. Hardest part about business is minding your own. Concern yourself less with what other people do with their own money.


You may have read my use of the term manipulate as cynical. In fact I meant it neutrally - that is, exchanges manipulate (or, "enable actions upon") money in the same way that computer applications manipulate data. Nothing inherently good or bad about it. Totally dependent upon the parameters.

I don't think this story "Crypto bot borrows $200M to make $3" is particularly salacious, simply because even in it's seeming extreme, it's still a fairly mundane matter of shifting figures around.

And matters of risk or custody are their own areas, for which each individual may take their own responsibility.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: