Configuration
All of TradeX's configuration lives in shared/config.lua. This file stays editable even on escrow-protected builds (it is listed in escrow_ignore). Every option is fully commented inline.
Main options
| Option | Default | Description |
|---|---|---|
Config.Debug | false | Enables debug logs in the server console (development only). |
Config.PhoneName | 'lb-phone' | Phone resource name. Must match your phone. |
Config.DefaultApp | false | If true, the app is pre-installed on every player's phone (no App Store). |
Config.Icon | nui://…/app/icon.png | Icon shown on the phone's home screen. |
Config.Image | nui://…/app/icon.png | Image shown in the App Store / app preview. |
Config.Locale | 'en' | UI language. Must match a file in locales/. |
Config.InitialBalance | 0 | Trading balance ($) granted when a new account is created. |
Config.TransactionFee | 0.005 | Fee on every crypto buy/sell — i.e. 0.5%. |
Config.StockTransactionFee | 0.01 | Fee on every stock buy/sell — i.e. 1%. |
Config.UpdateInterval | 30 | How often (s) crypto prices are recalculated. Lower = more volatile. |
Config.StockUpdateInterval | 300 | How often (s) stock prices are recalculated — i.e. 5 minutes. |
Config.HistorySnapshotInterval | 300 | How often (s) price + portfolio snapshots are saved (for the charts). |
Config.MaxHistoryDays | 30 | Days of history kept. Older entries are deleted. |
NOTE
Config.TransactionFee = 0.005 means buying $1000 of crypto deducts $1005 total (0.5% fee).
Cryptocurrencies (Config.Coins)
Add, remove or edit coins freely. Each entry accepts these fields:
| Field | Role |
|---|---|
symbol | Unique identifier shown in the UI (uppercase, 3-5 chars). Do not change after launch (breaks existing holdings). |
name | Full display name shown next to the symbol. |
price | Starting price ($). Only used the first time the coin is added to the database. |
volatility | Swing amplitude per tick (0.01 = up to 1%, 0.05 = up to 5%). |
trend | Long-term bias, from -1.0 (bearish) to 1.0 (bullish), 0.0 = neutral. |
minPrice | Floor: the price never drops below it. |
maxPrice | Ceiling: the price never rises above it. |
icon | Icon URL (nui://… local or https://… external). |
The default coins:
| Symbol | Name | Start price | Volatility | Floor | Ceiling |
|---|---|---|---|---|---|
FTC | Fanta Coin | 100.00 | 0.015 | 10.00 | 500.00 |
MZC | Maze Coin | 12.00 | 0.02 | 1.00 | 100.00 |
LIT | Life Token | 3.50 | 0.02 | 0.50 | 50.00 |
LBC | LB Coin | 50.00 | 0.015 | 5.00 | 300.00 |
Config.Coins = {
{
symbol = 'FTC',
name = 'Fanta Coin',
price = 100.00,
volatility = 0.015,
trend = 0.0,
minPrice = 10.00,
maxPrice = 500.00,
icon = 'nui://lo_tradex/ui/dist/assets/coins/ftc.png'
},
-- … MZC, LIT, LBC
}Stocks (Config.Stocks)
Stocks represent company shares. Available fields:
| Field | Role |
|---|---|
symbol | Unique identifier. In revenue mode it must match the in-game job name. In volatility mode any unique identifier works. |
name | Company display name shown in the UI. |
basePrice | Reference price ($): starting price and anchor for revenue-mode calculations. |
sensitivity | (Revenue mode) How strongly revenue affects the price, from 0.0 to 1.0. |
volatility | (Volatility mode) Random variation per tick (0.02 = ±2%). |
trend | (Volatility mode) -1.0 bearish to 1.0 bullish, 0 = neutral. |
minPrice | Optional. Floor. Defaults to basePrice * 0.1. |
maxPrice | Optional. Ceiling. Defaults to basePrice * 10. |
icon | Icon URL (nui://… local or https://… external). |
10 stocks ship by default (mechanic, drivein, sightings, pizza, mirror, lsfood, reporter, lsevents, studio, kebab), with basePrice values from 8 to 40 $ and sensitivity from 0.3 to 0.6.
Config.Stocks = {
{
symbol = 'mechanic',
name = 'Pitstop Garage',
basePrice = 15.00,
sensitivity = 0.5,
volatility = 0.02,
trend = 0.0,
icon = 'https://files.fantasticrp.fr/…png'
},
-- … 9 more companies
}Stock pricing mode
Pick one mode via Config.StockPriceMode:
| Option | Default | Description |
|---|---|---|
Config.StockPriceMode | 'volatility' | 'volatility' (random, recommended, no banking) or 'revenue' (tied to weekly revenue). |
Config.StockReferenceRevenue | 50000 | (Revenue mode) The "neutral" weekly revenue. Above it the price rises; below it the price falls. |
Config.StockBankingSystem | 'auto' | (Revenue mode) Banking script read for revenue (see below). |
Possible values for Config.StockBankingSystem:
-- 'auto' : auto-detect (lo_banking, esx_society,
-- qb-banking, qb-management, Renewed-Banking, in this order)
-- 'lo_banking' : force lo_banking
-- 'esx_society' : force esx_society (ESX)
-- 'qb-banking' : force qb-banking (QBCore)
-- 'qb-management' : force qb-management (QBCore)
-- 'renewed-banking' : force Renewed-Banking
-- 'none' : disable revenue mode (always volatility)WARNING
In revenue mode, each stock's symbol must exactly match the company's job name, otherwise the script cannot fetch the right account. If revenue is chosen but no banking script is detected, TradeX automatically falls back to volatility.
Migration (optional)
Config.Migration lets you import players' holdings from an old crypto app. Disabled by default.
| Field | Default | Role |
|---|---|---|
enabled | false | Master switch. true only when migrating. |
sourceTable | 'phone_crypto' | SQL table of the old app. |
identifierColumn | 'id' | Player identifier column (usually citizenid). |
coinColumn | 'coin' | Coin symbol column. |
amountColumn | 'amount' | Held amount column. |
investedColumn | 'invested' | Originally invested $ column. |
coins | {} | Mapping old_symbol = 'NEW_SYMBOL'. |
convertToCash | {} | Old coins that no longer exist: their invested value is returned as cash. |
NOTE
Migration runs on a player's first account creation in TradeX: their old holdings are recreated at the new prices, preserving the invested value. The new symbol must exist in Config.Coins.
Languages
TradeX ships with 2 language files in locales/*.json: en (English) and fr (French), both declared in fxmanifest.lua.
To add a language: copy locales/en.json to locales/xx.json, translate only the values (never the keys), set Config.Locale = 'xx', then restart the resource.
Tips
TIP
- Never change a coin/stock
symbolafter launch: it breaks existing holdings. - Lower
Config.UpdateInterval/Config.StockUpdateIntervalfor snappier markets, raise them to calm volatility. - Watch
Config.MaxHistoryDays: a high value grows the database but gives longer charts. - Keep
Config.StockPriceMode = 'volatility'if you have no compatible banking script. - Enable
Config.Debugonly during development.