Borrow nUSD
Deposit collateral, mint nUSD, calculate debt and position health, repay debt, and withdraw collateral.
One Nest borrow position is identified by:
owner wallet + collateral config -> vault PDAThe same wallet can have independent positions in multiple supported markets. Debt and collateral are not pooled across those positions.
- deposit collateral → 2. refresh oracle + mint nUSD → 3. monitor debt and health
- repay nUSD → 5. refresh oracle + withdraw collateral
Supported collateral
Do not route by a ticker alone. Match the exact market symbol, collateral
mint, configuration PDA, custody vault, token program, and decimals.
| Market | Issuer | Mint | Decimals | Borrow LTV | Liquidation | Oracle |
|---|---|---|---|---|---|---|
| SPYx SPYx | xStocks | XsoC…DF2W | 8 | 70% | 80% | pyth-lazer |
| QQQx QQQx | xStocks | Xs8S…mWHZ | 8 | 60% | 70% | pyth-lazer |
| AAPLx AAPLx | xStocks | XsbE…JzJp | 8 | 50% | 60% | pyth-lazer |
| GOOGLx GOOGLx | xStocks | XsCP…q6aN | 8 | 50% | 60% | pyth-lazer |
| METAx METAx | xStocks | Xsa6…o5Zu | 8 | 50% | 60% | pyth-lazer |
| NVDAx NVDAx | xStocks | Xsc9…9qEh | 8 | 50% | 60% | pyth-lazer |
| TSLAx TSLAx | xStocks | XsDo…HzoB | 8 | 50% | 60% | pyth-lazer |
| COINx COINx | xStocks | Xs7Z…PxNu | 8 | 50% | 60% | pyth-lazer |
| CRCLx CRCLx | xStocks | Xsue…3bd1 | 8 | 50% | 60% | pyth-lazer |
| SPCXx SPCXx | xStocks | Xs3o…qpH8 | 8 | 50% | 60% | pyth-lazer |
| SPCX SPCXbp | Backpack | SPCX…imGb | 6 | 50% | 60% | pyth-lazer |
| MU MU | Backpack | MUxE…Gay1 | 6 | 40% | 50% | jupiter-signed |
| SNDK SNDK | Backpack | SNDK…RhfH | 6 | 40% | 50% | jupiter-signed |
| DRAM DRAM | Backpack | DRAM…Y4Cw | 6 | 40% | 50% | jupiter-signed |
| SPYon SPYon | Ondo | k18W…ondo | 9 | 70% | 80% | jupiter-signed |
| QQQon QQQon | Ondo | HrYN…ondo | 9 | 60% | 70% | jupiter-signed |
Borrowing workflow
| Step | Guide | Requires a fresh oracle update? |
|---|---|---|
| Open a position and transfer collateral | Deposit collateral | No |
| Borrow nUSD | Mint nUSD | Yes, atomically |
| Display risk | Position health | Read current price |
| Display current debt | Accrued stability fees | No |
| Reduce or close debt | Repay debt | No |
| Release collateral | Withdraw collateral | Yes while debt remains |
Position state
The vault stores:
type BorrowVault = {
owner: PublicKey;
collateralConfig: PublicKey;
collateralRaw: BN; // collateral mint base units
principalDebt: BN; // six-decimal nUSD base units
accruedFee: BN; // six-decimal nUSD base units
lastAccrualTs: BN; // Unix seconds
};The stored debt is principalDebt + accruedFee. Before minting, repaying, or
withdrawing, the program first accrues fees to the transaction's on-chain clock.
Therefore, a wallet read is a snapshot and applications should project the
additional fee since lastAccrualTs.
Collateral custody
A deposit moves tokens into the market's canonical collateral vault. The user's position PDA records the deposited amount. An integrating application does not receive or hold the user's collateral or nUSD.