ERC-7565: Perpetual Contract NFTs as Collateral
Lock financial assets as NFTs and use them as collateral for borrowing funds in DeFi, facilitating liquidity provision.
Abstract
This ERC proposes a mechanism where a person (referred to as the "Asset Owner") can collateralize NFTs that represent locked deposits or assets, to borrow funds against them. These NFTs represent the right to claim the underlying assets, along with any accrued benefits, after a predefined maturity period. 1
Motivation
The rapidly evolving landscape of DeFi has introduced various mechanisms for asset locking, offering benefits like interest and voting rights. However, one of the significant challenges in this space is maintaining liquidity while these assets are locked. This ERC addresses this challenge by proposing a method to generate profit from locked assets using ERC-721 and ERC-4907.
In DeFi services, running Automated Market Maker (AMM), liquidity providers contribute assets to pools and receive NFTs representing their stake. These NFTs denote the rights to the assets and the associated benefits, but they also lock the assets in the pool, often causing liquidity challenges for the providers. The current practice requires providers to withdraw their assets for urgent liquidity needs, adversely affecting the pool's liquidity and potentially increasing slippage during asset swaps.
Our proposal allows these NFTs, representing locked assets in liquidity pools, to be used as collateral. This approach enables liquidity providers to gain temporary liquidity without withdrawing their assets, maintaining the pool's liquidity levels. Furthermore, it extends to a broader range of DeFi services, including lending and trading, where asset locking is prevalent. By allowing the collateralization of locked asset representations through NFTs, our approach aims to provide versatile liquidity solutions across DeFi services, benefitting a diverse user base within the ecosystem.
The concept of perpetual contract NFTs, which we introduce, exploits the idea of perpetual futures contracts in the cryptocurrency derivatives market. These NFTs represent the rights to the perpetual contract and its collateral, enabling them to be used effectively as collateral for DeFi composability. The perpetual contract NFT offers a new form of NFT that enhances the utility of locked assets, providing a significant advantage in DeFi applications by offering liquidity while retaining the benefits of asset locking.
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
Contract Interface
Solidity interface.
Event Collateralized
- The
Collateralized
event MUST be emitted when the collateralize function is successfully executed. - Usage: Logs the event of an NFT being used as collateral for a loan, capturing essential details like the loan amount, interest rate, and loan duration.
Event LoanRepaid
- The
LoanRepaid
event MUST be emitted when the repayLoan function is successfully executed. - Usage: Logs the event of a loan being repaid and the corresponding NFT being released from collateral.
Event Defaulted
- The
Defaulted
event MUST be emitted in scenarios where the loan defaults and the NFT is transferred to the lender. - Usage: Used to log the event of a loan default and the transfer of the NFT to the lender.
Function collateralize
- The
collateralize
event SHOULD be implemented asexternal
. - Usage: Allows an NFT owner to collateralize their NFT to receive a loan.
Function repayLoan
- The
repayLoan
function SHOULD be implemented asexternal
. - Usage: Enables an NFT owner to repay their loan and reclaim their NFT.
Function getLoanTerms
- The
getLoanTerms
function MAY be implemented asexternal
view
. - Usage: Allows querying the loan terms for a given NFT.
Function currentOwner
- The
currentOwner
function MAY be implemented asexternal
view
. - Usage: Enables querying the current owner of a specific NFT.
Function viewRepayAmount
- The
viewRepayAmount
function MAY be implemented asexternal
view
. - Usage: Enables querying the current repay amount of a specific NFT.
Rationale
Design Motivation
The design of this standard is driven by the need to address specific challenges in the DeFi sector, particularly concerning the liquidity and management of assets locked as collateral. Traditional mechanisms in DeFi often require asset holders to lock up their assets for participation in activities such as lending, staking, or yield farming, which results in a loss of liquidity. This standard aims to introduce a more flexible approach, allowing asset holders to retain some liquidity while their assets are locked, thereby enhancing the utility and appeal of DeFi products.
Design Decision
-
Dual-Role System (Asset Owner and DeFi Platform/Contract): A clear division is established between the NFT owner (asset holder) and the DeFi platform or contract utilizing the NFT as collateral. This distinction simplifies the management of rights and responsibilities, enhancing clarity and reducing potential conflicts.
-
Enhancing Liquidity without Compromising Asset Locking Benefits: A key feature of this standard is enabling asset owners to use their NFTs, which represent locked assets, as collateral to secure loans. This approach allows asset owners to access liquidity without needing to withdraw their assets from pools or staking programs, thus preserving the associated benefits like interest accrual or voting rights.
-
Automated Loan and Collateral Management: The integration of automated features for managing the terms and conditions of the collateralized NFT is a deliberate choice to minimize transaction costs and complexity.
-
DeFi Composability: The strategic emphasis on DeFi composability, particularly the integration between asset-locking and collateralizing services, is pivotal for this standard. This approach aims to streamline the adoption of the standard across diverse DeFi platforms and services, fostering seamless connections within the DeFi ecosystem.
Alternate Designs and Related Work
-
Comparison with ERC-4907: While ERC-4907 also introduces a dual-role model for NFTs (owner and user), our standard focuses specifically on the use of NFTs for collateralization in financial transactions, diverging from ERC-4907’s rental-oriented approach.
-
Improvement Over Traditional Collateralization Methods: Compared to traditional DeFi collateralization, which often requires complete asset lock-up, this standard proposes a more dynamic and flexible model that allows for continued liquidity access.
Backwards Compatibility
Fully compatible with ERC-721 and integrates with ERC-4907 for renting NFTs.
Test Cases
Run in Terminal:
Reference Implementation
Security Considerations
Copyright
Copyright and related rights waived via CC0.