Skip to content

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

OptionDefaultDescription
Config.DebugfalseEnables debug logs in the server console (development only).
Config.PhoneName'lb-phone'Phone resource name. Must match your phone.
Config.DefaultAppfalseIf true, the app is pre-installed on every player's phone (no App Store).
Config.Iconnui://…/app/icon.pngIcon shown on the phone's home screen.
Config.Imagenui://…/app/icon.pngImage shown in the App Store / app preview.
Config.Locale'en'UI language. Must match a file in locales/.
Config.InitialBalance0Trading balance ($) granted when a new account is created.
Config.TransactionFee0.005Fee on every crypto buy/sell — i.e. 0.5%.
Config.StockTransactionFee0.01Fee on every stock buy/sell — i.e. 1%.
Config.UpdateInterval30How often (s) crypto prices are recalculated. Lower = more volatile.
Config.StockUpdateInterval300How often (s) stock prices are recalculated — i.e. 5 minutes.
Config.HistorySnapshotInterval300How often (s) price + portfolio snapshots are saved (for the charts).
Config.MaxHistoryDays30Days 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:

FieldRole
symbolUnique identifier shown in the UI (uppercase, 3-5 chars). Do not change after launch (breaks existing holdings).
nameFull display name shown next to the symbol.
priceStarting price ($). Only used the first time the coin is added to the database.
volatilitySwing amplitude per tick (0.01 = up to 1%, 0.05 = up to 5%).
trendLong-term bias, from -1.0 (bearish) to 1.0 (bullish), 0.0 = neutral.
minPriceFloor: the price never drops below it.
maxPriceCeiling: the price never rises above it.
iconIcon URL (nui://… local or https://… external).

The default coins:

SymbolNameStart priceVolatilityFloorCeiling
FTCFanta Coin100.000.01510.00500.00
MZCMaze Coin12.000.021.00100.00
LITLife Token3.500.020.5050.00
LBCLB Coin50.000.0155.00300.00
lua
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:

FieldRole
symbolUnique identifier. In revenue mode it must match the in-game job name. In volatility mode any unique identifier works.
nameCompany display name shown in the UI.
basePriceReference 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.
minPriceOptional. Floor. Defaults to basePrice * 0.1.
maxPriceOptional. Ceiling. Defaults to basePrice * 10.
iconIcon 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.

lua
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:

OptionDefaultDescription
Config.StockPriceMode'volatility''volatility' (random, recommended, no banking) or 'revenue' (tied to weekly revenue).
Config.StockReferenceRevenue50000(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:

lua
-- '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.

FieldDefaultRole
enabledfalseMaster 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 symbol after launch: it breaks existing holdings.
  • Lower Config.UpdateInterval / Config.StockUpdateInterval for 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.Debug only during development.