Oryn Finance

Borrow stablecoins with fixed-rate loans using your Uniswap V3 NFT positions as collateral.

Oryn Finance

Created At

ETHGlobal New Delhi

Project Description

Overview

This project is a Collateralized Debt Position (CDP) protocol that allows users to deposit Uniswap V3 position NFTs as collateral and borrow stablecoins against them. By unlocking the value of liquidity positions, users can access liquidity without having to close their Uniswap positions.

How It Works :

Collateralization : Users deposit their Uniswap V3 liquidity position NFT into the protocol. The system tracks the NFT, its token ID, current value, and associated pool details. Unclaimed fees from the NFT are also monitored as part of the collateral’s value.

Borrowing : Users can borrow a protocol-issued stablecoin against the NFT collateral. Borrowing power is calculated based on the USD value of the position (sourced via on-demand queries and Coingecko for prices). A fixed interest rate (5%) applies to borrowed amounts.

Repayment : Users can repay the borrowed stablecoin at any time. Upon repayment, the collateral NFT is released back to the user.

Risk Management : The system calculates health factors to determine collateral safety. If the health factor drops below a threshold, the position can be liquidated.

How it's Made

Architecture : The protocol is primarily on-chain:

Smart Contracts (Solidity): Manage NFT collateral deposits (Uniswap V3/V4 positions). Issue stablecoins (oUSD) against collateral. Track borrow balances, interest accrual, and repayments. Handle liquidations when health factors fall below thresholds. Integrate Uniswap V4 hooks to automate NFT deposit and stablecoin minting when providing liquidity.

Off-chain Pyth Updater : A lightweight service that fetches external token prices and submits them to the Pyth oracle. Ensures the on-chain price feeds used to calculate collateral USD values are up-to-date.

Data Sources : Uniswap V3/V4 Position Manager Contract: Fetch NFT ownership and metadata (token ID, liquidity, fee tier, token pair). Queries include positions(), collectableFees(), and pool state functions.

Pyth Price Oracle (On-chain) : Provides real-time USD prices for collateral valuation. Off-chain updater ensures these prices are refreshed continuously.

Borrow Power Calculation : When a user deposits an NFT, the contract reads underlying token amounts and converts them to USD using Pyth prices. A collateral factor (e.g., 50%) determines the maximum borrowable oUSD. Health factors are recalculated on-chain whenever price updates occur.

Frontend : Built with React + TypeScript. Connects via MetaMask or WalletConnect. Fetches NFT and borrow data directly from smart contracts.

Displays : NFT details (pool, fee tier, token amounts, unclaimed fees). Collateral USD value. Borrow limits, borrowed amounts, health factor. Progress indicators for deposit, borrow, and repay operations.

Hacky/Notable Solutions : Fully on-chain MVP avoids needing a backend. Off-chain Pyth updater ensures accurate real-time USD valuations. Uniswap V4 hooks allow automated liquidity provision → NFT deposit → oUSD minting in one seamless step.

background image mobile

Join the mailing list

Get the latest news and updates