FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::BalanceMsg Struct Reference

The account's holding of one asset on one venue (EventType::Balance), as the venue reports it at its time hdr.exch_ts. More...

#include <fastmm/core/messages.hpp>

Public Attributes

EventHeader hdr
 
Notional free
 64
 
Notional locked
 72
 
Notional total
 80
 
Notional equity
 88
 
Notional maintenance
 96
 
FixedString< 8 > asset
 104 -> 113
 
std::uint8_t flags
 113
 
std::uint8_t pad_ [6]
 -> 120
 
Notional withdrawable
 120, with kWithdrawable
 

Static Public Attributes

static constexpr std::uint8_t kSnapshot = 1U << 0
 
static constexpr std::uint8_t kSnapshotEnd = 1U << 1
 
static constexpr std::uint8_t kAccount = 1U << 2
 
static constexpr std::uint8_t kWithdrawable = 1U << 3
 

Detailed Description

The account's holding of one asset on one venue (EventType::Balance), as the venue reports it at its time hdr.exch_ts.

Every amount is absolute, in asset: a venue update replaces the last one (a delta would turn one lost message into a lasting error). hdr.instrument is invalid. spot free (spendable now) and locked (held by open orders); total = free + locked; equity = total; maintenance 0. derivatives free = available for new orders, locked = initial margin in use (positions and orders), total = wallet balance, equity = wallet + unrealised PnL, maintenance = maintenance margin. kAccount: the account's cross-collateral margin (Bybit's unified account, OKX's multi-currency modes, Binance USD-M multi-assets mode) valued in asset, usually USD; the derivatives of the venue draw on it instead of their settlement asset. A snapshot (the balance leg of a reconciliation, a REST refresh) is a run of messages flagged kSnapshot whose last one also carries kSnapshotEnd: an asset of the venue it did not name holds nothing. A snapshot naming no asset is one message with an empty asset. kWithdrawable: withdrawable is what the venue lets leave the account now by an internal transfer (Binance USD-M maxWithdrawAmount, which unrealised profit does not count towards). Without the flag a venue reports none and free is what can leave.

Member Data Documentation

◆ kSnapshot

constexpr std::uint8_t fastmm::BalanceMsg::kSnapshot = 1U << 0
staticconstexpr

◆ kSnapshotEnd

constexpr std::uint8_t fastmm::BalanceMsg::kSnapshotEnd = 1U << 1
staticconstexpr

◆ kAccount

constexpr std::uint8_t fastmm::BalanceMsg::kAccount = 1U << 2
staticconstexpr

◆ kWithdrawable

constexpr std::uint8_t fastmm::BalanceMsg::kWithdrawable = 1U << 3
staticconstexpr

◆ hdr

EventHeader fastmm::BalanceMsg::hdr

◆ free

Notional fastmm::BalanceMsg::free

64

◆ locked

Notional fastmm::BalanceMsg::locked

72

◆ total

Notional fastmm::BalanceMsg::total

80

◆ equity

Notional fastmm::BalanceMsg::equity

88

◆ maintenance

Notional fastmm::BalanceMsg::maintenance

96

◆ asset

FixedString<8> fastmm::BalanceMsg::asset

104 -> 113

◆ flags

std::uint8_t fastmm::BalanceMsg::flags

113

◆ pad_

std::uint8_t fastmm::BalanceMsg::pad_[6]

-> 120

◆ withdrawable

Notional fastmm::BalanceMsg::withdrawable

120, with kWithdrawable