Rivisk

Know where your Bitcoin risk lives.

Your sBTC sits in a wallet, a lending market and a payment stream at the same time — and every protocol only shows you its own slice. Rivisk reads all of them, normalizes the positions, and turns them into one explainable risk picture you can stress and verify.

Read-only. Rivisk never takes custody or asks for a seed phrase.
Indexed/SP2ABC…92DF#184,233
44.8Risk / 100
Net value$31,842
Health factor1.47
Liquidation distance18.0%
Protocol concentration44.0%
Liquidation horizonBTC -20%1.20
0-5-10-15-20-25-30-35-40

Health factor compares the position against the protocol's partial-liquidation threshold. Above 1.00 it sits clear of that threshold; at or below, it has crossed it and may become eligible for liquidation under the protocol's own rules.

SHA-2563f8a9b21c47e05d8aa…rivisk-v1.2
Illustrative
The problem

Three protocols. Three answers. No portfolio.

Each source is honest about its own position and blind to every other one. Nothing in the stack tells a holder or a treasury what their total Bitcoin exposure actually is, or what breaks first when the market moves.

SRC 01/ZEST-V2
Collateral
$14,200
Borrowed
$6,000
Health factor
1.54
Field of viewZSTBTPWAL
SRC 02/BITPAY
sBTC locked
0.035
Withdrawable
0.009
Unvested
0.016
Field of viewZSTBTPWAL
SRC 03/WALLET
sBTC
0.080
STX
4,120
USDC
2,400
Field of viewZSTBTPWAL

The three codes in each footer are the data sources. Only the lit one is visible to that protocol; the struck-through codes are the positions it cannot see — which is why no single row adds up to a portfolio.

Three is what Rivisk reads today, not what it is limited to. Each source is an adapter behind one interface, so the next venue changes nothing above it — not the portfolio engine, the risk engine, the API or this page.

Normalized/3 sources · 1 portfolioIllustrative

Total sBTC exposure

0.184sBTC

Immediately liquid

59%

Locked / vesting

17%

Collateralized

24%

How it works

Four steps, and every one of them is auditable.

Rivisk is built so a reviewer can follow a number from the chain all the way to the screen without trusting us in between.

01/DISCOVER

Discover positions

A protocol adapter per venue reads native Stacks balances, lending obligations and stream state, then emits one normalized position shape. Nothing above the adapter learns which protocol it came from.

Emits

NormalizedPosition[]
02/SCORE

Calculate risk

Deterministic formulas — no model, no opinion — produce collateral value, debt, current LTV, health factor, liquidation distance and concentration. Same inputs, same numbers, every time.

Emits

PortfolioRiskSummary
03/STRESS

Stress the portfolio

Shock BTC or STX and the lending position is recalculated against the protocol's own thresholds, not just marked down on screen. Scenarios that cross into liquidation are flagged.

Emits

StressScenarioResult[]
04/ATTEST

Verify the report

The full report is canonicalized and hashed with SHA-256, and stored alongside its digest. That digest can then be anchored in Rivisk's Clarity registry, so anyone can re-hash the JSON and confirm nothing was edited after the fact.

Emits

risk-registry.clar
Stress testing

See how close a position is to breaking, before it does.

Shocks are applied to the latest indexed positions and re-scored against each protocol's own liquidation thresholds. Rivisk marks positions with its own price source, so these are modeled estimates rather than a protocol's execution-time verdict. Nothing is executed and no funds move.

Stress curve/sBTC collateral

Health factor under BTC drawdown

Modeled partial-liquidation threshold at 1.00

A 35% BTC drawdown is estimated to take this position to 0.98 — across its modeled partial-liquidation threshold. Rivisk raises that as a breach rather than leaving it in a table.

Basis/block 184,233·coverage 98.4%rivisk-v1.2
ExposureIllustrative

Where the capital sits

Share of gross exposure by protocol

  • Zest lending44%
  • Wallet31%
  • BitPay streams17%
  • Other8%

Concentration is scored on gross exposure, so a leveraged position cannot hide behind a small net number.

Metric/protocolConcentrationBps
Attestations

Don't trust the dashboard. Re-hash the report.

The heavy analytics stay off-chain, where they can read prices and protocol state. What goes on-chain is the commitment — a 32-byte digest anyone can check against the JSON we served them. The whole pipeline runs on Stacks testnet today: Rivisk hashes the report, the authorized publisher writes the attestation, and Chainhook confirms it back.

  • Full report kept off-chain and served alongside its digest
  • Snapshot history is append-only — nothing is overwritten
  • Freshness is readable on-chain, so stale risk can be rejected
  • Publisher key lives in a worker, never in the API process
  • Testnet attestations are live, throttled to changed risk or a minimum block interval
  • Contracts hold zero user funds — reads only, by design
Attestation pipelineIllustrative
  1. Canonical report

    Positions, prices, metrics, source block and methodology version, serialized deterministically.

    snapshot-15.json
  2. SHA-256 commitment

    The report is hashed off-chain. Change a single value and the digest no longer matches.

    3f8a9b21…c6d120
  3. Anchored in Clarity

    An authorized publisher writes the digest to the deployed testnet risk-registry.clar with the source block and freshness, and Chainhook confirms the on-chain snapshot id back into the API.

    risk-registry.clar

Digest matches the served report

Protocol adapters

Adapters understand protocols. Nothing above them has to.

Every venue implements the same interface and emits the same normalized position. Adding the next protocol does not mean touching the portfolio engine, the risk engine, the API or the dashboard.

WalletLive

Native Stacks

STX plus SIP-010 balances with sBTC resolved per network, token metadata resolved before valuation, and exact on-chain quantities preserved even when pricing is unavailable.

Reads

STXsBTCSIP-010

Verified on mainnet

Balance and FT reads
live mainnet

Exercised against mainnet Hiro endpoints, including read-only contract calls.

LendingLive-validated

Zest Protocol V2

Reads the wallet obligation from the market vault, converts zToken collateral to underlying and scaled debt via the borrow index, then pulls borrow and liquidation LTVs straight from the egroup registry.

Reads

CollateralDebtLTV bands

Verified on mainnet

Scaled debt read
exact match
Debt vs Zest own figure
x0.99985

Checked against a live mainnet position, block 9031697.

StreamingOff in the beta

BitPay streams

Discovers sender and recipient streams and splits locked, vested, withdrawn and currently withdrawable sBTC — the capital a wallet owns economically but cannot spend right now.

Reads

LockedVestedWithdrawable

No contract to read yet

Unit tested
yes
Live on current testnet
no contract

The reader matches bitpay-core's interface, but no BitPay contract exists on the current Stacks testnet, so the adapter stays disabled in the beta.

Bring your own protocol

An adapter produces normalized collateral and debt assets plus the protocol's own thresholds. Rivisk reuses the same LTV, health-factor and liquidation arithmetic for all of them.

// packages/adapter-core
interface ProtocolAdapter {
  metadata(): ProtocolMetadata;
  supports(addr, ctx): Promise<boolean>;
  getPositions(addr, ctx): Promise<
    NormalizedPosition[]
  >;
}
Built to be consumed

Risk is a dependency, not a feature every product rebuilds.

A yield router should not have to index Stacks, read Zest debt, derive health factors and run stress scenarios in order to tell a user whether a position is safe. It should be able to ask — and get an answer that covers every protocol the wallet touches, not just its own.

OFF-CHAIN/REST and typed SDK
GET /api/v1/portfolios/{address}/risk

The full picture: normalized positions, collateral health, liquidation distance, concentration, stress scenarios, alerts and signed webhooks.

ON-CHAIN/Clarity trait
(contract-call? .risk-registry get-risk-if-fresh user u144)

The compact attested subset another contract can act on, with a SHA-256 digest of the full report and a freshness bound that cannot be skipped.

01/YIELD ROUTERS

“Is this wallet safe to route into another position?”

Reads
Risk scoreConcentrationStress results
Via
REST / SDK
02/AUTONOMOUS AGENTS

“Should I take this action, or has the portfolio moved against me?”

Reads
Health factorLiquidation distanceFreshness bound
Via
Clarity trait
03/LENDING PRODUCTS

“What does this borrower look like outside my own protocol?”

Reads
Cross-protocol debtCollateral healthLTV bands
Via
Clarity trait / REST
04/TREASURIES AND WALLETS

“What is our total exposure, and what breaks first?”

Reads
Portfolio valueConcentrationAlerts and policy
Via
SDK / webhooks

These are the integration shapes Rivisk is built for. The API, SDK, signed webhooks and the Clarity trait are implemented and tested; no third-party product is consuming them yet, and nothing here should be read as a partnership.

For developers

Don't rebuild a risk engine inside your wallet.

The same deterministic metrics the dashboard renders are available over REST, a typed client, signed webhooks and a Clarity trait — so wallets, treasuries, protocols and other contracts can ship risk without owning an indexer.

  • WS

    Realtime

    Address-scoped Socket.IO rooms push portfolio, risk and breach events the moment a snapshot lands.

  • ALERT

    Edge-triggered alerts

    A rule fires when a metric crosses into breach — not on every snapshot while it stays there.

  • CLAR

    On-chain reads

    Another Clarity contract can read a wallet's attested risk through risk-provider-trait, with a freshness bound that returns none rather than a stale number.

  • HOOK

    Signed webhooks

    Risk events delivered to your endpoint, HMAC-signed with a per-endpoint secret, with delivery records and retry backoff.

import { RiviskClient } from "@rivisk/sdk"; const rivisk = new RiviskClient({ baseUrl, apiKey }); await rivisk.portfolios.risk(addr);await rivisk.simulations.run(addr, {  shocks: [{ symbol: "sBTC", changeBps: -2000 }],});await rivisk.webhooks.create(url, ["risk.updated"]);

Published as @rivisk/sdk@0.1.0 on npm. Responses carry the source block and valuation coverage, so a caller always knows which chain state a number came from.

01

Non-custodial

Public addresses in, analytics out. No seed phrases, no signing keys, no funds held.

02

Deterministic

Risk is arithmetic, not a model. AI may explain a metric; it never computes one.

03

Explainable

Unknown assets stay unvalued and coverage drops, rather than being quietly guessed.

04

Protocol-neutral

Rivisk analyses venues without steering capital toward any of them.

Bitcoin capital became programmable. Give it observability.

Paste an address and see the whole position — wallet, lending and streams — scored, stressed and hashed in one pass.