Installation
Follow these steps to add TradeX to your server. The app installs like any lb-phone app, inside the [phone] folder of your resources.
Prerequisites
| Item | Detail |
|---|---|
| lb-phone | Required, installed and working |
| ox_lib | Required (callbacks) |
| oxmysql | Required (data persistence) |
| A framework | Required — qb-core, qbx_core or es_extended |
| A banking script | Optional — only for the stock revenue mode |
NOTE
The framework is auto-detected on startup. No banking script is needed as long as you stay in volatility mode (the default setting).
1. Add the resource
Place the lo_tradex folder inside resources/[phone]/:
resources/
└── [phone]/
└── lo_tradex/
├── fxmanifest.lua
├── shared/
│ ├── config.lua
│ ├── locales.lua
│ ├── utils.lua
│ └── framework.lua
├── client/client.lua
├── server/
│ ├── db.lua
│ └── server.lua
├── locales/ ← 2 language files (en, fr)
└── ui/
└── dist/ ← already-compiled interface2. Start order
In server.cfg, start TradeX after its dependencies:
ensure oxmysql
ensure ox_lib
ensure lb-phone
ensure lo_tradexWARNING
If lo_tradex starts before lb-phone, the app will not register in the phone. Respect the order: oxmysql → ox_lib → lb-phone → lo_tradex. Your framework (and your banking script, if any) must also start before it.
3. Database
The schema is created automatically on first start via oxmysql — no SQL import is needed. TradeX creates all of its tables (player accounts, crypto and stock market state, holdings, transactions, watchlists, price and portfolio history, bank operations).
NOTE
Tables are prefixed with phone_trade_ to avoid conflicts. History data older than Config.MaxHistoryDays is pruned automatically.
4. Interface (UI)
The interface is already compiled: the ui/dist/ folder is shipped and served to the phone by fxmanifest.lua. No build step is required to use the app.
TIP
There is nothing to do here in the standard case: the bundled UI is ready to use. To add your own coin icons, drop them in ui/dist/assets/coins/ and reference them as nui://lo_tradex/ui/dist/assets/coins/yourfile.png.
Verification
- Start the server (or
ensure lo_tradexon a live server). - Check the console: the
phone_trade_*tables should be created without error on first launch, and theFramework: ...line should report your detected framework. - On the in-game phone, open the App Store: TradeX should appear, ready to download.
- Install it, create a trading account and place a first buy order to confirm everything works.
TIP
To pre-install the app on every player's phone (skipping the App Store), set Config.DefaultApp = true in shared/config.lua.
Once the install is verified, tune the behavior via the Configuration.