Broker API v2 ## Sections • [Introduction](https://app.theneo.io/match-trade/broker-api-v2/introduction.md): AI skill.md Match-Trader has built a skill that makes integrating our API faster and easier. It lets you connect our API to your system - or check how your current integration is set up - just by describing what you need in plain language to an AI assistant. This skill teaches an AI assistant (like Claude) how to work with the Broker API V2. Instead of reading technical docs and writing code yourself, you simply say what you want to do, and the assistant handles the technical details for you. Link to GitHub . To install it: npx skills add https://github.com/match-trade/Broker-API-skill Broker API v2 is a REST and gRPC API designed for direct integration with the Match-Trader platform . It provides a complete set of administrative and trading operations - managing user accounts, trading accounts, positions, orders, payments, and real-time data streams. The API is the primary integration point for any system connecting directly to the Match-Trader platform, including CRM providers, social and copy trading platforms, risk management tools, and other third-party services. In the Match-Trade system, each broker has a unique brokerID assigned. Every operation via this API is scoped to that broker, and since it is encoded in your Authorization token, you do not need to pass it explicitly in requests. For the Sandbox environment, brokerID = 0 is shared across all accounts - meaning you may see test data created by other integrations. Server time is GMT (UTC+0). The default request limit is 500 requests/minute. • [Authentication](https://app.theneo.io/match-trade/broker-api-v2/authentication.md): Our system implements a security mechanism that utilizes token-based authorization to ensure secure resource access. The authentication process involves using an Authorization header, following the token scheme. This section outlines the steps required for obtaining and using the authentication token to access protected resources. Security Best Practices To ensure the highest security standards, all communication with our services should be performed over encrypted channels (for example, using SSL/TLS protocols). Unencrypted or insecure connections are not recommended and may be rejected by the server. In particular, please make sure to always connect to the secure port (e.g., 443) assigned for encrypted traffic. Note : Attempting to establish unencrypted connections or using insecure credentials may cause authentication or connection failures. Always utilize encrypted methods and secure credentials. Obtaining the Token To obtain the authentication token, please contact our IT-Support team ( itsupport@match-trade.com ). This token acts as a digital key, granting access to the system’s resources for the duration of the token’s validity. Tokens are valid until revoked. The default gRPC port is 8083. Using the Token Include the token as a Bearer credential in every authenticated request. REST : Authorization: Bearer <Your_Token_Here> gRPC : uses metadata instead of HTTP headers. Pass the same value as the authorization metadata key: authorization: Bearer <Your_Token_Here> Code Example (Python) Below is a generic example of how to add the Authorization metadata in a gRPC client application. The implementation may vary depending on the programming language and gRPC library used. Python import grpc # Insecure channel (internal/private hosts only) channel = grpc.insecure_channel("mtr-broker-api:8083") # Secure channel (public hostnames — recommended) channel = grpc.secure_channel("grpc-broker-api-v2.your-domain.com", grpc.ssl_channel_credentials()) # Prepare metadata with the authorization token metadata = [("authorization", "Bearer <Your_Token_Here>")] # Create a stub and make a call stub = YourServiceStub(channel) response = stub.YourRpcMethod(request, metadata=metadata) Replace <Your_Token_Here> with the actual token, and adjust YourServiceStub and YourRpcMethod to match your gRPC service definition. • [User Accounts](https://app.theneo.io/match-trade/broker-api-v2/user-accounts.md): User accounts represent the top-level identity layer in the Match-Trader platform. Each user account is identified by a unique UUID and an email address, and serves as the owner of one or more trading accounts . This section describes the available endpoints for creating, retrieving, updating, and deleting user accounts within a given broker's scope. A user account is a platform-level entity - does not carry any trading-specific data itself, but acts as a container that groups trading accounts belonging to a single end user. • [Get User Accounts](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/get-user-accounts.md): Retrieves a paginated list of all user accounts within the authenticated broker's scope. • [Get User Account by Email](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/get-user-account-by-email.md): This endpoint retrieves a User Account by email address. On the Match-Trader platform, the email is the user identifier - one email = one user account , so duplicate user accounts with the same email are not allowed. • [Get User Account by Uuid](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/get-user-account-by-uuid.md): Retrieves a single user account by its UUID. • [Create User Account](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/create-user-account.md): Creates a new user account under the authenticated broker. The account is registered directly on the Match-Trader platform. The creation response does not include the updated field - this field only appears in subsequent GET responses after the account has been modified • [Update User Account](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/update-user-account.md): Updates the email address of an existing user account • [Change User's Password](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/change-user-s-password.md): Changes the password for a specified user account. • [Delete User Account](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/delete-user-account.md): Deletes a single user account by its UUID. The optional query parameter deleteFromTradingSystem controls whether the associated trading accounts are also removed from the trading system. If deletion of any of the associated trading accounts fails, the user accounts are not deleted. Warning : This operation is irreversible. When deleteFromTradingSystem=true, the deletion cascades to all associated trading accounts. • [Bulk Delete User Accounts](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/bulk-delete-user-accounts.md): Deletes multiple user accounts in a single request. Warning : Like the single-account delete, this operation is irreversible. All provided UUIDs will be processed in a single batch deletion request. • [Retrieve One Time Token for Login](https://app.theneo.io/match-trade/broker-api-v2/user-accounts/retrieve-one-time-token-for-login.md): Generates a one-time token (OTT) - a Single Sign-On (SSO) mechanism that lets an external system (e.g. a Client Office or other third-party tool) log a user into the platform without re-entering their trading credentials. The flow is one-way only: from the external system to the platform, never the reverse. The token is single-use and short-lived, suited for flows like deep links, support tools, and automated onboarding - anywhere a broker's backend needs to hand off an already-authenticated user to the platform. Only one token per user account is valid at once. Resending the request will disable the previously generated token even if the validity time has not passed. Security Requirements Access to this endpoint is protected on two levels: Your API key must have this endpoint's permission enabled (API ACCESS → Create One Time Token for Login ). It is disabled by default. The IP address from which the request is made must be whitelisted by our Support team. Requests from a non-whitelisted IP are rejected even with a valid, correctly-permissioned API key - contact Support to have your integration's IP(s) added. Using the Token on the Platform Once generated, the token is redeemed by opening the platform with an auth query parameter set to the token value: {platformURL}/?auth={oneTimeToken} Example: https://demo.match-trade.com/?auth=0930fa2c-b12a-4a1e-8e50-45dcc8ce7ada • [Trading Accounts](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts.md): A trading account is the core entity used for all trading activity on the Match-Trader platform. Each trading account belongs to exactly one user account and is identified by both a numeric login and a UUID . Trading accounts hold financial state (balance, equity, margin, etc.) and are assigned to a group which defines their trading conditions. All trading accounts created via Broker API v2 are always created as retail accounts. It is not possible to create a non-retail account through this API. Every trading account resource includes a version field - a numeric revision counter that is used for optimistic locking . When multiple systems or services update the same trading account concurrently, there is a risk that one update silently overwrites another. The version field prevents this: each successful update increments the version, and any update request that carries an outdated version is rejected, forcing the caller to re-fetch the latest state and retry. Typical flow: Fetch the trading account — note the current version value in the response. Send your update request — include that version in the request body. If the request is rejected due to a version mismatch, re-fetch the account to get the latest version and retry. Omitting version from an update request will result in a validation error. • [Create Trading Account](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/create-trading-account.md): Creates a new trading account and assigns it to the specified user account. • [Get Trading Accounts](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/get-trading-accounts.md): Retrieves a paginated list of all trading accounts within the broker's scope. Supports optional filtering by group and access rights. • [Get User's Trading Accounts](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/get-user-s-trading-accounts.md): Retrieves all trading accounts belonging to a specific user account. • [Get Trading Account by Login](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/get-trading-account-by-login.md): Retrieves a single trading account by its login number. • [Get Trading Account by Uuid](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/get-trading-account-by-uuid.md): Retrieves a single trading account by its UUID. • [Update Trading Account](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/update-trading-account.md): Partially updates an existing trading account. Only fields included in the request body are modified - omitted fields remain unchanged. • [Delete Trading Account](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/delete-trading-account.md): Deletes a single trading account. • [Bulk Delete Trading Accounts](https://app.theneo.io/match-trade/broker-api-v2/trading-accounts/bulk-delete-trading-accounts.md): Deletes multiple trading accounts in a single request. • [Balance Operations](https://app.theneo.io/match-trade/broker-api-v2/balance-operations.md): Balance Operations provides administrative financial adjustments for an existing trading account. These endpoints are non-idempotent. Sending the same request multiple times will apply the adjustment multiple times. • [Deposit](https://app.theneo.io/match-trade/broker-api-v2/balance-operations/deposit.md): Credits the trading account balance by the specified amount. • [Withdraw](https://app.theneo.io/match-trade/broker-api-v2/balance-operations/withdraw.md): Debits the trading account balance by the specified amount. • [Credit In](https://app.theneo.io/match-trade/broker-api-v2/balance-operations/credit-in.md): Increases the trading account credit by the specified amount. • [Credit Out](https://app.theneo.io/match-trade/broker-api-v2/balance-operations/credit-out.md): Decreases the trading account credit by the specified amount. • [Trading](https://app.theneo.io/match-trade/broker-api-v2/trading.md): The Trading module provides administrative trading operations executed on behalf of a client trading account. It includes read access to instrument configuration for a given group, and write access to core dealing workflows: opening, editing, closing, and reopening positions, managing pending orders, and creating correction orders. Execution model : Trade operation endpoints return an acknowledgement response rather than a full post-trade state snapshot. Timestamps : All date-time fields follow RFC 3339 format (e.g. 2024-01-13T09:20:04.651Z). • [Get Symbols](https://app.theneo.io/match-trade/broker-api-v2/trading/get-symbols.md): Retrieves the effective instrument configuration for a given trading group, including trading parameters such as precision, volume constraints, markups, leverage, stop/freeze levels, and trading hours. • [Open Position](https://app.theneo.io/match-trade/broker-api-v2/trading/open-position.md): Submits a market order to open a new position for the specified trading account. • [Edit Position](https://app.theneo.io/match-trade/broker-api-v2/trading/edit-position.md): Modifies the stop-loss and/or take-profit levels of an existing open position. • [Close Positions](https://app.theneo.io/match-trade/broker-api-v2/trading/close-positions.md): Closes one or more specified open positions for a given trading account. • [Close Position Partially](https://app.theneo.io/match-trade/broker-api-v2/trading/close-position-partially.md): Partially closes an open position by reducing its volume. • [Close All Positions](https://app.theneo.io/match-trade/broker-api-v2/trading/close-all-positions.md): Closes all open positions for one or more trading accounts in a single request. • [Reopen Position](https://app.theneo.io/match-trade/broker-api-v2/trading/reopen-position.md): Reopens a previously closed position, identified by its position ID and close timestamp. • [Create Pending Order](https://app.theneo.io/match-trade/broker-api-v2/trading/create-pending-order.md): Creates a pending order (e.g. LIMIT or STOP) for a specified trading account. • [Cancel Pending Order](https://app.theneo.io/match-trade/broker-api-v2/trading/cancel-pending-order.md): Cancels an existing pending order. • [Create Correction Order](https://app.theneo.io/match-trade/broker-api-v2/trading/create-correction-order.md): Creates a correction order - an operation used to adjust or compensate a trading account's history (e.g. price corrections or manual adjustments linked to a closing order). • [Trading Data](https://app.theneo.io/match-trade/broker-api-v2/trading-data.md): The Trading Data module provides read-only administrative query endpoints for retrieving historical and real-time trading state across one or more trading accounts. It is designed for reporting, risk monitoring, and data reconciliation use cases. • [Get Orders History](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-orders-history.md): Retrieves historical orders (market, pending, correction) for one or more trading accounts, optionally filtered by login list, group, time range, and order status. Either 'logins' or 'groups' (or both) must be provided for the endpoint to work; if neither is specified, the request will fail. • [Get Orders by Ids](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-orders-by-ids.md): Retrieves specific historical orders by their IDs for a single trading account within an optional time range. • [Get Open Positions](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-open-positions.md): Retrieves all currently open positions for one or more trading accounts, filterable by login list, group, and access type. Either 'logins' or 'groups' (or both) must be provided for the endpoint to work; if neither is specified, the request will fail. • [Get Open Positions by Ids](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-open-positions-by-ids.md): Retrieves specific open positions by their IDs for a single trading account. • [Get Pending Orders](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-pending-orders.md): Retrieves active pending orders for a single trading account. • [Get Closed Positions](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-closed-positions.md): Retrieves closed positions for one or more trading accounts within a specified time range. Either 'logins' or 'groups' (or both) must be provided for the endpoint to work; if neither is specified, the request will fail. • [Get Closed Positions by Ids](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-closed-positions-by-ids.md): Retrieves specific closed positions by their IDs for a single trading account within an optional time range. • [Get Ledgers](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-ledgers.md): Retrieves finance and ledger records (deposits, withdrawals, commissions, swaps, credit operations, etc.) for one or more trading accounts within a time range. Either 'logins' or 'groups' (or both) must be provided for the endpoint to work; if neither is specified, the request will fail. • [Get Candles](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-candles.md): Retrieves OHLC candlestick data for a given instrument symbol and time interval. This endpoint is not subject to group-based access validation. • [Get Groups](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-groups.md): Retrieves detailed configuration for one or more trading groups, including per-symbol trading parameters such as markups, leverage, swap rates, commission, and volume constraints. • [Get Group Names](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-group-names.md): Returns a flat list of all trading group names accessible to the caller. Intended for lightweight discovery without fetching full group configuration. • [Get Platform Logs](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-platform-logs.md): Retrieves platform-level audit and activity logs generated by client terminals. Logs capture user activity events such as logins, trade actions, and payment operations, along with client metadata (device, browser, IP, app version, etc.). Filters only return results for exact matches • [Get Balance Snapshots](https://app.theneo.io/match-trade/broker-api-v2/trading-data/get-balance-snapshots.md): Retrieves point-in-time balance snapshots for one or more trading accounts within a given time range. Snapshots capture the full financial state of an account at a specific moment and are typically generated at the end-of-day cycle. • [Prediction Market](https://app.theneo.io/match-trade/broker-api-v2/prediction-market.md): Prediction Market is a dedicated trading module within the Match-Trader platform that allows brokers to offer their clients the ability to speculate on the outcomes of real-world events - political, economic, sporting, and more. Instead of trading traditional instruments, users take positions on binary outcomes (e.g. “Will candidate X win the election?”) by trading YES or NO instruments for each possible outcome. Each event is represented as a Bet . A Bet contains one or more Outcomes , and each Outcome is backed by a pair of native PRED -type instruments in the trading engine - one for the YES side and one for the NO side. Prices on these instruments move in the range of 0 to 1, reflecting the implied probability of that outcome occurring. The endpoints in this section cover data retrieval: browsing available events, viewing event details, and resolving which instruments correspond to each outcome. Actual trading (opening and closing positions on YES/NO instruments) is handled by the standard trading endpoints under the Trading section. A dedicated API permission is required to access the Prediction Market endpoints. • [Get Bets](https://app.theneo.io/match-trade/broker-api-v2/prediction-market/get-bets.md): Returns a paginated list of Bets (events) available on the platform. Results can be filtered by status to show only currently tradeable markets. • [Get Bet by Uuid](https://app.theneo.io/match-trade/broker-api-v2/prediction-market/get-bet-by-uuid.md): Returns full metadata for a single Bet, identified by its UUID. Use this endpoint to build a detail or event view in your project - for example, displaying the event title, description, category, and scheduled close time before a user selects an outcome to trade. • [Get Bet Outcomes](https://app.theneo.io/match-trade/broker-api-v2/prediction-market/get-bet-outcomes.md): Returns the list of possible outcomes for a specific Bet. Each outcome includes the names of its corresponding YES and NO trading instruments in the engine, allowing your project to directly link an outcome to tradeable symbols without any manual symbol mapping. Both active and already-resolved outcomes are returned, each with their respective status, so the full picture of an event can be displayed even after resolution. To open a position on an outcome, use the instrument names returned here ( instrumentYesName or instrumentNoName ) with the standard POST /v1/trading-accounts/positions/open endpoint. Only BUY-side orders are accepted for Prediction Market instruments, and positions must be opened on retail trading accounts. • [gRPC](https://app.theneo.io/match-trade/broker-api-v2/grpc.md): Overview Broker-API v2 exposes a set of server-streaming gRPC endpoints for real-time data access. All streams are long-lived: the server pushes updates to the client as they happen and sends periodic heartbeat messages to keep the connection alive. Protocol : gRPC (HTTP/2) Transport : Insecure for internal/private hosts; TLS for public hostnames Authentication : Described in the Authentication section here Stream pattern : All RPCs are request → stream<response> (server-side streaming) Heartbeat : Each stream sends a bool heartbeat = true message periodically (30 seconds) when no data event occurs The address to connect to the gRPC stream is: grpc-broker-api-v2-demo.match-trader.com . Protobuf Below is the corresponding Protobuf definition used for the gRPC service. Protocol Buffers syntax = 'proto3'; option java_multiple_files = true; option java_package = 'com.matchtrade.mtr.broker_api.grpc'; package com.matchtrade.mtr.broker_api.grpc; // Equity service EquityServiceExternal { rpc getEquityStream (PBEquityRequestExternal) returns (stream PBEquityStreamResponseExternal) {} } message PBEquityRequestExternal { repeated string groups = 1; repeated string logins = 2; repeated PBClientAccessRightsTypeExternal accessRightsFilter = 3; bool includeStateHistory = 4; } message PBEquityStreamResponseExternal { oneof msg { PBEquityResponseExternal equity = 1; bool heartbeat = 2; } } message PBEquityResponseExternal { string login = 1; string equity = 2; string balance = 3; string credit = 4; } // Group service GroupServiceExternal { rpc getGroupChangesStream(PBGroupChangeStreamRequestExternal) returns (stream PBGroupChangeStreamResponseExternal) { } } message PBGroupChangeStreamRequestExternal { repeated string groups = 1; } message PBGroupChangeStreamResponseExternal { oneof msg { PBGroupUpdatedExternal groupUpdated = 1; PBGroupDeletedExternal groupDeleted = 2; bool heartbeat = 3; } } message PBGroupUpdatedExternal { string group = 1; string currency = 2; int32 currencyPrecision = 3; string groupOwner = 4; map<string, PBGroupSymbolExternal> symbols = 5; PBMarginCalculationTypeExternal marginCalculationType = 6; bool isManager = 7; bool isAdmin = 8; bool isBrokerManager = 9; int64 marginCall = 10; int64 swapCalculationTime = 11; PBStopoutAndMarginCallTypeExternal stopoutAndMarginCallType = 12; bool commissionUpfront = 13; bool islamicSwap = 14; bool demoGroup = 15; PBHedgeMarginCalculationTypeExternal hedgeMarginCalculationType = 16; int64 eodMode = 17; int64 eomMode = 18; int64 eodSnapshotTime = 19; bool defaultRetailEnabled = 20; bool coverageMode = 21; int64 orderProcessingDelay = 22; double stopoutLevel = 23; bool hedgingEnabled = 24; int64 pendingMultiplierPer1000 = 25; int64 defaultLeverageRatioPercent = 26; int64 commissionPerMillion = 27; int64 agentCommissionPerMillion = 28; } message PBGroupDeletedExternal { string group = 1; PBGroupDeletedReasonExternal reason = 2; enum PBGroupDeletedReasonExternal { GROUP_DELETED_REASON_UNSPECIFIED = 0; GROUP_DELETED_REASON_DELETED = 1; } } message PBGroupSymbolExternal { string symbol = 1; string bidMarkup = 2; string askMarkup = 3; double leverage = 4; string swapBuy = 5; string swapSell = 6; string freezeLevel = 7; string stopsLevel = 8; PBSwapTypeExternal swapType = 9; string volumeMin = 10; string volumeMax = 11; string minCommission = 12; bool fixedLeverage = 13; string rawLeverage = 14; PBCommissionTypeExternal commissionType = 15; string commissionPerMillion = 16; } enum PBMarginCalculationTypeExternal { MARGIN_CALCULATION_TYPE_UNSPECIFIED = 0; MARGIN_CALCULATION_TYPE_UNREALIZED_LOSS_ONLY = 1; MARGIN_CALCULATION_TYPE_UNREALIZED_PROFIT_LOSS = 2; } enum PBStopoutAndMarginCallTypeExternal { STOPOUT_AND_MARGIN_CALL_TYPE_UNSPECIFIED = 0; STOPOUT_AND_MARGIN_CALL_TYPE_MARGIN_LEVEL_PERCENTAGE = 1; STOPOUT_AND_MARGIN_CALL_TYPE_ABSOLUTE_EQUITY_USD = 2; STOPOUT_AND_MARGIN_CALL_TYPE_OFF = 3; } enum PBHedgeMarginCalculationTypeExternal { HEDGE_MARGIN_CALCULATION_TYPE_UNSPECIFIED = 0; HEDGE_MARGIN_CALCULATION_TYPE_NETTING = 1; HEDGE_MARGIN_CALCULATION_TYPE_LARGER_LEG = 2; } enum PBSwapTypeExternal { SWAP_TYPE_UNSPECIFIED = 0; SWAP_TYPE_POINTS = 1; SWAP_TYPE_PERCENTS = 2; SWAP_TYPE_NOT_DEFINED = 3; } enum PBCommissionTypeExternal { COMMISSION_TYPE_UNSPECIFIED = 0; COMMISSION_TYPE_USD_PER_MILLION = 1; COMMISSION_TYPE_USD_PER_CONTRACT = 2; COMMISSION_TYPE_USD_PER_LOT = 3; COMMISSION_TYPE_PERMILLS = 4; COMMISSION_TYPE_POINTS = 5; } // Ledger service LedgerServiceExternal { rpc getLedgersStream(PBLedgersRequestExternal) returns (stream PBLedgersStreamResponseExternal) {} } message PBLedgersRequestExternal { repeated string logins = 2; repeated string groups = 3; repeated PBHistoryOperationTypeExternal historyOperationType = 4; repeated PBAdditionalTypeExternal additionalTypes = 5; } enum PBHistoryOperationTypeExternal { HISTORY_OPERATION_TYPE_UNSPECIFIED = 0; HISTORY_OPERATION_TYPE_DEPOSIT = 1; HISTORY_OPERATION_TYPE_WITHDRAWAL = 2; HISTORY_OPERATION_TYPE_CREDIT_IN = 3; HISTORY_OPERATION_TYPE_CREDIT_OUT = 4; HISTORY_OPERATION_TYPE_AGENT_COMMISSION = 5; HISTORY_OPERATION_TYPE_COMMISSIONS = 6; HISTORY_OPERATION_TYPE_SWAPS = 7; HISTORY_OPERATION_TYPE_OTHER = 8; HISTORY_OPERATION_TYPE_CLOSED_POSITION = 9; } enum PBAdditionalTypeExternal { ADDITIONAL_TYPE_LEDGER_NONE = 0; ADDITIONAL_TYPE_NEGATIVE_BALANCE_WITHDRAW = 1; ADDITIONAL_TYPE_CORRECTION = 2; ADDITIONAL_TYPE_REVENUE_SHARE = 3; ADDITIONAL_TYPE_INVOICE_PAYMENT = 4; ADDITIONAL_TYPE_MINIMUM_MONTHLY = 5; ADDITIONAL_TYPE_AGENT_COMMISSION_LEDGER = 6; ADDITIONAL_TYPE_NEGATIVE_BALANCE_CORRECTION = 7; ADDITIONAL_TYPE_SETTLEMENT = 8; ADDITIONAL_TYPE_INACTIVITY_FEE = 9; ADDITIONAL_TYPE_BONUS_IN_OUT = 10; ADDITIONAL_TYPE_STORAGE_FEE = 11; ADDITIONAL_TYPE_M2P = 12; ADDITIONAL_TYPE_BANK = 13; ADDITIONAL_TYPE_CRYPTO = 14; ADDITIONAL_TYPE_DEPOSIT_CORRECTION = 15; ADDITIONAL_TYPE_WITHDRAW_CORRECTION = 16; ADDITIONAL_TYPE_SWAP_CORRECTION = 17; ADDITIONAL_TYPE_COMMISSION_CORRECTION = 18; ADDITIONAL_TYPE_AGENT_FEE_CORRECTION = 19; ADDITIONAL_TYPE_MINIMUM_MONTHLY_FEE_CORRECTION = 20; ADDITIONAL_TYPE_REVENUE_SHARE_CORRECTION = 21; ADDITIONAL_TYPE_CPA = 22; ADDITIONAL_TYPE_DEPOSIT_BONUS = 23; ADDITIONAL_TYPE_CASHBACK = 24; ADDITIONAL_TYPE_IB_COMMISSION = 25; ADDITIONAL_TYPE_INTERNAL_TRANSFER = 26; ADDITIONAL_TYPE_NORIA_PAYMENT = 27; ADDITIONAL_TYPE_UNKNOWN_LEDGER = 28; ADDITIONAL_TYPE_FUNDING_ALLOCATION = 29; ADDITIONAL_TYPE_ACCOUNT_FEE = 30; ADDITIONAL_TYPE_PERFORMANCE_FEE = 31; ADDITIONAL_TYPE_MONTHLY_FEE = 32; ADDITIONAL_TYPE_MARGIN_LIMIT = 33; } message PBLedgersStreamResponseExternal { oneof response { PBLedgers ledgers = 1; bool heartbeat = 2; } } message PBLedgers { repeated PBLedger ledgers = 1; } message PBLedger { string id = 1; PBHistoryOperationTypeExternal historyOperationType = 2; string time = 3; double profit = 4; string comment = 5; string group = 6; string login = 7; PBAdditionalTypeExternal additionalType = 8; } // Order service OrderServiceExternal { rpc getOrdersUpdateStream(PBOrdersUpdateStreamRequestExternal) returns (stream PBOrdersUpdateStreamResponseExternal) { } } message PBOrdersUpdateStreamResponseExternal { oneof msg { PBOrderExternal order = 1; bool heartbeat = 2; } } message PBOrderExternal { string orderId = 1; string symbol = 2; string alias = 3; double volume = 4; PBPendingTypeExternal type = 5; string creationTime = 6; double activationPrice = 7; PBOrderSideExternal side = 8; double stopLoss = 9; double takeProfit = 10; string comment = 11; PBRequestUpdateTypeExternal requestUpdateType = 12; string groupName = 13; string login = 14; } message PBOrdersUpdateStreamRequestExternal { repeated string logins = 1; repeated string groups = 2; repeated PBClientAccessRightsTypeExternal accessRightsFilter = 3; } enum PBPendingTypeExternal { PENDING_TYPE_UNSPECIFIED = 0; PENDING_TYPE_LIMIT = 1; PENDING_TYPE_STOP = 2; } enum PBRequestUpdateTypeExternal { REQUEST_UPDATE_TYPE_UNSPECIFIED = 0; REQUEST_UPDATE_TYPE_NEW = 1; REQUEST_UPDATE_TYPE_UPDATE = 2; REQUEST_UPDATE_TYPE_CLOSED = 3; REQUEST_UPDATE_TYPE_PROFIT_CHANGE = 4; REQUEST_UPDATE_TYPE_PARTIALLY_CLOSED = 5; } // Position service PositionsServiceExternal { rpc getOpenPositionsStream (PBOpenPositionRequestExternal) returns (stream PBOpenPositionsStreamResponseExternal) {} } message PBPosition { string id = 1; string symbol = 2; string alias = 15; double volume = 3; PBOrderSideExternal side = 4; string openTime = 5; double openPrice = 6; double stopLoss = 7; double takeProfit = 8; double swap = 9; double profit = 10; double netProfit = 11; double currentPrice = 12; double commission = 13; repeated PBPartial partials = 14; double margin = 16; } message PBPartial { string id = 1; double volume = 3; double oldPartialVolume = 4; string openTime = 6; double openPrice = 7; double swap = 8; double profit = 9; double netProfit = 10; double commission = 12; double margin = 13; } message PBOpenPositionRequestExternal { repeated string groups = 1; repeated string logins = 2; } message PBOpenPositionsStreamResponseExternal { oneof msg { PositionsPerClient positions = 1; bool heartbeat = 2; } } message PositionsPerClient { repeated PBPositionWithGroup positions = 1; } message PBPositionWithGroup { string login = 1; string group = 2; string id = 3; string symbol = 4; double volume = 5; PBOrderSideExternal side = 6; string openTime = 7; double openPrice = 8; double stopLoss = 9; double takeProfit = 10; double swap = 11; double profit = 12; double netProfit = 13; double currentPrice = 14; double commission = 15; repeated PBPartialExternal partials = 16; string alias = 17; PBRequestUpdateTypeExternal requestUpdateType = 18; } message PBPartialExternal { string id = 1; double volume = 2; string openTime = 3; double openPrice = 4; double swap = 5; double profit = 6; double netProfit = 7; double commission = 8; } // Quotation service QuotationsServiceExternal { rpc getQuotationsWithMarkupStream (PBQuotationsWithMarkupStreamRequestExternal) returns (stream PBQuotationSimpleExternal) {} } message PBQuotationsWithMarkupStreamRequestExternal { repeated string symbols = 1; optional string group = 2; optional int64 throttlingMs = 3; optional bool smartThrottling = 4; } message PBQuotationSimpleExternal { oneof msg { PBQuotation quotation = 1; bool heartbeat = 2; } } message PBQuotation { string symbol = 1; double bidPrice = 2; double askPrice = 3; int64 timestampInMillis = 4; optional PBDailyStatisticsExternal dailyStatistics = 5; } message PBDailyStatisticsExternal { double change = 1; double high = 2; double low = 3; } // Symbol service SymbolsServiceExternal { rpc getSymbolsChangedStream(PBSymbolChangedRequestExternal) returns (stream PBSymbolChangedStreamResponseExternal) {} } enum PBInstrumentTypeExternal { INSTRUMENT_TYPE_UNSPECIFIED = 0; INSTRUMENT_TYPE_FOREX = 1; INSTRUMENT_TYPE_CFD = 2; INSTRUMENT_TYPE_FOREXCFD = 3; INSTRUMENT_TYPE_PRED = 4; } message PBSymbolChangedRequestExternal {} message PBSymbolChangedStreamResponseExternal { oneof msg { PBSymbolUpdatedOrCreatedExternal symbolUpdated = 1; PBSymbolDeletedExternal symbolDeleted = 2; PBSymbolUpdatedOrCreatedExternal symbolCreated = 3; bool heartbeat = 4; } } message PBSymbolUpdatedOrCreatedExternal { string symbol = 1; string alias = 2; string baseCurrency = 3; string quoteCurrency = 4; PBInstrumentTypeExternal type = 5; string description = 6; int32 pricePrecision = 7; int32 volumePrecision = 8; string volumeMin = 9; string volumeMax = 10; string volumeStep = 11; string contractSize = 12; string multiplier = 13; string divider = 14; string sizeOfOnePoint = 15; double commission = 16; string swapBuy = 17; string swapSell = 18; double leverage = 19; PBTerminationTypeExternal terminationType = 20; string terminationDate = 21; repeated string tags = 22; repeated PBTradeHoursExternal tradingHours = 23; } message PBSymbolDeletedExternal { string symbol = 1; } message PBTradeHoursExternal { int32 dayNumber = 1; int32 openHours = 2; int32 openMinutes = 3; int32 openSeconds = 4; int32 closeHours = 5; int32 closeMinutes = 6; int32 closeSeconds = 7; } enum PBTerminationTypeExternal { TERMINATION_TYPE_UNSPECIFIED = 0; TERMINATION_TYPE_EXPIRATION = 1; TERMINATION_TYPE_ROLLOVER = 2; } // Trading account Info service AccountInfoServiceExternal { rpc getTradingAccountInfoChangedStream (PBTradingAccountInfoChangedRequestExternal) returns (stream PBTradingAccountInfoChangedStreamResponseExternal) {} } message PBTradingAccountInfoChangedRequestExternal { repeated string groups = 1; repeated PBClientAccessRightsTypeExternal accessRightsFilter = 2; } message PBTradingAccountInfoChangedStreamResponseExternal { oneof msg { PBTradingAccountUpdated tradingAccountUpdated = 1; PBTradingAccountDeleted tradingAccountDeleted = 2; bool heartbeat = 3; } } message PBTradingAccountUpdated { string login = 1; PBAccountInfoUpdatedDetails current = 2; PBAccountInfoUpdatedDetails prev = 3; } message PBTradingAccountDeleted { string login = 1; string group = 2; PBTradingAccountDeletedReasonExternal reason = 3; enum PBTradingAccountDeletedReasonExternal { TRADING_ACCOUNT_DELETED_REASON_UNSPECIFIED = 0; TRADING_ACCOUNT_DELETED_REASON_ACCOUNT_DELETED = 1; TRADING_ACCOUNT_DELETED_REASON_RIGHTS_REVOKED = 2; TRADING_ACCOUNT_DELETED_REASON_ACCOUNT_INTERNAL_ERROR = 3; } } message PBAccountInfoUpdatedDetails { optional string group = 2; optional int32 leverageRatioPercent = 3; optional bool isRetail = 4; optional bool isProView = 5; optional string country = 8; optional string name = 9; optional string surname = 10; optional string address = 11; optional string email = 12; optional string phone = 13; optional string province = 14; optional string zipCode = 15; optional string city = 16; optional string remarks = 17; optional string bankAccount = 18; optional string accountCurrency = 19; optional int32 accountCurrencyPrecision = 20; optional int64 registrationDate = 21; optional PBClientAccessRightsTypeExternal accessRightsType = 22; int32 version = 23; } // Trading Event service TradingEventsServiceExternal { rpc getTradingEventsStream (PBTradingEventsStreamRequestExternal) returns (stream PBTradingEventsStreamResponseExternal) { } } message PBTradingEventsStreamRequestExternal { repeated string logins = 1; repeated string groups = 2; repeated PBClientAccessRightsTypeExternal accessRightsFilter = 3; } message PBTradingEventsStreamResponseExternal { oneof msg { PBTradingExternalEvents tradingEvents = 1; bool heartbeat = 2; } } message PBTradingExternalEvents { repeated PBTradingExternalEvent tradingEvents = 1; } message PBTradingExternalEvent { oneof msg { PBMarginCallExternalEvent marginCallEvent = 1; PBStopOutExternalEvent stopOutEvent = 2; PBTakeProfitExternalEvent takeProfitEvent = 3; PBStopLossExternalEvent stopLossEvent = 4; PBOrderActivationExternalEvent orderActivationEvent = 5; } string login = 6; string group = 7; } message PBOrderActivationExternalEvent { string orderId = 1; string instrument = 2; PBOrderSideExternal side = 3; double volume = 4; double activationPrice = 5; } message PBMarginCallExternalEvent { double marginLevel = 1; } message PBStopOutExternalEvent { string orderId = 1; string instrument = 2; double volume = 3; } message PBTakeProfitExternalEvent { string orderId = 1; string instrument = 2; PBOrderSideExternal side = 3; double volume = 4; double netProfit = 5; string walletCurrency = 6; } message PBStopLossExternalEvent { string orderId = 1; string instrument = 2; PBOrderSideExternal side = 3; double volume = 4; double netProfit = 5; string walletCurrency = 6; } // Common enum PBOrderSideExternal { ORDER_SIDE_UNSPECIFIED = 0; ORDER_SIDE_BUY = 1; ORDER_SIDE_SELL = 2; } enum PBClientAccessRightsTypeExternal { CLIENT_ACCESS_RIGHTS_TYPE_UNSPECIFIED = 0; CLIENT_ACCESS_RIGHTS_TYPE_FULL = 1; CLIENT_ACCESS_RIGHTS_TYPE_CLOSE_ONLY = 2; CLIENT_ACCESS_RIGHTS_TYPE_TRADING_DISABLED = 3; CLIENT_ACCESS_RIGHTS_TYPE_TRADING_AND_LOGIN_DISABLED = 4; CLIENT_ACCESS_RIGHTS_TYPE_LOCKED_CLOSE_ONLY = 5; } • [getEquityStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getequitystream.md): Streams real-time equity updates for trading accounts. The server pushes a message whenever the balance, equity, or credit of a matching account changes. On connect, the server does not send a full snapshot - only live changes are streamed. The logins filter currently returns data for all accounts in the subscribed group, not only the specified login. Treat the filter as an OR across both groups and logins. • [getGroupChangesStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getgroupchangesstream.md): Streams changes to trading group configurations. After subscribing, the server emits events only when a group is created, modified or deleted. • [getLedgersStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getledgersstream.md): Streams financial ledger entries in real-time: deposits, withdrawals, credits, commissions, and closed position settlements. The stream fires for every new financial operation matching the filter. • [getOrdersUpdateStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getordersupdatestream.md): Streams real-time updates for pending orders (limit and stop orders). Fires on order creation, modification, activation, or cancellation. • [getOpenPositionsStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getopenpositionsstream.md): Streams real-time updates for open positions. After subscribing, the server only sends incremental updates for positions that change from that point onward; no initial full state is provided. • [getQuotationsWithMarkupStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getquotationswithmarkupstream.md): Streams real-time bid/ask prices with group-specific markup applied. Optionally includes daily statistics (change, high, low). • [getSymbolsChangedStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/getsymbolschangedstream.md): Streams changes to the instrument catalog. On connect, the server sends symbolUpdated messages for every existing symbol. Subsequent messages fire when symbols are created, modified, or deleted. The request message is empty - no filter parameters. The stream covers all symbols globally. • [getTradingAccountInfoChangedStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/gettradingaccountinfochangedstream.md): Streams changes to trading account metadata - group assignment, personal details, access rights, and more. Fires when an account is created, updated, or removed from the subscribed groups. • [getTradingEventsStream](https://app.theneo.io/match-trade/broker-api-v2/grpc/gettradingeventsstream.md): Streams risk-related events for trading accounts: margin calls, stop-outs, take profit / stop loss hits, and pending order activations. This is a low-frequency stream - during quiet periods it may produce only heartbeats.