Gonna end the $APE content with 1 final thread. Let's dive into how this absolute fucking chad borrowed 5 bored apes, claimed $APE for all of them, returned the apes, and subsequently netted ~600k.
A story of how a bot looked for value where no one else did.
First we have to understand what flash loans are.
Flash loans are a DeFi concept that allow a contract to borrow large sums of money as long as the loan gets paid back within 1 txn.
If the loan isn't paid back in 1 txn, everything is reverted (as if nothing happened).
"How" this all happens in 1 txn is beyond the scope of this thread.
Typically flash loans are used for arbitrage, front running, etc. Here's an example of how you would use a flash loan if you detected an arbitrage opportunity.
Second, we have to understand what NFTX is. I personally haven't used NFTX but "NFTX is a platform for creating liquid markets for illiquid Non-Fungible Tokens (NFTs)".
Essentially its a protocol where you can lock up your NFT in a vault and receive liquid ERC20 tokens back.
For example, you can lock up your BAYC (erc721) in a vault and get 1 vBAYC token (erc20) back. You can redeem an ape from the vault by giving back your vBAYC.
Why does this protocol exist? Out of scope again but essentially gives liquidity (erc20) to non liquid assets (erc721)
So now knowing all this, let's dive into the bot txn.
First, bored ape #1060 was transferred to the bot contract. This ape wasn't borrowed but actually bought from OS. We'll see why the bot bought an ape later in this thread.
(English is hard... "bought" "bot" lmao)
Next, the bot gets a flash loan of 5.2 vBAYC tokens from the NFTX vault.
Next, the bot swaps out its vBAYC tokens for 5 actual apes (5 apes have been transferred to the bot).
Notice the first ape doesnt come from the NFTX vault (since thats the ape the bot actually bought). So by this point, the bot has 6 apes in its possession.
Next, the bot calls to the $APE airdrop contract and claims all the $APE for all 6 apes. Netting ~$600K.
Finally, the bot transfers the apes back to the NFTX vault to redeem back vBAYC tokens to repay the loan.
So why did the bot need to buy its own bored ape?
It's because flash loans have a fee attached to them. Whenever you get a flash loan, you must pay a fee in addition to the original loan.
So the bot swapped its own bored ape (#1060) for vBAYC to pay off the flash loan fee.
The funny thing is, the fee only took a portion of the vBAYC tokens the bot redeemed for its own ape.
Since the bot has no need for extra vBAYC tokens, it just swapped its remaining vBAYC for 14 ETH.
What I find beautiful is that I assume this bot didn't have much competition for this strategy (I may be wrong on this).
MEV is super competitive, it's extremely hard to write a profitable MEV bot to arbitrage/frontrun because so many big brains are in the space (bot vs bot).
However, if you just look at extracting value in a place that no one else is looking at, you win.
Quoting @bertcmiller "If you're thinking about these things or looking for them, which not many ppl are, there's a lot of value to be captured".
The cherry on top is that boy genius @_anishagnihotri wrote this EXACT same strategy that borrowed punks from NFTX to mint Meebits last year.
The sad thing about this whole story is that I read Anish's strategy, thought it was really clever, and completely forgot about it lmao.
Guess Im ngmi in MEV... not big brain enough.
Just because I KNOW Im gonna get a question about this. "Is this ethical and is ethereum doomed".
Whether it's ethical is up for you to decide, but this is an open and permission-less system which not only creates these adversarial environments, but also leads to innovation.
If you really wanted to, there are 1000s of resources online and you can participate it MEV right now - everything is open source. Try asking a hedge fund to let you in on their front running secrets :)
Idk about you but, web3 is the most exciting space in the world.
Whether you find anything ethical or not is your opinion, but I can't think of any other industry where so many big brains are playing in an open field for anyone to spectate or join.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
During dev con, I worked with @real_philogy and @yush_g to create what we think is a true blind vickery auction, fully on-chain.
This implementation is just a proof of concept but we think it could be a powerful primitive going forward for all auctions in the future.
Before we dive in, major props to @real_philogy and @yush_g for coming up with the initial approach and mechanic. Shoot em a follow, they're working on some real cool stuff.
First, what is a blind vickery auction and why is it better than the current auctions you see on Opensea or Nouns?
The problem with current 'non-blind' auctions is that all bids are public and this causes suboptimal price discovery.
There's still some money to be made during the bear, so here's some bear market alpha.
Not sure if we'd even consider this long tail MEV but here's what @rauchp_@wawrencelu and me have been doing to earn ~$700 a day *relatively* risk free and automated (since sept 28).
$700/day ain't a lot but considering the amount of work needed (only needed 2 simple boys), pretty worth. Take what you can get, just bear market tings 🤷♂️
This number will go down over the weeks but here's a tldr of it, similar opportunities will probs pop up every now and then.
We had no business looking at NEAR but @wawrencelu suggested we take a look to see if anything cool was happening.
We found a liquidity incentive program on @tonicdex. They were having a 50k USN (NEAR's stablecoin) incentive program for market makers on the USN/USDC pair.
Just looked at the @WZRDSxyz contract and yep, they can definitely arbitrarily burn your NFT. It doesn't matter whether it's listed for sale or not, they can burn it (without paying you if it's listed).
They can also arbitrarily transfer your NFT to whoever as well.
Here's how:
Typically, when you try to transfer an NFT or a contract tries to transfer your NFT on your behalf, the NFT contract checks whether you're the owner of the token or if you gave explicit approval/permission to the contract trying to transfer your token.
This is why opensea asks you to send an approval transaction when you try to sell an NFT from a collection the first time. You're literally giving opensea permission to transfer your token to anyone if there is a sale.
I get like 5-10 DMs a day asking about how to get better at solidity (some even ask if Im taking interns lol).
While this may be rudimentary and somewhat "obvious" knowledge, I'll try to explain the concept that really helped me "get it" when I first started learning.
When you interact with Ethereum, a majority of the time you're transferring some sort of token from your own wallet to another.
It's common to think "transferring a token" is an actual action of sending something to someone. ie the token is actually getting "sent".
However, it's much more simple than that.
There isn't actually "3 tokens" in your wallet, it's just a number (your balance) that represent how many tokens you should have.
So when you're 'sending' a token, it's just a simple increment/decrement of the 2 wallet balances.