Self-Hosted Trading Platform Creation
Budget: ₹75,000 – ₹150,000 INR
SOFTWARE REQUIREMENTS SPECIFICATION (SRS)
Project Title
White-Label Multi-Asset Trading Platform (License-Gated, Self-Hosted)
Version
v1.0 – Final Locked Scope
Budget
₹90,000 – ₹1,00,000 (Fixed Scope, Fixed Deliverables)
Timeline
4–6 Weeks
1. PURPOSE
The purpose of this system is to build a self-hosted, white-label, simulated trading platform where:
Each whitelabel runs the system on their own AWS infrastructure
Trading operates only with a valid license
All price, margin, RMS, and risk rules are enforced server-side
Root Admin controls configuration & licensing only
No SaaS, no shared databases, no runtime infra access
If the license is invalid or expired, the system must not operate.
2. SYSTEM ROLES
2.1 Root Admin
Issues and manages licenses
Configures global APIs (price feed, payment gateway)
Configures platform bank details
Sets default exchange trading times
Must NOT access trading, wallets, users, or prices
2.2 Whitelabel Admin (Firm Owner)
Manages users and brokers
Configures RMS and trading rules
Configures firm bank details
Can tighten trading times (cannot extend)
Cannot access infra, DB, or license server
2.3 Broker
Trades on behalf of users (proxy trading)
Uses user wallet
All actions audited
2.4 User
Trades using virtual balance
Cannot bypass RMS or risk rules
3. DEPLOYMENT MODEL (MANDATORY)
Backend: Node.js + Express
Database: PostgreSQL
Frontend: React
Hosting: Whitelabel-managed AWS
Domain & SSL: Whitelabel-managed
Architecture:
One backend
One database
One frontend per whitelabel
The system must not:
Manage DNS
Issue SSL
Access whitelabel servers
4. LICENSE SYSTEM (CRITICAL)
4.1 License Validation
Backend must validate license:
On startup (hard gate)
Periodically at runtime (heartbeat)
4.2 License Binding
License must be bound to:
Instance fingerprint (AWS/host hash)
Mismatch → system refuses to operate.
4.3 License Failure Behavior
If license status ≠ ACTIVE:
Login disabled
Trading disabled
Wallet operations disabled
UI shows “License expired / invalid”
4.4 Offline Grace
Max 60 minutes
Only if license server unreachable
If server responds EXPIRED → immediate stop
5. PRICE SOURCE & PRICE ENGINE
5.1 Price Source
Backend consumes real-time prices via WebSocket
One active market data provider at a time
Frontend must never connect to price WebSocket
5.2 Price Authority
Backend price cache is the single source of truth
Client-sent price is ignored
Manual price editing is forbidden
5.3 Price Update Flow
Copy code
Market Data WebSocket
↓
Backend Price Engine
↓
In-memory price cache
↓
Order execution / RMS / SL-TP checks
6. SUPPORTED SEGMENTS
Indian Markets
NSE Futures
BSE Futures
MCX Futures
NSE Options
BSE Options
MCX Options
Global Markets
Forex
Crypto
Metals
Indices
Each instrument must define:
Symbol
Segment
Exchange
Lot size
Tick size
Expiry (if applicable)
Margin / leverage parameters
7. INSTRUMENT MANAGEMENT
7.1 Instrument Master (Static)
Stored in DB
Admin can:
Enable / disable symbol
Adjust lot size, tick size, leverage
Configure RMS limits
Admin must NOT set live prices
7.2 Live Prices (Dynamic)
Received automatically from WebSocket
Ignored if symbol inactive or unmapped
8. ORDER TYPES (FIXED SCOPE)
Supported:
Market
Limit
Stop-Loss (SL)
Take-Profit (TP)
Explicitly excluded:
SL-M (Stop-Loss Market)
Advanced strategies
9. WALLET & LEDGER SYSTEM (NON-NEGOTIABLE)
9.1 Wallets
User wallet
Broker wallet
Admin wallet
(All virtual accounting)
9.2 Ledger Rules
Append-only
No UPDATE or DELETE
Reversal entries only
Ledger fields:
wallet_id
credit
debit
reason
reference_id
executed_by
timestamp
10. MARGIN & RMS (SEGMENT-AWARE)
10.1 Margin Calculation
Copy code
Required Margin = (Price × Quantity) / Leverage
10.2 RMS Levels
Order-Level
Max lots per order
Tick & lot validation
Margin availability
Position-Level
Max open positions per segment
Max exposure per segment
Wallet-Level
Daily loss limit
Auto square-off
No negative balance allowed
10.3 Options RMS
Buy: risk limited to premium
Sell: higher margin + stricter loss rules
11. AUTO SQUARE-OFF (CORRECT LOGIC)
Rule (MANDATORY)
Copy code
Loss Threshold = Wallet Ledger Balance × Loss %
Triggered on unrealized loss
NOT based on blocked margin
Executed by system
Cannot be prevented
12. SL / TP EXECUTION
Evaluated by backend job worker
Checked every 500 ms – 1 second
On trigger:
Position closed
Margin released
PnL applied
Ledger entry created
13. JOB WORKER (LIGHTWEIGHT)
Worker responsibilities:
SL / TP checks
Auto square-off checks
License heartbeat
Optional end-of-session safety close
Implementation:
In-process Node.js worker
No Redis
No external queues
14. TRADING TIME WINDOWS (CRITICAL)
14.1 Exchange Default
Set by Root Admin per segment
14.2 Whitelabel Override
Whitelabel Admin may tighten trading hours
Cannot extend beyond exchange time
Final allowed window:
Copy code
start = max(exchange_start, whitelabel_start)
end = min(exchange_end, whitelabel_end)
Orders outside this window must be rejected.
15. PROXY / BROKER TRADING
Broker trades using user wallet
Each trade records:
actual_user_id
executed_by_id
executed_by_role
is_proxy = true
All actions audited.
16. BANK DETAILS
16.1 Root Admin Bank Details
Platform bank account
Used for license / service payments
Editable by Root Admin only
16.2 Whitelabel Admin Bank Details
Firm’s business bank details
Used for user deposits & withdrawals
Editable by Whitelabel Admin only
These two must remain completely separate.
17. REPORTING (LIMITED)
Reports:
Trades
Positions
Wallet ledger
Export:
CSV only
No PDF
18. FRONTEND REQUIREMENTS
React application
Panels:
Admin
Broker
User
Role-based access control
License expired screen
2–3 fixed UI themes
No custom theming per client
19. ROOT ADMIN PANEL (CONFIG ONLY)
Root Admin can:
Manage licenses
Configure price API
Configure payment gateway
Configure platform bank details
Set exchange default timings
Root Admin must NOT:
Access trades
Access wallets
Access users
Modify prices
20. EXPLICIT EXCLUSIONS
SaaS multi-tenant
Super Admin trading access
DNS / SSL automation
Frontend WebSocket
SL-M orders
PDF reports
Strategy engine
Manual price control
Anything not listed is out of scope.
21. DELIVERABLES (MANDATORY)
Backend
Full source code
DB schema & migrations
Price engine
RMS & risk logic
License enforcement
API documentation
Frontend
React source code
Admin / Broker / User panels
Theme support
Documentation
AWS deployment guide
Environment setup
License integration guide
22. FINAL DEVELOPER WARNING
Backend is the single source of truth
License gate cannot be bypassed
Ledger and RMS rules are mandatory
Any deviation = rejection of delivery
Project Title
White-Label Multi-Asset Trading Platform (License-Gated, Self-Hosted)
Version
v1.0 – Final Locked Scope
Budget
₹90,000 – ₹1,00,000 (Fixed Scope, Fixed Deliverables)
Timeline
4–6 Weeks
1. PURPOSE
The purpose of this system is to build a self-hosted, white-label, simulated trading platform where:
Each whitelabel runs the system on their own AWS infrastructure
Trading operates only with a valid license
All price, margin, RMS, and risk rules are enforced server-side
Root Admin controls configuration & licensing only
No SaaS, no shared databases, no runtime infra access
If the license is invalid or expired, the system must not operate.
2. SYSTEM ROLES
2.1 Root Admin
Issues and manages licenses
Configures global APIs (price feed, payment gateway)
Configures platform bank details
Sets default exchange trading times
Must NOT access trading, wallets, users, or prices
2.2 Whitelabel Admin (Firm Owner)
Manages users and brokers
Configures RMS and trading rules
Configures firm bank details
Can tighten trading times (cannot extend)
Cannot access infra, DB, or license server
2.3 Broker
Trades on behalf of users (proxy trading)
Uses user wallet
All actions audited
2.4 User
Trades using virtual balance
Cannot bypass RMS or risk rules
3. DEPLOYMENT MODEL (MANDATORY)
Backend: Node.js + Express
Database: PostgreSQL
Frontend: React
Hosting: Whitelabel-managed AWS
Domain & SSL: Whitelabel-managed
Architecture:
One backend
One database
One frontend per whitelabel
The system must not:
Manage DNS
Issue SSL
Access whitelabel servers
4. LICENSE SYSTEM (CRITICAL)
4.1 License Validation
Backend must validate license:
On startup (hard gate)
Periodically at runtime (heartbeat)
4.2 License Binding
License must be bound to:
Instance fingerprint (AWS/host hash)
Mismatch → system refuses to operate.
4.3 License Failure Behavior
If license status ≠ ACTIVE:
Login disabled
Trading disabled
Wallet operations disabled
UI shows “License expired / invalid”
4.4 Offline Grace
Max 60 minutes
Only if license server unreachable
If server responds EXPIRED → immediate stop
5. PRICE SOURCE & PRICE ENGINE
5.1 Price Source
Backend consumes real-time prices via WebSocket
One active market data provider at a time
Frontend must never connect to price WebSocket
5.2 Price Authority
Backend price cache is the single source of truth
Client-sent price is ignored
Manual price editing is forbidden
5.3 Price Update Flow
Copy code
Market Data WebSocket
↓
Backend Price Engine
↓
In-memory price cache
↓
Order execution / RMS / SL-TP checks
6. SUPPORTED SEGMENTS
Indian Markets
NSE Futures
BSE Futures
MCX Futures
NSE Options
BSE Options
MCX Options
Global Markets
Forex
Crypto
Metals
Indices
Each instrument must define:
Symbol
Segment
Exchange
Lot size
Tick size
Expiry (if applicable)
Margin / leverage parameters
7. INSTRUMENT MANAGEMENT
7.1 Instrument Master (Static)
Stored in DB
Admin can:
Enable / disable symbol
Adjust lot size, tick size, leverage
Configure RMS limits
Admin must NOT set live prices
7.2 Live Prices (Dynamic)
Received automatically from WebSocket
Ignored if symbol inactive or unmapped
8. ORDER TYPES (FIXED SCOPE)
Supported:
Market
Limit
Stop-Loss (SL)
Take-Profit (TP)
Explicitly excluded:
SL-M (Stop-Loss Market)
Advanced strategies
9. WALLET & LEDGER SYSTEM (NON-NEGOTIABLE)
9.1 Wallets
User wallet
Broker wallet
Admin wallet
(All virtual accounting)
9.2 Ledger Rules
Append-only
No UPDATE or DELETE
Reversal entries only
Ledger fields:
wallet_id
credit
debit
reason
reference_id
executed_by
timestamp
10. MARGIN & RMS (SEGMENT-AWARE)
10.1 Margin Calculation
Copy code
Required Margin = (Price × Quantity) / Leverage
10.2 RMS Levels
Order-Level
Max lots per order
Tick & lot validation
Margin availability
Position-Level
Max open positions per segment
Max exposure per segment
Wallet-Level
Daily loss limit
Auto square-off
No negative balance allowed
10.3 Options RMS
Buy: risk limited to premium
Sell: higher margin + stricter loss rules
11. AUTO SQUARE-OFF (CORRECT LOGIC)
Rule (MANDATORY)
Copy code
Loss Threshold = Wallet Ledger Balance × Loss %
Triggered on unrealized loss
NOT based on blocked margin
Executed by system
Cannot be prevented
12. SL / TP EXECUTION
Evaluated by backend job worker
Checked every 500 ms – 1 second
On trigger:
Position closed
Margin released
PnL applied
Ledger entry created
13. JOB WORKER (LIGHTWEIGHT)
Worker responsibilities:
SL / TP checks
Auto square-off checks
License heartbeat
Optional end-of-session safety close
Implementation:
In-process Node.js worker
No Redis
No external queues
14. TRADING TIME WINDOWS (CRITICAL)
14.1 Exchange Default
Set by Root Admin per segment
14.2 Whitelabel Override
Whitelabel Admin may tighten trading hours
Cannot extend beyond exchange time
Final allowed window:
Copy code
start = max(exchange_start, whitelabel_start)
end = min(exchange_end, whitelabel_end)
Orders outside this window must be rejected.
15. PROXY / BROKER TRADING
Broker trades using user wallet
Each trade records:
actual_user_id
executed_by_id
executed_by_role
is_proxy = true
All actions audited.
16. BANK DETAILS
16.1 Root Admin Bank Details
Platform bank account
Used for license / service payments
Editable by Root Admin only
16.2 Whitelabel Admin Bank Details
Firm’s business bank details
Used for user deposits & withdrawals
Editable by Whitelabel Admin only
These two must remain completely separate.
17. REPORTING (LIMITED)
Reports:
Trades
Positions
Wallet ledger
Export:
CSV only
No PDF
18. FRONTEND REQUIREMENTS
React application
Panels:
Admin
Broker
User
Role-based access control
License expired screen
2–3 fixed UI themes
No custom theming per client
19. ROOT ADMIN PANEL (CONFIG ONLY)
Root Admin can:
Manage licenses
Configure price API
Configure payment gateway
Configure platform bank details
Set exchange default timings
Root Admin must NOT:
Access trades
Access wallets
Access users
Modify prices
20. EXPLICIT EXCLUSIONS
SaaS multi-tenant
Super Admin trading access
DNS / SSL automation
Frontend WebSocket
SL-M orders
PDF reports
Strategy engine
Manual price control
Anything not listed is out of scope.
21. DELIVERABLES (MANDATORY)
Backend
Full source code
DB schema & migrations
Price engine
RMS & risk logic
License enforcement
API documentation
Frontend
React source code
Admin / Broker / User panels
Theme support
Documentation
AWS deployment guide
Environment setup
License integration guide
22. FINAL DEVELOPER WARNING
Backend is the single source of truth
License gate cannot be bypassed
Ledger and RMS rules are mandatory
Any deviation = rejection of delivery
Related categories:
Cloud Computing
Node.js
PostgreSQL
Web Development
Backend Development
Frontend Development