For the complete documentation index, see llms.txt. This page is also available as Markdown.

Portfolio P&L

Upshift calculates profit and loss (P&L) for each vault position. This page explains the calculation, its data sources, and its limits.

Summary

P&L measures the difference between assets deposited into and withdrawn from Upshift. Transfers and collateral pledges on third-party protocols are not tracked. These actions can make P&L incorrect for that position.

Formula

Lifetime P&L=Current Position Value+Total WithdrawnTotal Deposited\text{Lifetime P\&L} = \text{Current Position Value} + \text{Total Withdrawn} - \text{Total Deposited}

Total deposited

Sum of every vault deposit at face value. One deposited unit counts as one unit, with no live re-quote. Any entry fee reduces the shares a deposit receives. The fee is therefore counted as a P&L cost automatically.

Total withdrawn

Sum of every completed withdrawal, converted from shares to assets at the share price when the withdrawal is read.

Current position value

The wallet's live on-chain balance: shares times the current share price. This is what the position is worth if closed at that time.

Upshift shows P&L in the vault's native asset. It also shows a USD value and percentage, using the underlying asset's live USD price.

What counts as a deposit or withdrawal

Only activity Upshift can see and index counts toward the calculation:

  • On-chain deposits and withdrawals, including instant and request/claim flows, against the vault contract.

  • Cross-chain LayerZero deposits and redeems for vaults that support them.

  • Multi-asset deposits, tracked using each asset's own decimals, then rescaled to the vault's reporting decimals.

For example, a vault accepting USDC with 6 decimals and RLUSD with 18 decimals sums both correctly.

What P&L does not track

Safeguard: refusing to show a fabricated number

Edge cases

Case
Behavior

Fully exited, then re-entered

Computable. Withdrawal records confirm that the history loaded, even with a zero current balance.

Zero position, no history

Reports zero P&L.

Cross-chain vaults

Includes remote-chain deposits, redeems, and receipt-token balances in current position value and total withdrawals.

Closed vaults

Appears only when the position remains in the portfolio list. The position must surface there before Upshift can show P&L.

Data sources

Current balances and share prices come from live on-chain reads.

Deposit and withdrawal history comes from indexed events. Sources include subgraph-indexed events and the newer history API for closed-vault records.

When indexing is incomplete or stale, a live position without indexed history shows as History unavailable. This safeguard cannot detect every indexing gap. A position with some indexed deposits can still be affected by unrelated missing history.

Last updated