Market Basics & Operations

Market segments, trading hours, order flows, and operational procedures for the broking platform.

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

  1. Holiday Check: System checks holiday master to determine if current day is a trading holiday
  2. Timing Check: If not a holiday, system checks current time against market hours
  3. Storage: AMO orders are stored locally or sent to Kambala based on timing
  4. 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:

  1. Fetch IPO master from exchange
  2. Get application number
  3. Place order with application details
  4. UPI mandate approval
  5. 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:

  1. List supported payment modes (UPI, Net Banking, NEFT/RTGS)
  2. Fetch saved UPI IDs and bank details
  3. Create order ID and call Collector service
  4. Frontend polls status + Airflow job monitoring
  5. 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:

  1. Atlas fetches withdrawal requests
  2. Decrease balance in Kambala
  3. Push data to TechXL
  4. 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:

  1. Download files
  2. Parse and validate
  3. 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