Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/collinsville22/Sable/llms.txt

Use this file to discover all available pages before exploring further.

Portfolio

Unified dashboard showing all user positions across every Sable product in one place.

Overview

The Portfolio page aggregates data from:
  • Vault positions (yvBTC shares)
  • Staking positions (vWBTC)
  • CDP positions (collateral + debt)
  • DCA orders (active and completed)
  • Shielded notes (private deposits)

Tracked Positions

CategoryData ShownSource
Vault PositionsShare balance, current value, unrealized PnL per vaultOn-chain vault contracts
Staking PositionsvToken balance, staked amount, earned rewardsVesu Singleton contract
CDP PositionsCollateral value, debt value, health factor, liquidation priceCDP contract + Nostra
DCA OrdersActive orders, executed count, total bought, refundable amountDCA contract
Shielded NotesNumber of active notes, denomination, poolBrowser localStorage

Wallet Summary

Top section shows wallet balances:
┌──────────────────────────────────────────────────────────┐
│                    WALLET SUMMARY                              │
├──────────────────────────────────────────────────────────┤
│ WBTC Balance:  0.00123456 WBTC ($123.45)                      │
│ USDC Balance:  $456.78 USDC                                   │
│ Wallet:        0x0362A762...fBC3ABbc                          │
└──────────────────────────────────────────────────────────┘

Vault Positions

For each vault, the portfolio shows:
Summary Row:
  • Vault name + strategy tag + risk badge
  • Total position value (USD)
  • Current APY
  • Expand/collapse toggle
┌─────────────────────────────────────────────────┐
│ B  Sable Sentinel  [LEND] [Low Risk]             │
│    Value: $123.45        APY: 8.2%          ▼    │
└─────────────────────────────────────────────────┘

Position Calculations

yvBTC Value:
wbtc_value = share_balance × share_price
share_price = vault.total_assets() / vault.total_supply()

Example:
  Shares: 0.00234567 yvBTC
  Share price: 1.0284 WBTC
  WBTC value: 0.00241234 WBTC
USD Value:
usd_value = wbtc_value × btc_price

Example:
  WBTC value: 0.00241234 WBTC
  BTC price: $97,234
  USD value: $234.56

Staking Positions

For each Vesu pool:
┌─────────────────────────────────────────────────┐
│ S  Vesu PRIME  [STAKE]                            │
│    Value: $100.00                          ▼    │
├─────────────────────────────────────────────────┤
│ vWBTC:         0.00095123                         │
│ WBTC Value:    0.00100234 WBTC                    │
│ USD Value:     $100.00                            │
├─────────────────────────────────────────────────┤
│ [Manage Stake] | [View on Voyager]               │
└─────────────────────────────────────────────────┘

vToken to WBTC Conversion

wbtc_value = vToken_balance × exchange_rate
exchange_rate = pool.total_assets() / pool.total_supply()

Example (PRIME pool):
  vWBTC balance: 0.00095123
  Exchange rate: 1.0538 WBTC per vWBTC
  WBTC value: 0.00100234 WBTC

CDP Position

┌─────────────────────────────────────────────────┐
│ C  BTC-Backed CDP  [CDP]                          │
│    Net Equity: $75.00    Health: 1.8x       ▼    │
├─────────────────────────────────────────────────┤
│ Collateral:    0.001 WBTC ($100.00)               │
│ Debt:          $25.00 USDC                        │
│ LTV:           25.0%                              │
│ Liq. Price:    $35,714                            │
├─────────────────────────────────────────────────┤
│ [Manage Position] | [View on Voyager]            │
└─────────────────────────────────────────────────┘

CDP Metrics

Net Equity:
net_equity = collateral_usd - debt_usd

Example:
  Collateral: 0.001 WBTC ($100)
  Debt: $25 USDC
  Net equity: $75
Health Factor:
health_factor = (collateral_usd × 0.75) / debt_usd

Example:
  Collateral: $100
  Debt: $25
  Health: ($100 × 0.75) / $25 = 3.0
Liquidation Price:
liq_price = (debt_usd × 100) / (collateral_btc × 70)

Example:
  Debt: $25
  Collateral: 0.001 BTC
  Liq price: ($25 × 100) / (0.001 × 70) = $35,714

DCA Orders

┌─────────────────────────────────────────────────┐
│ D  DCA Orders  [DCA]                              │
│    BTC Received: 0.00123456                  ▼    │
├─────────────────────────────────────────────────┤
│ Order #42 [SMART]                                 │
│   Progress: 6/12 executed                        │
│   [███████████████───────────────] 50%                │
│   Received: 0.00123456 WBTC                      │
│   Refundable: 90 USDC                            │
├─────────────────────────────────────────────────┤
│ [Manage DCA] | [View on Voyager]                 │
└─────────────────────────────────────────────────┘

DCA Metrics

Progress:
progress = executed_orders / total_orders

Example:
  Executed: 6
  Total: 12
  Progress: 50%
Refundable (Smart DCA only):
refundable = deposited - spent

Example:
  Deposited: 180 USDC (10 × 12 × 1.5)
  Spent: 90 USDC (6 orders executed)
  Refundable: 90 USDC

Shielded Notes

┌─────────────────────────────────────────────────┐
│ Shielded Notes (5)                   [Manage]    │
├─────────────────────────────────────────────────┤
│ 0.0002 WBTC  sentinel_1x   [Confirmed]          │
│ 0.0004 WBTC  sentinel_2x   [Confirmed]          │
│ $10 USDC    stable_10     [Pending]            │
│ 0.00036 BTC dn_1x         [Confirmed]          │
│ 0.0002 WBTC  swap_1x       [Confirmed]          │
├─────────────────────────────────────────────────┤
│ Total: 0.00156 WBTC + $10 USDC                   │
└─────────────────────────────────────────────────┘

Note Status

  • Confirmed: Note has been inserted into Merkle tree (withdrawable)
  • Pending: Note awaiting batch processing (not yet withdrawable)
Notes are stored in browser localStorage. Export and backup regularly to prevent fund loss.

Note Management

Expanded view provides:
  • Copy All Notes: Export all notes as JSON
  • Import Notes: Paste JSON to import notes from backup

Data Sources

DataSourceUpdate Frequency
Vault balancesOn-chain vault contractsReal-time (RPC call)
Vault share pricestotal_assets() / total_supply()Real-time
Vault APYSable API + Vesu APICached (5 min)
Staking balancesVesu SingletonReal-time
CDP positionsCDP contract + NostraReal-time
DCA ordersDCA contractReal-time
Shielded notesBrowser localStorageInstant
BTC priceCoinGecko APICached (1 min)

PnL Tracking

PnL tracking is not yet implemented. Current version shows position values only, not profit/loss since deposit.
Planned features:
  • Historical deposit tracking
  • Unrealized PnL per position
  • Realized PnL on withdrawals
  • Total portfolio performance
  • Time-weighted returns

Empty State

If wallet has no positions:
┌─────────────────────────────────────────────────┐
│                                                  │
│                ┌──────────────┐               │
│                │   No Positions   │               │
│                │      Yet         │               │
│                └──────────────┘               │
│                                                  │
│  Connect your wallet and deposit into a vault   │
│  to start earning BTC yield on StarkNet.        │
│                                                  │
│           [Explore Vaults]                      │
│                                                  │
└─────────────────────────────────────────────────┘

Technical Implementation

Data Fetching

Portfolio aggregates data from multiple contracts in parallel:
const fetchPortfolio = async (address: string) => {
  const [
    vaultPositions,
    stakingPositions,
    cdpPosition,
    dcaOrders,
    notes
  ] = await Promise.all([
    fetchVaultPositions(address),
    fetchStakingPositions(address),
    fetchCdpPosition(address),
    fetchDcaOrders(address),
    getUnspentNotes()  // From localStorage
  ]);
  
  return {
    vaultPositions,
    stakingPositions,
    cdpPosition,
    dcaOrders,
    notes
  };
};

Caching Strategy

  • On-chain data: Fetched on page load, refetched every 30s
  • API data (APY, prices): Cached 5 min
  • LocalStorage data (notes): Instant, no network calls

Best Practices

  1. Check Portfolio Daily: Monitor health factors and DCA progress
  2. Export Notes Weekly: Backup shielded notes to prevent loss
  3. Withdraw Dust: Small positions earn less than gas costs
  4. Rebalance: Move funds from low-APY to high-APY vaults
  5. Track Off-Chain: Use spreadsheet for manual PnL tracking until feature ships

Next Steps

View Your Portfolio

Check your positions now

Deposit into Vaults

Start earning yield

Backup Shielded Notes

Export notes for safekeeping

Monitor Health Factors

Avoid liquidations