Everything below is what the code does, in the order it does it. If a number cannot be reproduced from the chain, it does not ship, and the places where the method stops are listed at the bottom rather than hidden.
Profit and loss tells you what a trade paid. It says nothing about the trade that kept running after you closed it. The fumble is that second number: for every sell, the highest price the token reached after you were out, priced against what you actually took.
The wallet total is the sum over every position. Nothing is annualised, nothing is weighted, and a position you never sold is not counted at all, because there is no exit to judge.
One real position from a wallet on Robinhood Chain, the same one the site shows as an example:
The top is read from the launchpad curve itself, fill by fill, not from a candle. On a chain that produces ten blocks a second a candle is a summary; the curve is the record.
Robinhood Chain. No indexer exists for it, so the reader is ours. Transfers come back raw from
eth_getLogs, get regrouped into transactions, and each trade is priced by the money that
actually moved. A routed sell can leave nothing in the wallet as a token: those are priced from the
launchpad curve, which names its own payout token, or by netting every Uniswap v4 swap in the receipt
per currency, with the pool's currencies resolved from that pool's own Initialize event.
If a pool cannot be read, the trade is not priced at all rather than guessed.
Solana. Trades come from the wallet's history and peaks from a price provider, and every peak above fifteen times is re-checked against independent hourly and daily candles before it counts. A peak that cannot be reproduced is lowered to what the candles show, or dropped. One provider once reported a token at eleven times its real top, which would have printed a seventy three million dollar fumble. That check exists because of it.
Expectancy, payoff, win rate and the median hold time for winners against losers all come from the same trade list, with no outside data. The exit rules are replayed over the wallet's own positions: a rule is only worth what it would have added to those exact trades, which is the number shown.
The regret engine and the coach are C++17 with their own tests, the chain readers and the server are Python, and CI builds and runs both on every push. It is all here: github.com/FomothFumble/fomoth.