Market Basics & Operations
Market Basics & Operations
Enabled Market Segments
Cash Market (CM)
| Exchange | Segment | Pre-Open | Normal Session |
|---|---|---|---|
| NSE | Cash Market (CM) | 09:00 AM - 09:07 AM | 09:15 AM - 03:30 PM |
| BSE | Cash Market (CM) | 09:00 AM - 09:07 AM | 09:15 AM - 03:30 PM |
Derivatives (FO)
| Exchange | Segment | Normal Session |
|---|---|---|
| NSE | Futures & Options (FO) | 09:15 AM - 03:30 PM |
| BSE | Futures & Options (FO) | 09:15 AM - 03:30 PM |
After Market Orders (AMO)
AMO orders allow users to place orders when markets are closed. The system automatically handles AMO detection and processing.
AMO Logic
- Holiday Check: System checks holiday master to determine if current day is a trading holiday
- Timing Check: If not a holiday, system checks current time against market hours
- Storage: AMO orders are stored locally or sent to Kambala based on timing
- Processing: Airflow DAGs push orders to exchange during next trading session
AMO Processing Schedule
| Order Type | Airflow Schedule | Description |
|---|---|---|
| Normal AMO | 08:35 AM, 08:45 AM | Regular equity and derivative AMO orders |
| IPO AMO | 11:00 AM, 12:00 PM | IPO application orders |
Trading App Features
Core Trading Features
Search & Discovery
- Download and parse security master files
- Real-time search using Typesense
Watchlist
- Wealthy watchlist management
- Expired and banned scrip tracking
- Upcoming scrip monitoring
Order Types (Order Flow Details)
- Single Leg orders
- 2-Leg orders
- 3-Leg orders
- GTT (Good Till Triggered)
- BO/CO with trailing stop loss
- Exit all positions (bulk square-off)
Reports & Portfolio
- Holdings
- Positions
- Order Book
- Transaction History
Additional Features
- CDSL EDIS (e-DIS authorization)
- Margin pledge management
- Payment gateway integration
- Advanced charting
- IPO, SGB, NCD applications
- Backoffice operations
- KYC push to exchanges
Order Flow Architecture
Order Types Supported
Normal Orders
- Automatically converted to AMO when placed outside market hours
- Various price types: Market, Limit, Stop Loss Market, Stop Loss Limit
Cover Orders (CO)
- Intraday multi-leg orders
- Mandatory stop loss leg
- Parent order spawns child stop loss order
Bracket Orders (BO)
- Intraday multi-leg orders
- Both target and stop loss legs
- Optional trailing stop loss
- Auto square-off on target/stop loss hit
GTT Orders
- Good Till Triggered orders
- Persistent until triggered or cancelled
Basket Orders
- Multiple orders in a single basket
- 2-Leg and 3-Leg strategies
Order Placement Flow
New Order Request
β
Check AMO Time
β
βββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ
β NOT AMO Time β AMO Time β
βββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββ€
β 1. Generate Falcon Order ID β 1. Generate Falcon Order ID β
β 2. Keep in cache β 2. Keep in cache β
β 3. Send to Kambala OMS β 3. Map Falcon to OMS ID β
β 4. Map Falcon to OMS ID β 4. Store in orders table β
β 5. Store in orders table β 5. Return response to client β
β 6. Return response to client β 6. Queue for next session β
βββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ
Order Modification Flow
During Market Hours (Not AMO Time)
- Direct modification sent to Kambala OMS
- Immediate confirmation
Outside Market Hours (AMO Time)
- Check if order is AMO order
- If AMO: Modify in local storage
- If Regular: Handle based on current order status
User Details API
Endpoint: GET https://api.wealthydev.in/broking/api/v0/user/
Response Structure:
1{
2 "name": "Investor Name",
3 "mobile_number": "9XXXXXXXXX",
4 "exchange": [1, 2, 3],
5 "order_types": [
6 {
7 "order_type": 1,
8 "exchange": [1, 3]
9 }
10 ],
11 "broker_name": "WEALTHY",
12 "branch_id": "HO",
13 "email": "user@example.com",
14 "pan": "AAAAA1111L",
15 "mandate_list": [],
16 "BankDetails": null
17}
IPO Operations
Supported IPO Types
- Normal IPO: Mainboard offerings
- SME IPO: Small and Medium Enterprise segment
Application Categories
| Category | Criteria | Payment Mode | UPI Limit |
|---|---|---|---|
| Individual | Standard retail | UPI (ASBA) | βΉ5,00,000 |
| HNI | Amount > βΉ2,00,000 | UPI (ASBA) | βΉ5,00,000 |
| Shareholder | Existing shareholders | UPI (ASBA) | βΉ5,00,000 |
| Employee | Company employees | UPI (ASBA) | βΉ5,00,000 |
IPO Application Process
Prerequisites:
- DP Status: Active
- PAN Status: Verified
- Payment Status: Sufficient funds (100% upfront)
Application Steps:
- Fetch IPO master from exchange
- Get application number
- Place order with application details
- UPI mandate approval
- Allotment on listing day
Payment Systems
Payment Modes
UPI
- Provider: HDFC UPI
- Processing: Real-time
- Callback: Immediate status update
Net Banking
- HDFC Net Banking: Production
- Pine Labs: Production
- Future Integrations: Pending finance team approval
NEFT/RTGS (Offline)
- Processing Time: 30 minutes - 1 hour
- Manual Update: Via DPulse
- Flow: Update in DPulse β Atlas creates payin record β Increase funds in Kambala
Payment Callback Flow
Bank Callback (CRN, Amount, Source Account)
β
Store in DB/Queue (Status: Pending)
β
Process Oldest 10 Records
β
TPV Check (Third Party Verification)
β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββ
β TPV Success β TPV Failed β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ€
β Update in Kambala β Mark as Failed β
β Increase Funds β Notify User β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββ
TPV (Third Party Verification)
- Fetch all registered bank accounts from user’s broking profile
- Verify source bank account is in registered accounts list
- If verified: Update funds in Kambala
- If failed: Reject transaction
Fund Management
Payin Flow
Atlas Operations:
- List supported payment modes (UPI, Net Banking, NEFT/RTGS)
- Fetch saved UPI IDs and bank details
- Create order ID and call Collector service
- Frontend polls status + Airflow job monitoring
- On success: Update status in Atlas β Increase funds in Kambala
- Exception: No fund increase between 00:00 AM - 08:00 AM IST
Payout Schedule
| Payout Type | Time | Description |
|---|---|---|
| Evening Payout | ~06:00 PM | Same day withdrawal |
| Morning Payout | ~08:00 AM | Next day withdrawal |
Payout Logic
Evening Payout:
- Skip users with margin utilization
- Sync remaining withdrawal requests
Payout Calculation:
Payout Amount = MIN(Existing Balance, Requested Amount)
Process:
- Atlas fetches withdrawal requests
- Decrease balance in Kambala
- Push data to TechXL
- Upload file to sync actual payout amounts from TechXL
Future Enhancement
- 1-Hour Payout: Fast withdrawal processing under development
Margin Calculation
Example Calculation
Inputs:
- Cash: βΉ40,000
- Payin: +βΉ5,000
- Payout: -βΉ20,000
- Margin Pledge: βΉ150,000 (Usable: βΉ137,500, Remaining: βΉ12,500)
- Margin Used: βΉ25,000
Note: Only 50% of margin pledge can be used. The 50% comes from cash.
Calculations
Cash Used:
βΉ12,500 (from cash) + βΉ12,500 (from margin pledge) = βΉ25,000
Actual Cash Balance:
βΉ40,000 + βΉ5,000 - βΉ20,000 - βΉ12,500 = βΉ25,000
Available Margin:
βΉ25,000 (cash) + βΉ150,000 (pledge) - βΉ25,000 (used) = βΉ150,000
Withdrawable Balance:
βΉ40,000 + βΉ5,000 - βΉ20,000 - βΉ12,500 = βΉ7,500
Daily Operations
Daily File Downloads & Processing
Exchange Master Files:
- NSE CM: Security.txt (via API)
- NSE FO: Contract.txt (via API)
- NSE FO: Spread.txt (not currently used)
- BSE: Download from BSE Help Desk
Processing:
- Download files
- Parse and validate
- Store in Typesense for real-time search
Daily Scheduled Jobs
| Job | Schedule | Purpose |
|---|---|---|
| AMO Order Push | 08:35 AM, 08:45 AM | Push normal AMO orders to exchange |
| IPO AMO Push | 11:00 AM, 12:00 PM | Push IPO orders to exchange |
| Exchange Master Download | Daily | Fetch security/contract master files |
| IPO Master Fetch | Daily | Fetch active REITs/InvITs/Equity/Debt IPO details |
| Watchlist Cleanup | Daily | Remove expired/banned scrips, add upcoming |
Monthly Operations
Monthly File Uploads
EDIS Settlement Master:
- Upload monthly settlement file
- Required for CDSL e-DIS operations
Margin Pledge Eligible Scrips:
- Upload list of eligible securities for margin pledge
- Updated monthly based on exchange notifications
Related Documentation
- Trading API - Complete API documentation
- BOD Checklist - Daily operational checklist
- Order Flow Details - Detailed order type specifications