Note: this code is not audited and should not be used in production environment.
DeFenDAO aims to provide a tool for NFT communities to boost engagement and defend prices increase by enabling providing partial buy liquidity. It also aims to increase liquidity in the overall NFT market.
- Setup
.env
with ALCHEMY_API_KEY - Start local node using
npx hardhat node
- Deploy contracts using
yarn hardhat run scripts/deploy.ts --network localhost
- Start UI using
yarn dev
and open up urlhttp://localhost:3000
- Select Optichad collection and set target price to 0.0125, then buy 10+ tickets.
- Execute order using
yarn hardhat run scripts/execute.ts --network localhost
- Refresh browser and check that claimable NFT has appeared.
- Claim NFT
As the NFT market experiences a downturn, NFT collections are experiencing a death spiral of lower floor prices -> lower bids -> lower confidence -> lower floor prices. But having more buy bids at higher prices
can break this chain.
Buyers may want to snipe a collection at a price lower than the current floor price. Opensea supports this through "collection offers", but they do not support making partial bids
.
Create a contract that allows users to provide liquidity for collections at the price lower than the current floor price (unit for liquidity is currently mininum 1/10th of NFT price). If there is enough liquidity to buy an NFT on this contract and there is a sell order with a matching price available on Opensea, anyone can call the contract execute
function, which will buy the NFT.
We also added a lottery system for selecting the recipient of the NFT. Liquidity providers will have an opportunity to win the NFT depending on the percentage of liquidity they provided. (e.g. if 10 people provided 1/10th of liquidity, they will all have equal chances of winning the NFT) This lottery system was added to make the process more fun for participants and lower the barrier to entry.
https://github.com/2022DefenDAO/front
Expected node version is >= 16.0.0
- Install and build
yarn
yarn build
- Run unit test
yarn workspace contracts test
=> Used orders that had been already executed on a fork of the Optimism network (pre-execution)
=> Used validate function before fulfill function to bypass signature verification
3. Seaport validate functions not working for certain order types (out of BASIC_ORDER, ORDER, ADVANCED_ORDER types, only ORDER type works)
=> Converted BASIC_ORDER, ADVANCED_ORDER types to ORDER type.
- Dynamic price units
- Integrate floor price oracles
- Ticket purchase and NFT claim fees
- Executor incentives
- Ticket reserve yields
- Support multiple NFT marketplaces