.-----------------------------------------------------------------------------.
| _ _ ___ __ _ _ |
| /\ | (_) | \ \ / / | | | |
| / \ | |_ __ _ _ __ _ __ ___ ___ _ __ | |\ \ / /_ _ _ _| | |_ |
| / /\ \ | | |/ _` | '_ \| '_ ` _ \ / _ \ '_ \| __\ \/ / _` | | | | | __| |
| / ____ \| | | (_| | | | | | | | | | __/ | | | |_ \ / (_| | |_| | | |_ |
| /_/ \_\_|_|\__, |_| |_|_| |_| |_|\___|_| |_|\__| \/ \__,_|\__,_|_|\__| |
| __/ | |
| |___/ |
'-----------------------------------------------------------------------------'
- About The Project
- Contract Details
- Contract Initialization
- Ownership Management
- View Functions
- Inventory Position Management
- Liquidity Position Management
- Aligned Token Management
- Miscellaneous Token Management
- Usage
The AlignmentVault
primitive is a smart contract that allows locking ETH, WETH, NFTs, NFTX vTokens, and NFTX liquidity to deepen the floor liquidity of a target NFT collection using NFTX V3 (Uniswap V3). The liquidity is locked forever, but the yield generated can be claimed indefinitely. Because of the nature of Uniswap V3, this vault primitive essentially allows you to market make a NFT collection with permanently locked liquidity.
This contract harnesses the economic velocity of derivative collections and directs it towards boosting a primary collection. It forces alignment of derivative teams in a way that is beneficial and allows them to retain the economic utility from the aligned capital. This is regenerative finance ("ReFi") for NFT communities.
There is a testnet deployment of an AlignmentVaultFactory
available at 0xD1ac539e856F8C86c7bf2217eC4b70D0D1c0D82C
on Sepolia.
SPDX-License-Identifier: AGPL-3.0
Solidity Version: 0.8.23
Author: Zodomo
Contact Information:
- Clusters:
zodomo/main
- Farcaster:
zodomo
- X:
@0xZodomo
- Telegram:
@zodomo
- GitHub:
Zodomo
- ENS:
Zodomo.eth
- Email:
zodomo@proton.me
- initialize: Initializes all contract variables and NFTX integration. Requires the owner, aligned NFT collection, and optionally the NFTX vault ID.
- renounceOwnership: Overridden to disable it, as renouncing would break the vault.
- setDelegate: Sets the delegate address for the vault. The delegate can represent the vault when claiming yield, should NFTX support the Delegate Registry for this.
- getUniswapPoolValues: Returns the Uniswap pool address, the current price, and the current tick of the pool.
- getInventoryPositionIds: Returns an array of inventory position IDs.
- getLiquidityPositionIds: Returns an array of liquidity position IDs.
- getSpecificInventoryPositionFees: Returns the fees accrued for a specific inventory position.
- getTotalInventoryPositionFees: Returns the total fees accrued across all inventory positions.
- getSpecificLiquidityPositionFees: Returns the fees accrued for a specific liquidity position.
- getTotalLiquidityPositionFees: Returns the total fees accrued across all liquidity positions.
- inventoryPositionCreateVToken: Creates an inventory position with vTokens.
- inventoryPositionCreateNfts: Creates an inventory position with NFTs.
- inventoryPositionIncrease: Increases an existing inventory position with vTokens.
- inventoryPositionWithdrawal: Withdraws vTokens and/or NFTs from an inventory position.
- inventoryPositionCombine: Combines child inventory positions under a parent position.
- inventoryPositionCollectFees: Collects fees from specified inventory positions.
- inventoryPositionCollectAllFees: Collects fees from all inventory positions.
- liquidityPositionCreate: Creates a new liquidity position.
- liquidityPositionIncrease: Increases an existing liquidity position.
- liquidityPositionWithdrawal: Withdraws from a liquidity position.
- liquidityPositionCollectFees: Collects fees from specified liquidity positions.
- liquidityPositionCollectAllFees: Collects fees from all liquidity positions.
- buyNftsFromPool: Buys NFTs from the NFTX pool.
- mintVToken: Mints vTokens by depositing NFTs.
- buyVToken: Buys vTokens with ETH.
- buyVTokenExact: Buys an exact amount of vTokens with ETH.
- sellVToken: Sells vTokens for ETH.
- sellVTokenExact: Sells an exact amount of vTokens for ETH.
- rescueERC20: Rescues ERC20 tokens from the vault (except aligned tokens).
- rescueERC721: Rescues ERC721 tokens from the vault (except aligned tokens).
- rescueERC1155: Rescues ERC1155 tokens from the vault (except aligned tokens).
- rescueERC1155Batch: Rescues a batch of ERC1155 tokens from the vault (except aligned tokens).
- wrapEth: Wraps ETH to WETH.
- unwrapEth: Unwraps WETH to ETH.
- Deploy the vault using the
AlignmentVaultFactory
contract, specifying the aligned NFT collection and optionally the NFTX vault ID. - Send ETH to the vault. This ETH will be locked forever but will generate yield.
- Use the various management functions to create and manage inventory and liquidity positions.
- Collect fees from these positions as needed.
- Use the token management functions to interact with the aligned NFT collection and its vTokens.
Please note that any ETH, NFTs, or tokens sent to the vault will be locked forever. Only the generated yield can be withdrawn.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
You can contribute by writing tests, fixing bugs, optimizing the code, adding cool ass ASCII art, updating the README, or anything else productive.
Built in collaboration with MiyaMaker: https://miyamaker.com
Special thanks for helping me through the end:
- @sudotx
- @RyanSea