PAR docs

Getting started

PAR is live on Solana mainnet: program 2JYLMvPgC3FmHd6RMZtLAYtjBXP5rPrKaY8aWXsunLeG, PAR mint ycTSMY4S5brqnSc3hQmfktFGyvXEtePAL2AcoxENySd. You can also run the whole protocol on a local validator from the repository.

What you need

ToolVersion used by the repository
Rust + Solana CLIAgave toolchain with cargo-build-sbf
Anchor0.30.1
Node.js20 or newer
A walletPhantom, Solflare or Backpack

Use the app

  1. Open the app from Launch app on the home page.
  2. Connect a wallet that holds jitoSOL or mSOL.
  3. Open a vault: choose how much collateral to lock, how much PAR to borrow, and your rate between 0.5% and 25%. The app shows your collateral ratio; it must stay at or above 120%, and the debt must be at least 200 PAR.
  4. Watch your place in the redemption line: troves at lower rates are redeemed before yours.
  5. To leave, repay the debt with Close vault and take all your collateral back.

Earn in the stability pool

  1. Hold PAR.
  2. Deposit it in the stability pool of a branch (jitoSOL or mSOL).
  3. Your deposit earns borrower interest as PAR and liquidated collateral as jitoSOL or mSOL.
  4. Withdraw any amount at any time; gains are paid out on every withdrawal.

Redeem PAR for one dollar of staked SOL

  1. Choose the branch whose collateral you want.
  2. Enter the PAR amount and the most you are willing to pay in fees.
  3. The app builds the list of lowest-rate buckets and troves for you and sends redeem.

Build from source

bash
git clone <repository>
cd engine
anchor build

The program lives in programs/par. Constants are in programs/par/src/constants.rs; every number on this site comes from that file.

Run it locally

A local validator needs the real oracle and stake pool accounts, because the program reads them directly:

bash
# fetch Pyth, Switchboard, Jito and Marinade accounts into tests/fixtures
python3 scripts/fetch-fixtures.py

# start a validator with the program and the fixtures loaded
solana-test-validator --reset \
  --bpf-program target/deploy/par-keypair.json target/deploy/par.so \
  --account-dir tests/fixtures

initialize refuses to run while the program has an upgrade authority, so a local run first makes the program immutable:

bash
solana program set-upgrade-authority <PROGRAM_ID> --final

Then call initialize once and create_branch once per collateral mint.