Skip to content

tripplyons/nft-call-options

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFT Call Options

📈 The first NFT options trading smart contract

Github Actions

Web Interface (Work In Progress): https://nft-call-options.vercel.app/

Features

  • Users can offer to buy call options for any NFT in a collection
  • Users can sell covered call options against NFTs they own by accepting offers
  • The smart contract is immutable and has no ownership mechanism

Tech Stack

Roadmap

See docs/roadmap.md for a list of existing and planned features.

Description of Smart Contract Logic

  • User A can offer to buy a call option for an NFT
    • User A selects a collection to buy a call on
      • The floor price is an important metric here because any NFT from the collection can be used in this transaction
    • User A selects a strike price (in Ether)
    • User A selects a expiration time (in a Unix timestamp)
    • User A selects an amount of premium to pay (in Ether)
      • User A pays the premium upfront to prevent order spoofing
      • Their premium is held in the contract until the offer is cancelled or the offer is accepted
  • User B can accept User A's offer by selling a covered call against an NFT that they own
    • User B uses their NFT as collateral, and receives the premium
      • User B's NFT can be any NFT in the collection chosen by User A
    • The NFT is locked up until the expiration time
      • Before the expiration time, User A can pay the strike price in for the NFT
      • After the expiration time, User B can withdraw their NFT if it wasn't bought

Development

This project uses Foundry. See the book for instructions on how to install and use Foundry.

  • Core contracts are in src/
    • Build contracts with forge build
  • Tests are in test/
    • Run tests with forge test