Inspiration

There's not that much out there on MEV and arbitrage, especially in regards to NFTs. This is a really simple example of a modern bot works and what a long tail opportunity looks like.

It can also be very expensive to try and do something like this on Ethereum. Just deploying a contract like this can cost 100-200 dollars depending on network activity. For an opportunity like this that rarely occurs, a public contract might be a better idea even for someone with experience. I have seen situations in the wild where bots will use a public contract that charges a small fee over making one themselves.

What it does

DotDotDots is an NFT collection that has a weird gimmick where the max supply of the NFT is linked to the price of Ether. Every time Ether reaches a new all time high, more DotDotDots will be able to be minted up to a maximum of 10,000 total supply. It costs 0.05 ETH to mint a new DotDotDot, but they can be sold on OpenSea for much higher. This is a complete bot that uses Chainlink Keepers to mint a DotDotDot so you can hopefully take advantage of this profitable opportunity

How we built it

The contract implements Chainlinks' KeeperCompatibleInterface. The checkUpkeep function determines whether it's possible to mint a certain number of NFTs to a particular buyer. For that to be true:

  1. The buyer must be requesting 5 or less NFTs. The contract will only let you print 5 at a time.
  2. The buyer must have enough WETH and give the contract enough allowance to pay for the mint cost (and fee) of the NFTs.
  3. There needs to be enough supply available to mint for the buyer

When all these are true, the Keeper will call the performUpkeep function. This function unwraps the WETH to acquire ETH. It then uses the ETH to call mint on the DotDotDot contract. Lastly there are some sanity checks to ensure that funds were subtracted from the buyer and the buyer received the assets they paid for.

Challenges we ran into

Making this bot competitive and gas efficient vs making it easy to use and low risk. There's always a tradeoff here since sanity checks increase gas usage. There's also the problem of Flashbots. A more complex solution would be to allow Chainlink Keepers to send transactions while also sending the same transaction with the same nonce to Flashbots. This could cause a revert and cost gas if the Flashbots transaction beats the Chainlink Keeper who send the transaction to the mempool already. That may be more competitive but I figured that would be more confusing for the end user and more risky

Accomplishments that we're proud of

I think the user experience of this bot is the best feature. It doesn't lock up the users' funds which is inconvenient and a security issue if there's a vulnerability in the code (I don't think there is though). Also, Chainlink Keepers means there isn't any need to set up a node or use an expensive RPC service and complex code to monitor and trigger the bot. I think this is very simple to set up for someone non-technical

What we learned

Generally, how to use Chainlink Keepers.

What's next for DotDotDotPrinter

Deploying to Mainnet is the next step. I have already added code to optionally add a fee for using the contract. I'd be very curious to see how this performs when the real opportunity is available. After that, adding optional features that are more competitive but also more risky.

Built With

Share this project:

Updates