How Mezzi Calculates Realized and Unrealized Gains and Cost Basis

Last updated: November 11, 2026

Overview

An unrealized gain is the current market value of a position you still hold minus its cost basis: profit on paper, not yet taxable. A realized gain or loss comes from positions you've sold, calculated from the sale proceeds against the cost basis of what was sold. Mezzi matches each sale to your oldest shares first (first in, first out, or FIFO), so if your brokerage uses a different lot method, Mezzi's realized gain on that sale can differ from your brokerage's. Both figures depend on the cost basis and transaction history your institution sends through the connection.


📌 What You Need to Know

Unrealized gains

For every holding you still own, Mezzi compares the position's current market value against its cost basis:

Unrealized gain = market value − cost basis

Market value comes from the current price of the security multiplied by the quantity your institution reports. Cost basis comes from your institution. Neither is calculated by Mezzi from scratch, which is why an unrealized figure can be missing or odd when either input is missing, most commonly for holdings without a public ticker, where there's no price to mark against.

Realized gains

A realized gain or loss appears when a position is sold. Mezzi matches the sale against the cost basis of the shares sold and records the difference.

This depends on the transaction history your institution sends. If a sale happened before the period of history your institution shares, or the transaction never came through, the realized gain won't appear. See Why Are Some of My Transactions Missing?

How Mezzi matches sales to tax lots (FIFO)

When you've bought the same investment at different times and prices, each purchase is a separate tax lot. When you sell part of the position, Mezzi currently assumes the oldest shares were sold first: first in, first out (FIFO).

Many brokerages let you choose a different method, such as specific lot identification or Schwab's Tax Lot Optimizer, which often sells higher-cost lots first. When your brokerage relieved different lots than FIFO would, Mezzi's realized gain on that sale won't match your brokerage's, and a sale your brokerage reports as a loss can show as a gain in Mezzi. For those sales, your brokerage's realized gain/loss report and your 1099-B are the figures to rely on. Choosing a lot method in Mezzi isn't available yet.

Selling and buying back starts a new cost basis

If you sell a position and buy it back later, the shares you bought back have a new cost basis: the price you paid for them. The gain on the shares you sold is recorded once, as a realized gain.

Example (illustrative): you buy 100 shares at $115, sell all 100 at $190, then buy 100 again at $193. The sale realizes a gain of $7,500 (100 × $75). The new shares' cost basis is $193, so their unrealized gain is measured from $193, not $115. Measuring from $115 would count the same $7,500 twice.

These are not tax documents

Mezzi's gain figures are for understanding your portfolio, not for filing. They don't apply wash-sale adjustments, they don't distinguish short-term from long-term treatment for tax purposes, and they don't replace the 1099-B your brokerage issues. Use Mezzi to see where you stand and to plan; use your brokerage's tax forms to file.

Crypto is a known weak spot

Realized gain and loss figures on crypto exchange connections can be inaccurate, because exchanges send transfers, conversions and trades inconsistently. See Why is my Coinbase realized gain/loss inaccurate in Mezzi? before assuming a crypto figure is wrong on Mezzi's side.


Important Notes

Gains are not the same as performance. A return percentage measures how your money performed over a period and should exclude money you moved in or out. A gain measures value against what you paid. The two answer different questions and won't agree. See Why Do Performance Numbers Differ From My Brokerage?

Holdings without a ticker distort both. If a position can't be priced, its market value can't be marked and its unrealized gain is unreliable. Employer retirement plan funds are the usual case. Mezzi can track them through a similar public fund; see How to Set a Proxy for a Holding.

Manually added assets behave differently. Real estate, vehicles and other assets you enter yourself are modelled as a straight line from purchase price to current value, so their "gain" is simply the difference between the two values you supplied. There is no daily mark.


🗨 Still Need Help?

If a gain figure looks wrong, email help@mezzi.com or text/call (415) 763-6997 with the account name, the holding, the figure Mezzi shows, the figure your brokerage shows, and the lot method your brokerage uses for that account, if you know it.

Common Questions

  • Which cost basis method does Mezzi use? First in, first out (FIFO): a sale is matched to your oldest shares first.

  • Why does Mezzi show a gain when my brokerage shows a loss? Your brokerage probably sold different tax lots than FIFO would, for example with specific lot identification or Schwab's Tax Lot Optimizer. Rely on your brokerage's realized gain/loss report for that sale.

  • Can I choose LIFO or specific lots in Mezzi? Not yet. Mezzi uses FIFO for all accounts.

  • Why did my cost basis change after I sold and bought back? The shares you bought back started a new cost basis at the price you paid. The gain on the shares you sold is shown separately as a realized gain.

  • Why is my unrealized gain missing for one holding? Usually because cost basis didn't come through for that position, or the security has no public price to mark against. Send us the account and holding name and we'll check what your institution is returning.

  • Does Mezzi track short-term versus long-term gains? Not as tax treatment. Mezzi shows gains against cost basis; the holding-period classification that matters for your tax return comes from your brokerage's tax reporting.

  • Will Mezzi show a realized gain for a sale from years ago? Only if that transaction is within the history your institution shares. Older activity generally isn't available.

  • Do dividends count as realized gains? No. Dividends are income, not a sale, and appear in Mezzi's income and dividend figures rather than in realized gains.