WhaleSwap
Published in

WhaleSwap

Flash Minting for Dummies

Let’s talk about flash minting, the concept of a flash-mintable token was first invented by Austin Williams in 2019. The DeFi community always loved the idea but there was never any real push for adoption, so despite an official Ethereum EIP and a few contracts (WETH10, MakerDAO) there was never any traction.

Today I am here to talk about flash-mintable tokens, why they matter and what the team over at Whale Loans is doing to create a vendor agnostic implementation for arbitrary tokens with actual adoption.

What Is Flash Minting?

Do you ever wish you had infinite money? Sure you do! 💸 Flash-minting is the concept of being able to mint new tokens from nothing, as long as you give them back in the same transaction. This requires a flash-mintable token which allows you to create an infinite number of tokens (well, up to 115792089237316195423570985008687907853269984665640564039457584007913129639935).

Imagine you want 1,000,000 DAI to perform arbitrage but you’re not a millionaire. You could use fDAI (flash-mintable DAI) to create a million dollars worth of DAI with zero collateral, perform the arbitrage, immediately pay back the million you borrowed and pocket the profit.

What Is A Flash-Mintable Token?

A flash-mintable token is a wrapper on an ERC20 token. These tokens are backed by the real token 1:1, so anyone can safely accept it knowing they have real value. The key here is that they only need to be backed at the end of a transaction, so you can hold the token if it’s backed or mint as many as you want as long as they are paid back.

Furthermore there is no liquidity pools, nobody to borrow tokens from, nobody there but you for that one transaction.

Why Is Adoption So Slow?

One of the key setbacks to adoption of flash-mintable tokens is ironically the decentralization of them. If there’s a floating fDAI token, why would a protocol adopt it? Why not create your own? But if everyone is using a different instance of fDAI, they can’t work together!

To solve this, we have created a flash-mintable token factory. It simplifies deployment and ensures there is only ever one version deployed for each token. It also provides extra functionality like look-ups, so if you ever wonder what the address of fDAI is, you can just look it up by passing the DAI address to the contract.

The other and possibly the biggest setback is the actual integration with platforms. WETH10 is already a full-fledged flash-mintable token but nobody accepts it, so it’s useless. If a DEX was to accept flash-mintable tokens suddenly it would open up a world of possibilities, you could do triangle arbitrage without ever touching the underlying token, or you can even do normal arbitrage, since one DEX supports the fToken, it is possible to borrow it, do the first swap for the strategy on that DEX for the underlying and continue to do any other interactions with the underlying token elsewhere. The beauty of it is that only one side needs to support flash-mintable tokens.

With this in mind we decided to go all out. Even with our fancy factory if nobody adopts it there’s no use cases, so we decided to enable as many use cases as possible. The key to this is WhaleSwap, which is a state of the art DEX (and more) we’re creating with native flash-mintable token integration.

I’m here to talk about flash minting, not our products, so I’ll just leave you with a couple of strategies it enables off the top of my head:

  • Triangle Arbitrage ✅
  • Cross-DEX Arbitrage ✅
  • Collateral Swapping ✅
  • Liquidation Strategies ✅
  • Leverage Strategies ✅
  • Much more ✅✅✅

Is This Different To Flash Loans?

Yes, but no.

The key difference between flash-mints and flash-loans is the lack of liquidity pool. A flash loan borrows tokens from a liquidity pool while a flash mint creates new tokens. Both let you get tokens without collateral as long as you pay it back in the same transaction, flash-mints are just a more efficient version.

Why Would I Use This Over Flash Loans?

Flash minting has several key benefits over flash loans.

Infinite Capital
This might be the most obvious benefit, but flash loans are limited by the liquidity available while flash mints are effectively infinite. You can borrow as much of any coin as you want, enabling strategies that were once considered impossible.

Capital Efficiency
The lack of liquidity required for a flash-mint creates an infinitely higher capital efficiency, no need for any tokens sitting idle until someone is ready to borrow! Of course idle money doesn’t really hurt anyone, but you can’t get hacked if you don’t have liquidity 🤔

Low Fees
A lack of liquidity pools also means there’s nobody you need to pay a fee to. This means flash-minting can have a close to zero fee, making markets more efficient by enabling tighter trading strategies.

Lower Gas
Changing balances on the blockchain costs money. Every change means a higher gas cost and since the supply of flash-mintable tokens doesn’t pull from a pool the balance is always zero, saving a load on gas costs. Every cent is critical when trying to execute fast transactions in DeFi.

Why Integrate Flash-Minting With Your Protocol?

Since flash mints are a drop-in replacement for flash loans that is more attractive for traders, it makes sense that you could capture the entire flash loan volume with your product. Now, let’s do some math.

In 2021 there was nearly $4 billion of flash-loans through Aave with stablecoins alone. If you charge a measly 0.1% fee and can capture 1% of that market, you will rake in $4,000,000 and there’s no reason you wouldn’t capture much more!

If you have any questions or want to talk to us about integrating flash-minting with your product, head over to our Discord and hit me up!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store