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
| Category | Data Shown | Source |
|---|
| Vault Positions | Share balance, current value, unrealized PnL per vault | On-chain vault contracts |
| Staking Positions | vToken balance, staked amount, earned rewards | Vesu Singleton contract |
| CDP Positions | Collateral value, debt value, health factor, liquidation price | CDP contract + Nostra |
| DCA Orders | Active orders, executed count, total bought, refundable amount | DCA contract |
| Shielded Notes | Number of active notes, denomination, pool | Browser 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:
Collapsed View
Expanded View
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% ▼ │
└─────────────────────────────────────────────────┘
Detailed Position:
- yvBTC shares held
- WBTC value (current)
- USD value
- Share price
- On-chain strategy state (if available):
- Collateral
- Debt
- Health factor
- Loops
- Status (Active/Paused)
- Net equity
- Actions: Deposit/Withdraw, View on Voyager
┌─────────────────────────────────────────────────┐
│ B Sable Trident [LOOP] [Med Risk] │
│ Value: $234.56 APY: 12.5% ▲ │
├─────────────────────────────────────────────────┤
│ yvBTC Shares: 0.00234567 │
│ WBTC Value: 0.00241234 WBTC │
│ USD Value: $234.56 │
│ Share Price: 1.0284 WBTC │
├─────────────────────────────────────────────────┤
│ On-Chain State: │
│ Collateral: 0.0072 xWBTC │
│ Debt: 0.0048 WBTC │
│ Loops: 3 │
│ Health: 1.85 (Safe) │
│ Net Equity: $234.12 │
│ Status: Active │
├─────────────────────────────────────────────────┤
│ [Deposit / Withdraw] | [View on Voyager] │
└─────────────────────────────────────────────────┘
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
| Data | Source | Update Frequency |
|---|
| Vault balances | On-chain vault contracts | Real-time (RPC call) |
| Vault share prices | total_assets() / total_supply() | Real-time |
| Vault APY | Sable API + Vesu API | Cached (5 min) |
| Staking balances | Vesu Singleton | Real-time |
| CDP positions | CDP contract + Nostra | Real-time |
| DCA orders | DCA contract | Real-time |
| Shielded notes | Browser localStorage | Instant |
| BTC price | CoinGecko API | Cached (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
- Check Portfolio Daily: Monitor health factors and DCA progress
- Export Notes Weekly: Backup shielded notes to prevent loss
- Withdraw Dust: Small positions earn less than gas costs
- Rebalance: Move funds from low-APY to high-APY vaults
- 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