Skip to content

Glossary

Term Definition
AMM Automated Market Maker. The platform acts as the sole counterparty to every trade. There is no peer-to-peer order book.
AMM curve The linear bonding curve formula: P = base_price + k × net_shares_sold. Every buy increases net_shares_sold (price goes up); every sell decreases it (price goes down).
CFD Contract for Difference. A synthetic position on a price rather than ownership of a real asset. FTL instruments behave like CFDs — users hold a position whose value tracks the AMM price, with no underlying asset.
lot size The minimum tradeable quantity per order. In FTL v1, one lot equals one share.
margin The virtual points locked as collateral to hold an open position.
equity The real-time value of a user's account: equity = wallet_balance + sum of unrealized P&L across all open positions.
free margin The portion of equity not locked as margin: free_margin = equity − used_margin. A user cannot open new positions if free margin is insufficient.
margin level A ratio that indicates how healthy a position is: margin_level = (equity / used_margin) × 100%. Falling below a threshold triggers a margin call or washout.
washout Forced close of all open positions when the user was offline at full-time (FT) of a match and margin level dropped below the liquidation threshold. The system closes the position at the current AMM price automatically.
SL Stop Loss. A pre-set price at which a position is automatically closed to cap the loss.
TP Take Profit. A pre-set price at which a position is automatically closed to lock in a gain.
instrument A tradeable entity — one player card, identified by instrument_id (e.g. messi, vinicius-jr). Each instrument has its own base_price, k factor, and net_shares_sold counter stored in the Redis hash instrument:{instrument_id}.
flusher The flusher binary (ftl-backend/cmd/flusher/). A background worker with no HTTP ingress. It reads dirty keys from Redis every 100–200 ms and batch-writes wallet balances and position state to PostgreSQL.
dirty set A Redis set that tracks which wallet and instrument keys have been mutated since the last flush. The Lua trade script adds keys to this set; the flusher drains it.
idempotency guard A mechanism that prevents the same trade from executing twice on retry. The primary guard is a Redis key idem:{userId}:{clientRequestId} set by the Lua script. A secondary guard is the unique index idx_cfd_positions_client_request_id on client_request_id in the PostgreSQL cfd_positions table.
idem key Short for idempotency key. The value of client_request_id on a trade request — a UUID chosen by the client and included in every POST /api/positions/open body.
client_request_id The UUID field in the POST /api/positions/open request body that the client generates. It is stored on the cfd_positions row and used by the idempotency guard to reject duplicate submissions.
ws-token The app JWT passed as a query parameter when opening a WebSocket connection: wss://api.ftl2026.com/ws?token=<JWT>. The ws-server validates it on upgrade.
reg ticket A registration ticket — a short-lived signed token (HMAC, keyed by REG_TICKET_SECRET) issued after Google OAuth succeeds but before district selection. It proves the OAuth step completed and prevents replay of the registration flow.
leaderboard ROI score The primary ranking metric: ROI % = (current_portfolio_value − initial_capital) / initial_capital × 100. The leaderboard uses ROI rather than absolute portfolio value so capital size does not determine rank. Updated on every trade via ZADD leaderboard:overall inside the Lua script.