raven
Technical documentation

How the raven works.

RAVEN is a web-first lending protocol on Solana: borrow SOL against memecoins and tokenized stocks, arm take-profits and stops on that same collateral, and build an on-chain credit score with every clean repay. This page is the whole machine, end to end — nothing hand-waved.

01Overview

You hold assets that trade on Solana. RAVEN turns any of them into an instant SOL credit line without making you sell. You pledge collateral, choose a tier (which fixes your loan-to-value, term, and fee), and receive SOL. A published liquidation price is shown before you commit. While the loan is open you can arm a take-profit or stop-loss on the collateral itself — a keeper watches every 15 seconds and executes it for you, clearing the debt and returning the surplus. Repay cleanly and your credit score climbs, unlocking higher LTV and lower fees.

Paper protocol
RAVEN is currently a paper protocol: prices and wallet balances are read live from mainnet, but loans, balances, and settlement are simulated. Nothing is custodial and no signature is ever requested. Real on-chain custody ships only after an audit — see Custody & security.

02Architecture

RAVEN runs as a single dependency-free Node service plus a browser client. There is no framework, no database server, and no background job runner — just a tight event loop.

  • Price poller — every 18s, one batched call to the Jupiter Price API values the full collateral catalog and SOL in USD.
  • Loan engine — quoting, opening, repaying, and closing loans; the credit ledger; the fee-split ledger; and an append-only receipt log.
  • The keeper — a 15-second tick that checks every open loan for take-profit, stop-loss, health-floor, and term-expiry conditions and settles the ones that trip.
  • Live feed — a hand-rolled WebSocket pushes every receipt and price update to connected clients, so the dashboard and the landing page update in real time.
wallet readlive pricequoteborrowkeeper 15sresolutionreceipt

03Loan lifecycle

  1. Connect or watch. Connect a wallet (Phantom/Solflare — address only, no signature) or paste any address in watch mode. RAVEN reads your real balances of catalog tokens and prices them live. Empty wallets receive a paper demo bag so the protocol is instantly usable.
  2. Quote. Choose a token, an amount, and a tier. RAVEN returns the SOL principal, the fee, the total repay amount, the term, and the exact liquidation price — all before you commit.
  3. Borrow. The collateral is locked; the SOL principal lands in your balance. The loan is now open, with a fixed due date and liquidation price.
  4. Manage. Optionally arm a take-profit and/or stop-loss (see Auto-protect).
  5. Resolve, one of four ways:
    • Repay — pay the debt in SOL, reclaim your collateral. Credit +40.
    • Close via sell — sell the collateral at the live price, clear the debt, keep the surplus. Credit +40.
    • Auto-sell — your TP or SL fires; the keeper sells, clears debt, returns surplus. Credit +20.
    • Liquidation — the health floor breaks or the term expires; the keeper sells to cover the debt (5% penalty on any surplus). Credit −250.

Every one of these writes a signed, append-only receipt to the public ledger.

04Tiers & LTV

Two collateral classes, each with three tiers. Volatile assets get lower LTV and short terms; lower- volatility real-world assets get more capital, for longer. Fees are flat and quoted up front.

Memecoins & majors

TierMax LTVTermFeeLiq. buffer
Express30%2 days3.00%1.10×
Quick25%3 days2.00%1.15×
Standard20%7 days1.50%1.15×

Tokenized stocks · ETFs · metals (RWA)

TierMax LTVTermFeeLiq. buffer
RWA Express50%7 days3.00%1.08×
RWA Quick60%15 days4.00%1.10×
RWA Standard70%30 days5.00%1.12×

The fee accrues in SOL and is baked into the repay total at open: debt = principal × (1 + fee). Credit tiers can lift your effective LTV and shave the fee — see Credit system.

Class discipline
A memecoin tier can't be applied to an RWA collateral and vice-versa — the engine rejects any quote or borrow where the tier class and the token class don't match.

05Liquidation & the keeper

Your liquidation price is computed at open and never moves. It's the collateral price at which the position's value falls to the debt times the tier's liquidation buffer:

// at open
liqPrice = (debt × liqBuffer × solUsd) / collateralAmount

// every keeper tick (15s), for each open loan
valueSol = collateralAmount × price / solUsd
if (valueSol <= debt × liqBuffer)  liquidate()
if (now > dueAt)                   liquidate()  // term expired

On liquidation the collateral is sold at the live price, the debt is cleared, and any surplus is returned to you minus a 5% liquidation penalty. The 15-second keeper cadence is deliberate — it is six times faster than the ~90-second cadence common to comparable bots, which means tighter execution on both your stops and your liquidation threshold.

06Auto-protect (TP / SL)

This is the differentiator: your collateral keeps working while it's pledged. On any open loan you can arm a take-profit price, a stop-loss price, or both. The same keeper that watches for liquidation watches your levels:

  • Take-profit — when the collateral price rises to your TP, the keeper sells, clears the debt, and returns the surplus SOL to you. You've locked the gain without ever un-pledging.
  • Stop-loss — when the price falls to your SL, the keeper sells early — on your terms, above the liquidation price — so you exit before a forced liquidation and its penalty.

A protected exit is credit-positive (+20), because you resolved the loan responsibly rather than letting it be liquidated.

Why it matters
A normal loan forces a choice: hold the collateral and risk liquidation, or repay early and lose the upside. Auto-protect removes the choice — you get liquidity now, and your exit plan runs itself.

07Pricing & oracles

All collateral is valued in USD from the Jupiter Price API (v3) in a single batched request per cycle, then converted to SOL using the live SOL/USD price from the same source. Tokenized stocks are Backed xStocks, which trade on Solana and price through the same feed.

A token only becomes eligible collateral once it returns a live price at boot; anything unpriced is automatically disabled, so a stale or missing feed can never produce a bad quote. Prices refresh every 18 seconds and stream to clients over WebSocket.

08Credit system — "the raven remembers"

Every wallet has an on-chain credit score from 0 to 1000, starting at 300. It moves with your behavior, and it's the only thing that changes your terms — credit is earned by repaying, never bought by holding.

EventΔ Score
Repay or close-via-sell (clean)+40
Protected exit (TP / SL fired)+20
Late / expired−80
Liquidation−250

Tiers

ScoreTierBenefit
0–599HatchlingBase terms
600–799Fledged+2% LTV on every tier
800–1000Unkindness+4% LTV and −25 bps fee

The bonus is applied at quote time: your effective LTV is the tier LTV plus your credit tier's bonus, and your fee is the tier fee minus the credit discount (floored at 0.50%).

09Fees

Every loan fee splits four ways, recorded on the ledger:

ShareRecipientPurpose
70%$RAVEN holdersPro-rata to holders — no staking, no claim ritual
20%LP poolThe SOL that funds every loan
5%ReferralPaid to the referrer of the borrower, for life
5%ProtocolKeeps the service and keeper running

Referrals are captured with a ?ref=<wallet> parameter at first registration. If a borrower has no referrer, that 5% rolls into the protocol share. Holder distributions activate at token launch; accrual is already live on the ledger today.

10Collateral catalog

Live, curated, and expanding. Every entry is validated against a live price before it's enabled.

Memecoins & majors

BONK · WIF · JUP · POPCAT · PENGU · TRUMP · PUMP · MAGPIE · ATLAS

Tokenized stocks · ETFs · metals

AAPLx · NVDAx · TSLAx · COINx · MSTRx · METAx · GOOGLx · SPYx · GLDx · HOODx

Yes, really
$MAGPIE is an accepted collateral on RAVEN. No hard feelings. 🪶

11Custody & security

RAVEN's trust model is the whole pitch, so it's worth being blunt about it.

  • No keys, ever. Connecting a wallet uses provider.connect() to read your public address only. RAVEN never requests a transaction signature and cannot move your funds. Compare that to a custodial Telegram bot where "your wallet is the bot wallet."
  • Paper today. In the current phase, loans and balances are simulated on real, live prices. Nothing you do here touches your on-chain assets — which means nothing here can lose them.
  • Audit before custody. Real on-chain lending and custody ship only after a third-party audit of the on-chain program. Until then, every "paper" label on the site is literal and intentional.
  • Everything is a receipt. Borrows, repays, auto-sells, liquidations, and fee splits are all written to an append-only public ledger and streamed live. Nothing happens off the record.

12API reference

Read endpoints are open. Actions take a JSON body over POST.

EndpointMethodReturns
/api/configGETtiers, fee split, credit params
/api/catalogGETcollateral list + live prices
/api/statsGETprotocol totals, LP, fees
/api/quoteGETprincipal, fee, debt, liq price
/api/accountGETvault, loans, credit
/api/receiptsGETrecent ledger receipts
/api/registerPOSTread a wallet's bag
/api/borrowPOSTopen a loan
/api/protectPOSTarm TP / SL
/api/repayPOSTrepay in SOL
/api/closePOSTclose via sell

Example — quote a loan:

# 300 WIF, Express tier, credit 300
GET /api/quote?mint=<WIF_MINT>&amount=300&tier=express&credit=300

{ "tier":"Express", "ltv":0.30, "principal":0.198,
  "fee":0.0059, "debt":0.204, "liqPriceUsd":0.0618,
  "days":2, "creditTier":"Hatchling" }

13Disclosures

RAVEN is an experimental, paper lending protocol. Prices and wallet reads are real; loans, balances, settlement, and custody are simulated until an on-chain program is audited and deployed. $RAVEN is a memecoin with no promise of value, yield, or profit, and nothing here is financial advice. Tokenized stocks referenced are Backed xStocks priced via Jupiter and are not offered, endorsed, or issued by RAVEN. Never risk what you can't afford to lose. The raven remembers — and so does the chain.