Blend Integration (NFT Lending)
Blur launched Blend in May 2023 with unconventional mechanics: perpetual loans against NFT collateral with no oracles. Most NFT lending protocols (BendDAO, NFTfi) use oracles to determine floor price and automate liquidations. Blend removed them entirely—liquidation only occurs when a lender starts an auction and the borrower fails to refinance within 30 hours.
This changes integration architecture: no subscription to price events, but you must monitor auction events and calculate time to liquidation precisely.
Key Blend Mechanics for Integration
Loan Lifecycle and Events
The complete loan lifecycle in Blend passes through several states:
- Offer creation—lender signs an off-chain offer (EIP-712 signature) with parameters: collection, rate, amount, expiration
- Loan start—borrower accepts offer on-chain; NFT goes to Blend's escrow contract
- Refinancing—anyone can offer a better rate; if the borrower accepts, the old lender receives funds + interest, and the new lender takes their place
-
Auction trigger—lender calls
startAuction(), starting a 30-hour window -
Seizure—if borrower doesn't refinance, lender takes the NFT via
seize()
For integration, listen to Blend contract events (0x29469...): LoanOfferTaken, Refinance, StartAuction, Seize. A Graph subgraph for Blend already exists, but for low-latency auction reaction, use a WebSocket to an Ethereum node via eth_subscribe logs.
Interest Calculation: Continuous Compounding
Blend uses continuous compounding instead of simple interest. Accumulated debt is calculated as:
debt = principal * e^(rate * time)
Where rate is the annual rate in fractions (e.g., 0.10 for 10% APR), time is seconds / 31536000. This is critical for integration: if you calculate simply, the debt will be understated, and the refinance transaction will revert with InsufficientRepayment.
The Blend contract stores startTime and rate for each loan. Get the current debt at any moment through the view function getLoanDebt(lienId)—this is more reliable than calculating yourself.
Off-Chain Order Book and EIP-712 Signatures
Offers in Blend are not stored on-chain until acceptance. This reduces gas costs for lenders but complicates integration: you must fetch and verify signatures via the Blur API.
Offer structure for EIP-712 verification:
-
collection—NFT contract address -
totalAmount—maximum sum of loans under the offer -
maxAmount—maximum sum of one loan -
minAmount—minimum sum -
auctionDuration—auction duration (usually 30 hours) -
salt—unique nonce -
expirationTime -
rate—rate in Blend format (wei-scaled)
Verify signature using ethers.verifyTypedData() or viem verifyTypedData before showing the offer to the user.
Building the Integration
Reading active loans. Via The Graph (subgraph blend-protocol) or direct contract calls. For a specific NFT tokenId: getActiveLoans(collection, tokenId) returns an array of active lienIds.
Auction monitoring. If your product includes borrower notifications, use a WebSocket subscription to StartAuction events. Upon detection, send push notifications to users with a timer (30 hours minus elapsed time). We have a ready Node.js module with viem that handles up to 500 simultaneous monitorings.
Executing refinance. Call refinance(lien, lienId, newLoanAmount, loanOffer, signature). The newLoanAmount must cover current debt with interest—get it from getLoanDebt() + 1-2% buffer for mining changes.
Custom offers (for lenders). EIP-712 signature via MetaMask/WalletConnect, published via Blur API. Revoke offers by incrementing nonce on-chain.
Work Process
Requirements analysis (1 day). Determine client role: borrower, lender, or marketplace on top of Blend. This defines the set of functions to integrate.
Development (2-3 days). Smart contract logic is not written—Blend is already deployed and immutable. Work includes SDK/helpers in TypeScript/viem, React components to display loans and positions, and a backend service for auction monitoring.
Testing. Fork test in Foundry with Ethereum mainnet state: simulate loan → auction → refinance via vm.prank. This allows testing edge cases without real tokens.
Timeline: 2-4 days from specification to deployment. Cost depends on UI volume and server monitoring requirements.







