If you've been following DeFi or Ethereum over the past few months, you've likely heard the term "flash loan" mentioned again and again.

This new DeFi primitive has been at the core of a number of economic exploits and arbitrages.

A thread on the basics of flash loans - 👇

Most DeFi loans take place across days, weeks, or even months.

You can deposit Ethereum into Aave, then withdraw stablecoins for yield farming in Yearn, for instance.

On-chain loans have garnered much traction, with total debt outstanding moving toward $2.5 billion.
While popular, DeFi loans are not capital efficient: to account for custodial risk and volatility risk, you need to put up 130-150% of the value of your loan in collateral.

If your collateral slips below the threshold, you're liquidated, resulting in a fee anywhere from 5-13%.
Flash loans are much different than longer-term DeFi loans.

Flash loans are non-custodial, take place over the course of one block, and require no collateralization.

That's to say, the coins you borrow never appear in your wallet.
When taking a flash loan, you can direct the coins to any protocol and function, as long as you pay back the loan + interest fee within the same transaction.

So what the hell? What are flash loans used for?

More often than not, arbitrage.
This means that if you spot mispriced markets between AMMs or dexs, you can take a flash loan to arbitrage the pools.

Here's a simple example I spotted in the mempool a few months back:

https://t.co/hiBHuTerQH

More on what's happening in the next tweet.
- This user flash borrowed 2,048,000 USDC from dYdX

- Traded that USDC for 2,028,367 DAI in Curve's Y pool

- Traded that DAI for 2,064,182 USDC in Curve's sUSD pool

- Paid dYdX back + 2 wei

All in one block...

Profit: 16,182 USDC
Cost: $60 in gas

Crazy, right?
The transaction I mentioned is just one of many simple arbitrages between different AMMs and diff pools. (More on AMMs in the linked thread.)

There are also advanced arb strategies that enabled the "attacks" on Eminence, Harvest, etc.

Let's take a look.

https://t.co/wftj1YuPtG
Many of these arbs are not AMM based. Instead, these arbs are accomplished by leveraging some faulty or buggy logic in the economic design of a protocol.
Eminence:

- Borrow 15 million DAI from Uniswap
- Mint EMN
- Burn some EMN for eToken, driving up EMN up the curve
- Sell remaining EMN for DAI
- Make millions

The bug was the bonding curve was steep and could be manipulated.

https://t.co/fP3ae4oDXQ
Harvest:

The bug was that Harvest didn't use the get_virtual_price() function from Curve, allowing for manipulation.
Flash loans can also be used for other purposes.

Governance attacks are a good example. They're scary but still kind of sick, to be honest.

On October 26th, a user used flash loans to influence a MakerDAO proposal.

https://t.co/naqLqOi1bS
This user completed multiple complex functions with a single tx, within a single block.

They

- borrowed $20m worth of WETH from dYdX
- deposited it on Aave to borrow $7m worth of MKR
- Locked MKR in governance
- Voted on a proposal
- Unlocked MKR
- Sent MKR, then ETH back
Related to flash loans, developers are working on flash mints for Wrapped Ethereum and DAI. Will do another thread on these later.

Flash loans will be similar in concept to flash mints but will involve the minting, then burning of tokens rapidly to accomplish some feat.
To conclude: Flash loans are an extremely powerful DeFi primitive.

I forgot who said it but they're going to accelerate the wheat from the chaff when it comes to protocols with good economic design.

I'm excited (and scared) to see what flash loans are used for next.

More from Crypto

You are running out of time to get ahead in cryptocurrency.

You know what's coming:

🔺️ Regulation
🔺️ More shutdowns
🔺️ Banks deciding who gets to do business

It's time you got your own crypto wallet.

Don't know how? I'll show you.

/////THREAD\\\\\

METAMASK

What's metamask? It's a wallet. That you -- I mean YOU -- own.

You see, when you buy crypto through an exchange like CoinBase, you own it but only kind of.

If they get

🔺 Hacked
🔺 Shutdown
🔺 Servers crash

-- your money is STUCK.

We are gonna avoid that 👇


First thing,

Go to

https://t.co/JXAp9o5RzJ

You can download it on your computer. It's a browser extension.

Alternatively, go to the app store on your Android or iPhone. It's there too.

As part of the setup process, you will choose a password.

More importantly though...

SEED PHRASE

As you follow the setup process, you will be given a 12-word seed phrase.

WRITE. THIS. DOWN.

Take it down and guard it like the map to Davey Jones' Locker.

THESE ARE THE ONLY WAY TO RECOVER YOUR ACCOUNT.

DO NOT LOSE.

We good? Great.

Let's continue.


Once you're all setup, your MetaMask wallet is going to look something like the picture below.

See where it says Crypto Address? That's where your actual address will be.

It'll be a random arrangement of letters, numbers, etc.

Click on it to copy to your clipboard

NEXT STEP
Out of curiosity I dug into how NFT's actually reference the media you're "buying" and my eyebrows are now orbiting the moon

Short version:

The NFT token you bought either points to a URL on the internet, or an IPFS hash. In most circumstances it references an IPFS gateway on the internet run by the startup you bought the NFT from.

Oh, and that URL is not the media. That URL is a JSON metadata file

Here's an example. This artwork is by Beeple and sold via Nifty:

https://t.co/TlJKH8kAew

The NFT token is for this JSON file hosted directly on Nifty's servers:

https://t.co/GQUaCnObvX


THAT file refers to the actual media you just "bought". Which in this case is hosted via a @cloudinary CDN, served by Nifty's servers again.

So if Nifty goes bust, your token is now worthless. It refers to nothing. This can't be changed.

"But you said some use IPFS!"

Let's look at the $65m Beeple, sold by Christies. Fancy.

https://t.co/1G9nCAdetk

That NFT token refers directly to an IPFS hash (https://t.co/QUdtdgtssH). We can take that IPFS hash and fetch the JSON metadata using a public gateway:

https://t.co/CoML7psBhF

You May Also Like

कुंडली में 12 भाव होते हैं। कैसे ज्योतिष द्वारा रोग के आंकलन करते समय कुंडली के विभिन्न भावों से गणना करते हैं आज इस पर चर्चा करेंगे।
कुण्डली को कालपुरुष की संज्ञा देकर इसमें शरीर के अंगों को स्थापित कर उनसे रोग, रोगेश, रोग को बढ़ाने घटाने वाले ग्रह


रोग की स्थिति में उत्प्रेरक का कार्य करने वाले ग्रह, आयुर्वेदिक/ऐलोपैथी/होमियोपैथी में से कौन कारगर होगा इसका आँकलन, रक्त विकार, रक्त और आपरेशन की स्थिति, कौन सा आंतरिक या बाहरी अंग प्रभावित होगा इत्यादि गणना करने में कुंडली का प्रयोग किया जाता है।


मेडिकल ज्योतिष में आज के समय में Dr. K. S. Charak का नाम निर्विवाद रूप से प्रथम स्थान रखता है। उनकी लिखी कई पुस्तकें आज इस क्षेत्र में नए ज्योतिषों का मार्गदर्शन कर रही हैं।
प्रथम भाव -
इस भाव से हम व्यक्ति की रोगप्रतिरोधक क्षमता, सिर, मष्तिस्क का विचार करते हैं।


द्वितीय भाव-
दाहिना नेत्र, मुख, वाणी, नाक, गर्दन व गले के ऊपरी भाग का विचार होता है।
तृतीय भाव-
अस्थि, गला,कान, हाथ, कंधे व छाती के आंतरिक अंगों का शुरुआती भाग इत्यादि।

चतुर्थ भाव- छाती व इसके आंतरिक अंग, जातक की मानसिक स्थिति/प्रकृति, स्तन आदि की गणना की जाती है


पंचम भाव-
जातक की बुद्धि व उसकी तीव्रता,पीठ, पसलियां,पेट, हृदय की स्थिति आंकलन में प्रयोग होता है।

षष्ठ भाव-
रोग भाव कहा जाता है। कुंडली मे इसके तत्कालिक भाव स्वामी, कालपुरुष कुंडली के स्वामी, दृष्टि संबंध, रोगेश की स्थिति, रोगेश के नक्षत्र औऱ रोगेश व भाव की डिग्री इत्यादि।