TradeX
TradeX (Lo TradeX / Lo Crypto) is a trading app for lb-phone. Your players invest in cryptocurrencies and company stocks straight from their phone: buy, sell, track their portfolio live and watch price charts. Turn your server into a real Wall Street.
Overview
The app is downloaded from the phone's App Store (or auto-installed) and gives access to two markets: a fully customizable crypto market and a stock market tied either to volatility or to companies' weekly revenue. Each player has a dedicated trading balance funded from their bank, and tracks the value of their positions in real time.
Features
Crypto market
- Fully customizable coins (symbol, name, starting price, icon).
- Real-time price simulation recalculated on a configurable interval.
- Volatility and trend per coin: swing amplitude and bullish/bearish bias.
- Floor and ceiling per coin: the price never drops below or rises above the bounds.
- Transaction fees applied on every buy/sell.
Stock market
- Company stocks traded just like cryptos.
- Two pricing modes: volatility (random, default) or revenue (tied to weekly turnover).
- Per-company sensitivity in revenue mode: how strongly the price reacts to revenue.
- Dedicated transaction fees for stocks.
Portfolio
- Live P&L (unrealized gains/losses).
- Average buy price per asset.
- 24h change and total holdings value.
- Portfolio value history.
Charts
- Price history over 1h / 24h / 7d / 30d.
- Interactive charts for cryptos, stocks and the portfolio.
- Watchlist: keep your favorite coins and stocks at quick reach.
Wallet
- Deposit and withdraw between the player's bank and trading balance.
- Full transaction history: crypto, stocks and bank operations.
Stock pricing modes
TradeX offers two ways to move stock prices, chosen via Config.StockPriceMode:
| Mode | Behavior | Dependency |
|---|---|---|
volatility (default) | Prices fluctuate randomly, exactly like cryptos (per-stock volatility + trend). | None — recommended. |
revenue | Prices are calculated from each company's actual weekly revenue, read from a banking script. More immersive. | A compatible banking script. |
NOTE
If revenue is selected but no banking script is detected, TradeX automatically falls back to volatility mode. In revenue mode, the stock symbol must match the in-game job name.
Compatibility & dependencies
The framework is auto-detected on startup — no manual switch.
| Framework | Status |
|---|---|
QBCore (qb-core) | Supported |
QBox (qbx_core) | Supported |
ESX (es_extended) | Supported |
| Dependency | Status | Role |
|---|---|---|
| lb-phone | Required | Host phone for the app |
| ox_lib | Required | Callbacks and utilities |
| oxmysql | Required | Data persistence |
| A framework | Required | qb-core, qbx_core or es_extended |
Supported banking scripts (only for the stock revenue mode, otherwise optional):
| Banking | Detection |
|---|---|
lo_banking | Auto |
esx_society | Auto |
qb-banking | Auto |
qb-management | Auto |
Renewed-Banking | Auto |
TIP
In volatility mode (the default), no banking script is required: TradeX runs with just lb-phone, ox_lib, oxmysql and a framework.
Technical overview
| Item | Detail |
|---|---|
| Frontend | Pre-built interface served to the phone (ui/dist/) |
| Backend | Lua (client + server) |
| Persistence | oxmysql — phone_trade_* tables created automatically on startup |
| Languages | 2 locales/*.json files (en, fr) |
| Extras | Migration from an old crypto app, automatic history cleanup, dark theme |
The server recalculates prices on a regular interval, periodically saves price and portfolio snapshots to draw the charts, then automatically prunes data older than Config.MaxHistoryDays.
Next steps
- Installation — add the resource and prepare the database.
- Configuration — every option in
shared/config.lua.