Methodology

How the f(x) research dashboard calculates trader and protocol metrics

This dashboard combines public f(x) Protocol subgraph data, indexed cashflows and current position snapshots to build trader profiles, capital-flow research, protocol-health cards and ranking tables. Values are research estimates for transparency and monitoring; they are not trading, investment, tax or legal advice.

Coverage

Four official f(x) pools

ETH/BTC long and short pools are tracked. Wallets are filtered to valid 0x addresses; literal NULL strings and unknown system rows are excluded from trader rankings.

PnL source

Official order stream first

Realized PnL prefers the official f(x) order stream when the latest synced order block is at least as fresh as the latest indexed cashflow block.

Freshness guard

No stale UI PnL

ui_realized_pnl_usd is used only when ui_last_order_block >= last_cashflow_block. Otherwise the dashboard falls back to cashflow-derived realized PnL.

Data pipeline

What data is read

LayerTable / sourcePurpose
Current position bookfx_current_positionsOpen-position owner, collateral, debt, equity, oracle price, debt ratio and current PnL inputs.
Historical cashflowsfx_position_cashflowsManager-source deposits, withdrawals, debt changes, fees and first/last activity timestamps.
Official f(x) positionsfx_official_positionsCanonical owner / real owner, pool metadata, closed/open state and raw position state from the official f(x) subgraphs.
Official f(x) ordersfx_official_position_ordersExecution-price order history used for UI-aligned entry price, realized PnL and order-count freshness.
Position PnL cachefx_position_pnlPer-position cashflow aggregates plus official-order UI PnL columns and freshness guards.

Coverage

Tracked pools

MarketSideInstrumentInterpretation
ETH LonglongETHwstETH collateral, long-side debt
ETH ShortshortETHfxUSD collateral, borrowed ETH exposure
BTC LonglongBTCWBTC collateral, long-side debt
BTC ShortshortBTCfxUSD collateral, borrowed BTC exposure

PnL methodology

Realized, unrealized and total PnL

Realized PnL

Realized PnL is computed from official f(x) execution prices using a weighted-average entry model over Open/Add and Reduce/Close/Liquidate/WithdrawRepay/Withdraw orders. For shorts, the calculation uses debt-token size from deltaDebts and flips the direction so falling prices are profitable.

Unrealized PnL

Open-position unrealized PnL uses current oracle prices. Shorts prefer official-order UI unrealized PnL. Long displays intentionally use the raw entry-price fallback instead of long-side ui_entry_price_usd, because long order enrichment can have misleading decimal scales.

Total PnL

Trader total PnL is realized PnL from indexed position history plus current unrealized PnL from open positions. Top Traders and profile pages use the same ownership and PnL methodology.

Order sync

How official f(x) order history is kept complete

  • Official f(x) subgraph orders are fetched with skip-based pagination in 1,000-order pages, so positions with more than 1,000 orders are not truncated.
  • The incremental candidate set includes positions with recent cashflows, positions whose cashflow block is newer than the last synced official-order block, and current positions missing official-order coverage.
  • Order rows are de-duplicated by official order id and sorted by block number and log index before entry/PnL calculations.
  • A client timeout while calling the long-running sync endpoint is inconclusive; database freshness and enrichment output are the verification source.

Trader rankings

No opaque composite score as the default

TabWhat it ranks
Top PnLDefault ranking. Sorts wallets by total PnL = realized PnL + unrealized PnL, descending. Positive PnL ranks above negative PnL.
Top ROISorts by total PnL divided by capital used. Wallets must have at least $1K of capital/notional to reduce tiny-wallet noise.
Best Realized PnLSorts by closed-position realized PnL only. Unrealized gains are shown separately but do not drive this tab.
Most ActiveSorts by total position count. This measures activity/churn, not trading performance.
Whale TradersSorts by current notional exposure. This measures size, not trading performance.

Capital flows

How deposits and withdrawals are converted to USD

Flow typeConversion
Long BTC collateralcollateral_raw / 1e8 × latest WBTC pool oracle
Long ETH collateralcollateral_raw / 1e18 × latest wstETH pool oracle
Short collateralcollateral_raw / 1e18 because short-side collateral is fxUSD-denominated
Net flowdeposits minus withdrawals in the selected 7d / 30d / all-time window

Research sections

What the research hub measures

Research cards

Cards surface live signals and open a drill-down brief. Each brief links to a verifiable source view such as capital flows, a trader profile, a position page or the conviction tracker.

Trader archetypes

Archetypes are rule-based classifications over current exposure, position count, notional size, directional bias and liquidation proximity. They are labels, not performance scores.

Conviction tracker

Highest Conviction Positions are ranked by large open exposure weighted by debt-ratio pressure. This measures committed exposure and liquidation headroom, not skill.

Protocol health

Protocol Health cards explain TVL, open interest, long/short ratio, average leverage, net deposits, active traders, liquidation risk and fee generation.

Known limitations

How to read the numbers safely

  • Values depend on the latest indexed subgraph rows, current position snapshots and oracle prices. They are refreshed periodically, not via a live browser-side subscription.
  • Official-order PnL is treated as the preferred UI-aligned source only after passing the freshness guard against cashflows.
  • Cashflow fallback PnL can differ from f(x) UI execution-price PnL, especially for shorts, because short collateral movements are fxUSD-denominated rather than direct execution-price profit/loss.
  • Liquidation-risk displays are debt-ratio proximity signals, not predictions that a liquidation will occur.
  • Metrics may differ from other dashboards because each site can use different coverage, refresh timing, owner attribution and calculation methods.