NestDevelopers
Borrow nUSD

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 PDA

The same wallet can have independent positions in multiple supported markets. Debt and collateral are not pooled across those positions.

  1. deposit collateral → 2. refresh oracle + mint nUSD → 3. monitor debt and health
  2. 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.

MarketIssuerMintDecimalsBorrow LTVLiquidationOracle
SPYx
SPYx
xStocksXsoCDF2W870%80%pyth-lazer
QQQx
QQQx
xStocksXs8SmWHZ860%70%pyth-lazer
AAPLx
AAPLx
xStocksXsbEJzJp850%60%pyth-lazer
GOOGLx
GOOGLx
xStocksXsCPq6aN850%60%pyth-lazer
METAx
METAx
xStocksXsa6o5Zu850%60%pyth-lazer
NVDAx
NVDAx
xStocksXsc99qEh850%60%pyth-lazer
TSLAx
TSLAx
xStocksXsDoHzoB850%60%pyth-lazer
COINx
COINx
xStocksXs7ZPxNu850%60%pyth-lazer
CRCLx
CRCLx
xStocksXsue3bd1850%60%pyth-lazer
SPCXx
SPCXx
xStocksXs3oqpH8850%60%pyth-lazer
SPCX
SPCXbp
BackpackSPCXimGb650%60%pyth-lazer
MU
MU
BackpackMUxEGay1640%50%jupiter-signed
SNDK
SNDK
BackpackSNDKRhfH640%50%jupiter-signed
DRAM
DRAM
BackpackDRAMY4Cw640%50%jupiter-signed
SPYon
SPYon
Ondok18Wondo970%80%jupiter-signed
QQQon
QQQon
OndoHrYNondo960%70%jupiter-signed

Borrowing workflow

StepGuideRequires a fresh oracle update?
Open a position and transfer collateralDeposit collateralNo
Borrow nUSDMint nUSDYes, atomically
Display riskPosition healthRead current price
Display current debtAccrued stability feesNo
Reduce or close debtRepay debtNo
Release collateralWithdraw collateralYes 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.

On this page