Skip to content

Fix balance

BalanceFix

Description: Recalculates balance and credit state for the provided account logins from completed trade and finance transactions.

Access Control

Requires set_accounts_balance for manager/dealer sessions. The target account must also match the manager groups and brand scope loaded from the cached manager record. Token payload is used only for manager id and session type.

Request Parameters

Name Type Required Description
logins int[] Yes Account logins to recalculate

Request Example

{
  "logins": [123456, 123457]
}

Response Parameters

In the raw TCP response envelope, the fields below are returned inside data.

Name Type Description
accepted bool true when the command was accepted for processing
fixed int Number of logins passed in the request

Response Example

{
  "accepted": true,
  "fixed": 2
}

Errors

Code Description
400 Invalid request payload
500 Balance recalculation failed

Reconciliation Rules

  • Completed market trade profit, commission, and storage are accumulated into balance.
  • Completed OP_BALANCE_IN and OP_BALANCE_OUT transactions are accumulated into balance.
  • Completed OP_CREDIT_IN and OP_CREDIT_OUT transactions are accumulated into credit.
  • Pending, declined, and deleted finance transactions do not contribute to reconstructed values.
  • Equity and free margin are recalculated after reconstruction.