Skip to main content

Module tbank

Module tbank 

Source
Expand description

T-Bank connectors and the T-Bank gRPC client.

Re-exports§

pub use brokapi_tbank_protocol as protocol;

Modules§

cid
T-Bank client order id codec
config
Connector configuration
core
Sans-io cores: protocol state machines without sockets, timers or async runtime.
emit
Egress buffers in front of the shared channel: the code is shared with BCS, see brokapi_runtime::Emitter.
error
gRPC status -> public connector errors.
ids
Instrument identifiers and clocks. Conversions never touch the network.
limits
Loads limits.toml (section [tbank]) through BrokerLimits::from_toml_section.
lots
Lots. T-Bank counts orders, order book levels, trades and candle volumes in LOTS, the library counts in units of the instrument (see [Qty]). This module is the bridge: the lot size of each instrument, learned from the directory once and remembered, and the conversions both ways.
map
T-Bank protocol messages -> brokapi-core domain types.
md
T-Bank market data connector
raw
Direct access to any T-Bank API method (“back door”): same token, same endpoint, same [BrokerLimiter] as the connector it came from.
stream
Stream supervision: open, read, reconnect with backoff. No protocol logic here.
ud
T-Bank user data connector, one account.
util
Small shared helpers: subscription ids, call wrappers, limiter access.

Structs§

MarketDataConfig
Market data connector config. Not tied to an account: one per broker (token) is enough.
MarketDataConnector
T-Bank market data connector: order books, trades, quotes, candles and the instrument directory.
MdCore
Sans-io core of the market data stream.
TbankCidCodec
The client order id codec of T-Bank: the cid is sent as a hyphenated UUID.
TbankRaw
Direct access to any T-Bank API method, made by MarketDataConnector::raw or UserDataConnector::raw. See the module docs. Cheap to clone.
UdCore
Sans-io core of the user data of ONE account: order state machine, own trades, portfolio.
UserDataConfig
User data connector config. One connector = one account: tbank.account_id. With None the connector uses the token’s only open account and refuses to start when there are several.
UserDataConnector
T-Bank user data connector: orders, own trades, portfolio and stop orders of ONE account.

Enums§

MdFrame
One inbound item for MdCore: what the runtime saw on the market data stream.
UdFrame
One inbound item for UdCore: a message from one of the user data streams.