Skip to content

BST (Bank-Securities Transfer) Overview

About This Page

What: Full comparison of integration models, protocol differences, limit systems, and exception handling across the three BST banks Audience: Product managers who need a deep understanding of BST channel details Prerequisites: Withdrawal Methods Overview, Bank Capability MatrixReading time: 6 minutes Owner: Deposit Product Manager

Key Takeaway: BST (Bank-Securities Transfer) is the fastest withdrawal channel. The three banks have vastly different protocols: CMB/CMBC use Socket bidirectional links (second-level response), while Airstar uses REST API polling (minute-level response).


Three Banks at a Glance

DimensionCMBCMBCAirstar
ProtocolSocket Binary (GB18030)Socket XML Text (SM2 Encryption)REST API (JSON/UTF-8)
Authorization ModelBST AgreementBST AgreementMandate Authorization (6 states)
Withdrawal InitiatorBoth bank-side + moomoo-sideBank-side onlyBoth moomoo-side + bank-side
Result DeliveryReal-time push (Socket callback)Real-time push (Socket callback)Polling
Deposit StatusSuccess / FailureSuccess / FailureNEW / PENDING / SUCCESS / FAILED / REFUNDED
Withdrawal Status0 (Success) / -5 (Timeout) / -6 (Rejected)0 (Success) / -5 (Timeout) / -6 (Rejected)NEW / PENDING / SUCCESS / FAILED

Core difference in one sentence: CMB and CMBC use traditional Socket dedicated lines (bank-led), while Airstar uses a modern REST API (moomoo-led).

Individual Bank Channel Interface Details

This page provides a high-level comparison of BST protocols. For channel-side interface fields, moomoo-side adaptation mappings, and complete matching rules for each bank, see the individual bank pages:

  • CMB — Socket binary protocol, 33 command codes, SM2 encryption
  • CMBC (MS) — XML text protocol, SM2 encryption, Socket communication
  • Airstar — REST API, RSA-OAEP encryption, 10 API methods

BST Authorization (Mandate)

Authorization Model Comparison

CMB / CMBCAirstar
TerminologyBST AgreementMandate Authorization
Initiation MethodUser completes agreement on bank sideUser initiates on moomoo side, confirmed by bank
Number of States2 (Signed / Unsigned)6 (Full state machine)
Multi-marketSeparate agreement per marketOne authorization auto-maps to 3 markets
Core IdentifierBank card numbermandate_id

Airstar Mandate State Machine

Automatic 3-Market Mapping: After a user completes one Airstar Mandate authorization, the system automatically creates BST binding relationships for HK (Hong Kong stocks), US (US stocks), and CN (A-share connect) markets. Users do not need to operate separately for each market.

mandate_id is Airstar's core identifier: Unlike CMB/CMBC which use bank card numbers as the primary key, Airstar uses mandate_id as the unique identifier for BST relationships. All operations for bank card management, deposits, and withdrawals are linked through mandate_id.


Deposit Flow Comparison

Common BST Deposit

All BST banks share the same deposit logic framework:

  1. User initiates deposit -> System creates deposit instruction -> Sends to bank -> Bank processes -> Result returned -> Funds credited

Airstar Deposit Specifics

Two deposit sources:

Sourcesource ValueDescription
User initiates on moomoo side1User clicks deposit in moomoo App
User initiates on bank side2User initiates transfer to securities account in Airstar Bank App

Bank-side initiation (source=2) is unique to Airstar — CMB/CMBC BST deposits can only be initiated from the moomoo side.

Polling mechanism:

Unlike CMB/CMBC which push results in real-time via Socket, moomoo actively polls Airstar:

Job NameResponsibilityPoll CountDescription
AsbBstCreateJobCreate deposit instructionSends deposit request to Airstar
AsbBstCreateResultJobPoll deposit resultUp to 60 + slow pollingPolls Airstar API at intervals to check deposit status
AsbBstDepositJobProcess deposit creditExecutes internal credit logic after deposit confirmed successful

First 60 polls at 5-second intervals; after 60, switches to slow polling every 5 minutes until a terminal state is reached or manual intervention.

REFUNDED Status (Airstar-exclusive):

Airstar deposits have a status that other BST banks lack — REFUNDED. This indicates that after funds were successfully credited, the bank initiated a refund.

Trigger scenarios:

  • Bank detects transaction anomaly and proactively refunds
  • Compliance reasons trigger refund

System handling: Upon receiving REFUNDED status, the system must reverse the already-credited funds and notify the user. This is an exception scenario requiring Operations attention.


Withdrawal Flow Comparison

Common BST Withdrawal

BST withdrawal follows the Freeze-Transfer-Release three-step pattern:

Why freeze first? Because there is a time window between sending the instruction and bank confirmation. Without freezing, the user could spend the money during this period, causing a negative balance. Freezing ensures the withdrawal amount cannot be used by other operations during processing.

Airstar Withdrawal Specifics

Two withdrawal modes:

ModeDescription
moomoo-side initiatedUser clicks withdrawal in moomoo App, system sends instruction via API
Bank-side initiatedUser initiates transfer from securities account to bank in Airstar Bank App (Airstar exclusive)

Polling mechanism:

Job NameResponsibilityRetriesDescription
AsbBstTransferWithdrawal transfer instructionUp to 10Sends withdrawal request and polls result
SyncAsbBstWithdrawBank-side withdrawal pullEvery minute cronPulls bank-side initiated withdrawal requests, creates moomoo-side withdrawal tasks

Flow: moomoo-side withdrawal -> AsbBstTransfer polls up to 10 times -> if still incomplete, marks as exception needing manual confirmation. Bank-side withdrawal -> SyncAsbBstWithdraw pulls every minute -> creates withdrawal task for processing.

CMB / CMBC Withdrawal

CMB and CMBC send withdrawal instructions via Socket connection:

  1. Withdrawal service calls BST service (cmb_stock_trans / ms_stock_bank_transaction)
  2. Encrypts request data
  3. Sends to bank's exit_server via Socket
  4. Bank processes and returns result in real-time via the same bidirectional link
  5. Result codes: 0 (Success) / -5 (Timeout, auto-switch to backup exit_server for retry) / -6 (Bank rejected)

Three-Tier Limit System

BST channels control per-transaction amount, cumulative amount, and daily amount in layers. See Withdrawal Rules Manual - Three-Tier Limits for detailed explanation.

Airstar Limit Details

DimensionHKDUSD
Per-transaction max3,000,000500,000
Cumulative alarm40,000,00010,000,000
Daily circuit breaker (stop)15,000,0003,000,000

Online account opening minimum deposit: HKD 10,000 / USD 1,500 / CNH 10,000

How the three tiers work together:

  • Tier 1 (Per-transaction): Single deposits/withdrawals exceeding HKD 3M are directly rejected
  • Tier 2 (Cumulative alarm): When cumulative reaches HKD 40M, an alert notifies Operations, but transactions continue
  • Tier 3 (Daily circuit breaker): When daily cumulative reaches HKD 15M, auto deposit/withdrawal is shut down for the day; subsequent transactions require manual processing

CMB / CMBC Limits

CMB/CMBC Limit Explanation

CMB and CMBC limits are controlled by the bank-side system (not moomoo configuration). Specific values need to be confirmed with the bank. They are known to have per-transaction and daily limit mechanisms; when exceeded, the bank directly rejects and returns callback code -6. For over-limit issues, refer to Withdrawal Troubleshooting - BST Callback Exceptions.


Online Account Opening (Airstar Exclusive)

Airstar supports a three-in-one online account opening flow — new customers can complete in one continuous process:

  1. Open securities account: Complete KYC identity verification
  2. Mandate authorization: Authorize Airstar Bank for BST
  3. First deposit: Complete first deposit to securities account

The value of this flow is new customer acquisition — it lowers the barrier from registration to tradeable status. The traditional process requires users to switch between multiple systems (open account -> go to bank for agreement -> come back to deposit); the three-in-one flow is completed end-to-end within the moomoo App.

Online account opening deposit restrictions: The first deposit has a minimum amount requirement (HKD 10,000 / USD 1,500 / CNH 10,000), higher than regular deposit minimums, to ensure new customers have sufficient funds for trading.

Airstar Only

CMB and CMBC BST agreements must be completed on the bank side, and do not support the three-in-one flow within moomoo.


Cron Jobs

Airstar Job List

Job NameResponsibilityFrequencyRetriesDependency
AsbBstCreateJobCreate BST deposit instructionTrigger-basedUser deposit request
AsbBstCreateResultJobPoll deposit resultScheduledSlow poll after 60AsbBstCreateJob
AsbBstDepositJobDeposit credit processingTrigger-basedAsbBstCreateResultJob returns SUCCESS
AsbBstTransferWithdrawal transfer + poll resultTrigger-basedUp to 10Approval passed
SyncAsbBstWithdrawBank-side withdrawal pullEvery minute cronBank-side initiated withdrawal
AsbBstCreateFromBankJobBank-side deposit processingTrigger-basedBank-side initiated deposit
AsbBstCreateRetryJobDeposit creation retryTrigger-basedAsbBstCreateJob failure

Job Chain:

Deposit: AsbBstCreateJob (moomoo-side) / AsbBstCreateFromBankJob (bank-side) -> AsbBstCreateResultJob (60 fast polls + slow poll) -> AsbBstDepositJob (credit)

Withdrawal: moomoo-side: AsbBstTransfer (poll 10 times) -> timeout needs manual confirmation | Bank-side: SyncAsbBstWithdraw (pull every minute) -> creates withdrawal task

CMB / CMBC Jobs

Service NameBankResponsibility
cmb_stock_transCMBBST service, Socket binary communication
ms_stock_bank_transactionCMBCBST service, Socket XML text communication

CMB/CMBC use real-time bidirectional Socket, requiring no polling jobs — the bank pushes results directly through the same connection after processing.

Full cron job list -> Cron Jobs & Monitoring


Exception Scenarios Manual

Authorization Exceptions (5 types)

#ExceptionSymptomCauseResolution
1Authorization timeoutMandate stuck in PendingAuthorise stateBank processing delay or communication interruptionWait + manually query bank-side status
2Authorization failureMandate becomes RejectAuthoriseUser info verification failed / bank-side risk controlInvestigate failure cause, guide user to re-initiate
3Authorization revocationMandate becomes RevokedUser initiated revocationConfirm user intent, re-authorize if needed
4Partial market authorization failureSome of 3 markets binding succeededBST configuration issue for certain marketCheck failed market config, manually supplement binding
5Bank-side revocation not syncedBank-side already revoked but moomoo still shows AuthorisedSync delay or callback lostManually sync Mandate status

Deposit Exceptions (7 types)

#ExceptionSymptomCauseResolution
1Instruction creation failureAsbBstCreateJob errorsParameter exception / Mandate not AuthorisedCheck Mandate status and request parameters
2Polling timeoutStill PENDING after 60 pollsBank processing anomalyManually query bank-side status
3Deposit failureStatus becomes FAILEDBank rejected (insufficient balance/limit etc.)Check bank-returned error code
4Deposit refundStatus becomes REFUNDEDBank initiated refundReverse credited funds, notify user
5Bank-side deposit not syncedsource=2 deposit moomoo didn't receiveCallback lostManually query Airstar API to supplement
6Amount mismatchCredited amount differs from requested amountBank-side fees or exchange rate differenceVerify bank-side transaction details
7Duplicate depositSame deposit created multiple recordsDeduplication mechanism failedCheck procedure_id/request_id/bank_ref_id

Withdrawal Exceptions (5 types)

#ExceptionSymptomCauseResolution
1Withdrawal instruction failureAsbBstTransfer errorsParameter exception / Bank rejectedCheck error code, release frozen funds
2Polling timeoutStill PENDING after 10 pollsBank processing anomalyManually query bank-side status
3Freeze not releasedWithdrawal failed but funds still frozenRelease process exceptionManually release freeze
4Bank-side withdrawal not syncedUser initiated withdrawal from bank side but moomoo didn't deductCallback lostManually query Airstar API, execute deduction
5Partial withdrawalBank only transferred partial amountBank-side limit or insufficient balanceVerify amount difference, process remainder

Monitoring & Alerts

Airstar 13 Alert Items

#Alert ItemTrigger ConditionSeverityResponse
1Authorization creation timeoutMandate in PendingAuthorise exceeds thresholdHighCheck Airstar API connectivity
2Authorization failure rate spikeRejectAuthorise count exceeds limit per time unitHighInvestigate bank-side anomaly
3Deposit creation failureAsbBstCreateJob consecutive failuresHighCheck request parameters and API status
4Deposit polling timeoutAsbBstCreateResultJob entered slow poll with no terminal stateHighManually query bank-side status
5Deposit refundReceived REFUNDED statusHighImmediately reverse, notify user
6Withdrawal polling timeoutAsbBstTransfer exhausted 10 attemptsHighManually confirm bank-side status
7Bank-side withdrawal pull exceptionSyncAsbBstWithdraw cron errorsCriticalCheck Airstar API connectivity
8Freeze not releasedWithdrawal failed but freeze not rolled backCriticalManually release freeze
9Daily circuit breaker triggeredDaily cumulative reaches stop thresholdMediumOperations confirms then decides whether to restore
10Cumulative alarm triggeredCumulative reaches alarm thresholdMediumOperations monitors, assess risk
11Duplicate transaction detectedprocedure_id/request_id duplicateHighCheck deduplication logic
12API connectivity exceptionAirstar API response timeout or error rate increaseCriticalContact Airstar Bank technical support
13Bank-side initiation volume anomalysource=2 transaction volume spikeMediumInvestigate whether normal business fluctuation

Error Codes

Error Code System

Airstar error codes are categorized by operation type prefix, not by business domain:

Error Code PrefixOperation TypeDescription
14060xxxxCreate authorizationErrors when moomoo initiates Mandate creation
14061xxxxCancel authorizationErrors when moomoo initiates Mandate cancellation
14062xxxxQuery authorizationErrors when moomoo queries Mandate status
14063xxxxmoomoo-initiated transferErrors when moomoo initiates deposit/withdrawal transfer
14064xxxxQuery transferErrors when moomoo queries transfer status
14067xxxxBank-initiated transfermoomoo-side validation errors when bank initiates transfer
14072xxxxNotify transfer resultErrors when bank notifies transfer result
14073xxxxNotify authorization resultErrors when bank notifies authorization result

CMB/CMBC Error Codes

CMB and CMBC return result codes via Socket callback (0/-5/-6) and do not have independent error code series. Detailed callback handling logic is at Withdrawal Data Dictionary - Bank Callback Result Codes.


BST Channel Comparison

Airstar vs CMB/CMBC

DimensionAirstarCMB / CMBC
ProtocolREST API (HTTP + JSON)Socket binary protocol
EncodingUTF-8GB18030
Initiatormoomoo + bank bidirectionalCMB bidirectional / CMBC bank-side only
Authorization ModelMandate (6 states)BST Agreement (2 states)
Multi-market MappingOne authorization -> 3 markets auto-mappedSeparate agreement per market
Core Identifiermandate_idBank card number
Result DeliveryPollingReal-time push (Socket callback)
Deposit StatusNEW/PENDING/SUCCESS/FAILED/REFUNDEDSuccess/Failure
Withdrawal StatusNEW/PENDING/SUCCESS/FAILED0 (Success)/-5 (Timeout)/-6 (Rejected)
Deposit Polling60 fast polls + slow pollNo polling needed
Withdrawal Polling10 timesNo polling needed
Refund MechanismSupports REFUNDED statusNone
Online Account OpeningSupports three-in-oneNot supported
Error CodesBy operation type (14060~14073 series)0 / -5 / -6

BST vs Other Withdrawal Channels

DimensionBSTOnline Banking (HSBC/Hang Seng)FPSTraditional Channels
AutomationFully automatic (only one)Semi-autoSemi-autoManual
SpeedSeconds~minutesMinutes~hoursMinutesHours~days
Protocol ComplexityHigh (Socket/API)Low (Corporate online banking)Medium (FPS API)Low (Online banking/wire)
Operations InvolvementOnly on exceptionsConfirm stepConfirm stepFull involvement
Applicable BanksCMB/CMBC/AirstarHSBC/Hang SengBOCHK/SCB/CGBAll banks
Limit ControlThree-tier limit systemBank-side limitsFPS system limitsVaries by bank

After Reading

I want to...Go to
Deep dive into CMB's Socket binary protocolCMB
Deep dive into CMBC's XML text protocolCMBC (MS)
Deep dive into Airstar's REST API + RSA-OAEPAirstar
See BST's role in the withdrawal systemWithdrawal Methods Overview
See auto-withdrawal 6 conditions and three-tier limitsWithdrawal Rules Manual
Look up Mandate status codes and Airstar error codesUnified Error Code Center
See BST job frequencies and alertsCron Jobs & Monitoring
See other banks' integration methodsBank Capability Matrix
Was this page helpful?

内部业务文档 · 仅限 moomoo 团队使用