The end of searching for liquidity.
How might we improve liquidity for NFT owners, so that they have immediate access to funds without having to first find a lender, agree to a deal, or sell below market?
NFTlend is building the first automated market maker for instant, permissionless NFT-backed loans.
-
Borrowers escrow NFTs to instantly access over-collateralized, fixed-term loans priced at the project floor.
-
Lenders deposit assets into the lending pool to receive yield generated from borrower interest payments.
-
Liquidators repay any loan defaults (those expired or undercollateralized) to purchase the underlying NFT at a discount.
Deployed on Ropsten and IPFS: ropsten.nftlend.xyz.
Note that test DAI
, USDC
or WETH
is required to interact with the protocol.
Contact me on Twitter @niftrr with your Ethereum address and I will send you some.
-
Lending Pool is the main contract of the protocol exposing all user interaction endpoints;
deposit
,withdraw
,borrow
,repay
andliquidate
. -
Collateral Manager contract handles the escrow of NFTs and loan creation.
-
nTokens are interest-bearing derivative tokens that are minted and burned upon the
deposit
andwithdraw
of asset tokens to / from theLending Pool
at a 1:1 ratio. -
debtTokens are non-transferable derivative tokens that are minted and burned upon the
borrow
andrepay
of loans to theLending Pool
a 1:1 ratio with the asset token repayment amount. It is the ratio ofdebtTokens
tonTokens
, updated at every user interaction, that is used to calculate the interest generated by the protocol. -
NFT Pricing Oracles are used to update NFT project floor prices, to price new loans and signal if the underlying loan collateral price falls below threshold for liquidation.
-
Token Pricing Oracles are used to calculate exchange rates from the
NFT Pricing Oracles
, priced in ETH, to other loaned assets; DAI and USDC. -
Libraries contain reusable code, refactored from the protocol to save gas.
-
Configurator is the admin contract used to set / update protocol variables.
Link to detail on design pattern decisions.
Link to detail on avoiding common attacks.
.
├── assets # README assets
├── docs # Documentation
│ ├── avoiding_common_attacks.md # Security measures
│ ├── deployed_address.txt # Deployed smart contract addresses
│ └── design_pattern_decisions.md # Design patterns
├── interface # Front-end interface
│ ├── components # React components
│ ├── hooks # React hooks
│ ├── App.jsx # React app
│ ├── AppContext.jsx # React app state management
│ ├── LICENCE
│ ├── README.md
│ └── ...
├── v1-core # Protocol
│ ├── contracts # Smart contracts
│ │ ├── interfaces # Interfaces
│ │ │ ├── ICollateralManager.sol # CollateralManager interface
│ │ │ ├── IDebtToken.sol # DebtToken interface
│ │ │ ├── ILendingPool.sol # LendingPool interface
│ │ │ └── INToken.sol # NToken interface
│ │ ├── libraries # Libraries
│ │ │ ├── DataTypes.sol # DataTypes library
│ │ │ └── ReserveLogic.sol # ReserveLogic library
│ │ ├── mocks # Mocks
│ │ │ ├── AssetToken.sol # ERC20 contract
│ │ │ └── NFT.sol # ERC721 contract
│ │ ├── CollateralManager.sol # CollateralManager contract
│ │ ├── Configurator.sol # Configurator contract
│ │ ├── DebtToken.sol # DebtToken contract
│ │ ├── LendingPool.sol # LendingPool contract
│ │ ├── LendingPoolEvents.sol # LendingPoolEvents contract
│ │ ├── LendingPoolStorage.sol # LendingPoolStorage contract
│ │ ├── NToken.sol # NToken contract
│ │ └── TokenPriceOracle.sol # TokenPriceOracle contract (WIP)
│ ├── scripts # Scripts
│ │ └── deploy.js # Deployment script
│ ├── test # Unit tests
│ ├── LICENCE
│ ├── README.md
│ └── ...
└── ...
Follow the instructions in v1-core/README.md.
Follow the instruction in interface/README.md.
- Connect with Opensea Chainlink external adapter for NFT floor prices. (Note: external adapter development already complete and being supported by node operators).
- Connect to Chainlink data feeds for price-feed integration.
- Add logic to generage interest payment accrual to lenders.
- Update liquidate function to trigger a timed auction with a feature to allow the original owner to purchase back their deposited price at the cost of the outstanding debt plus a fee; to provide better protection and compensation for NFT owners during liquidation events.
- Add flash loan functionality.
- Audit smart contracts.
- Update the Interface in terms of UX, with full test coverage.
The primary license for both the NFTlend V1 Core and Interface is the Business Source License 1.1 (BUSL-1.1
), see:
niftrr.eth