Overview
Nostra is a CDP (Collateralized Debt Position) lending protocol on StarkNet. Sable integrates Nostra as the backend for its CDP product, enabling users to borrow USDC against WBTC collateral.Nostra’s CDP model is similar to MakerDAO — users maintain a health factor above 1.0 to avoid liquidation.
What is Nostra?
Nostra is a decentralized lending protocol on StarkNet that offers:- Collateralized borrowing: Deposit assets, borrow against them
- Interest-bearing tokens: iTokens (collateral) and dTokens (debt)
- Isolated positions: Each user’s CDP is independent
- Liquidation engine: Automatic liquidation when health factor drops below 1.0
Key Features
- iTokens: Interest-bearing collateral tokens (e.g., iWBTC-c)
- dTokens: Debt tokens that accrue interest (e.g., dUSDC)
- Max LTV: Up to 70% for WBTC collateral
- Liquidation Threshold: ~75% (Nostra parameter)
How Sable Integrates with Nostra
Sable’s CDP contract uses Nostra as the underlying lending protocol for all collateral and debt operations.CDP Lifecycle
Open Position
-
Deposit Collateral
-
Borrow USDC
Manage Position
Health Factor Formula:| Health Factor | Status | Color |
|---|---|---|
| > 2.0 | Very Safe | 🟢 Green |
| 1.5 – 2.0 | Safe | 🟢 Green |
| 1.0 – 1.5 | Caution | 🟡 Yellow |
| < 1.0 | Liquidation Risk | 🔴 Red |
Close Position
Atomic closure in a single transaction:The
close_position() function ensures no partial state — either the full position closes successfully or the transaction reverts.Contract Addresses
Sable CDP Contract
Nostra CDP Manager
The backend Nostra contract used by Sable CDP.Token Integration
iWBTC-c (Collateral Token)
Nostra’s interest-bearing collateral token for WBTC.- Symbol: iWBTC-c
- Decimals: 8
- Purpose: Represents WBTC deposited as collateral on Nostra
dUSDC (Debt Token)
Nostra’s debt token for USDC borrowing.- Symbol: dUSDC
- Decimals: 6
- Purpose: Represents accrued USDC debt on Nostra
- Interest: Automatically compounds over time
CDP Parameters
| Parameter | Value |
|---|---|
| Collateral Token | WBTC (8 decimals) |
| Debt Token | USDC (6 decimals) |
| Max LTV | 70% |
| Liquidation Threshold | ~75% (Nostra parameter) |
| Interest Rate | Variable (based on utilization) |
| Backend Protocol | Nostra Finance |
Integration Pattern
Sable’s CDP contract acts as a proxy layer between users and Nostra.Liquidation Price Calculation
Users can calculate their liquidation price to monitor risk. Formula:Which Sable Features Use Nostra?
CDP Contract
WBTC → USDC BorrowingAll CDP operations (deposit, borrow, repay, withdraw, close) route through Nostra.Users maintain health factor > 1.0.
CDP Page
User Interface
/cdp page displays:- Collateral value
- Debt value
- Health factor
- Liquidation price
- Position management UI
Frontend Integration
Sable’s CDP page fetches position data from both the Sable CDP contract and Nostra.External Resources
Nostra Documentation
Official Nostra protocol documentation
Nostra App
Nostra lending interface
Integration Source Code:
~/workspace/source/contracts/src/cdp.cairo