Accounts and catalogue
What a terminal sees of its account, and what you can point a terminal at.
Accounts
Balance, positions, orders, history and spreads for one tenant's terminals.
Balance, equity and margin, plus the slow profile facts. Each half with its own ts; a half never observed is null, not zero.
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminal_id | Id | required | The terminal to act on. Another customer's id answers 404, never 403. |
Returns Account
Every open position, as one snapshot with its as_of.
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminal_id | Id | required | The terminal to act on. Another customer's id answers 404, never 403. |
Returns PositionList
Every pending order, as one snapshot with its as_of.
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminal_id | Id | required | The terminal to act on. Another customer's id answers 404, never 403. |
Returns PendingOrderList
Closed deals, newest first, inside a window.
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminal_id | Id | required | The terminal to act on. Another customer's id answers 404, never 403. |
| from_ keyword | dt.datetime | required | |
| to keyword | dt.datetime | required | |
| cursor keyword | str | None | None | Where to continue from; the previous page's next cursor. |
| limit keyword | int | None | None | How many to return at most. |
Returns Page[Deal]
The window is required, by the API and so by this: an unbounded history request over a partitioned table is the query that takes a database down. Paged, because history does not change under you the way a live list does.
The spread this terminal's own account is quoted, with each reading's age.
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminal_id | Id | required | The terminal to act on. Another customer's id answers 404, never 403. |
Returns SpreadList
A pool cannot answer this: the spread a user trades against is the one their broker gives their account, so it is read from their terminal.
Catalog
The brokers, servers and symbols this tenant may use.
One page of the brokers MFX supports, with each one's status.
| Parameter | Type | Default | Description |
|---|---|---|---|
| cursor keyword | str | None | None | Where to continue from; the previous page's next cursor. |
| limit keyword | int | None | None | How many to return at most. |
Returns Page[TenantBroker]
status is the broker's: active is usable, suspended and retired are not. A terminal requested on a broker that is not usable is refused at request time, and the SDK turns that refusal into UnsupportedBrokerError.
Every broker, following the cursor.
Returns AsyncIterator[TenantBroker]
The the terminal servers this broker runs, and whether MFX can use each one now.
| Parameter | Type | Default | Description |
|---|---|---|---|
| broker_id | Id | required | The broker's id from the catalogue. |
| cursor keyword | str | None | None | Where to continue from; the previous page's next cursor. |
| limit keyword | int | None | None | How many to return at most. |
Returns Page[TenantBrokerServer]
server_name is what a credential names. enabled is the per-server switch and disabled_reason is the sentence the operator recorded for it — the same words the refusal carries, so a caller can show a user why before it asks for a terminal rather than after. A terminal requested on a disabled server is refused 409 and reaches the caller as UnsupportedBrokerError with refused_by == "server_disabled", which means try another server of this broker.
The symbols this broker lists, in its own names.
| Parameter | Type | Default | Description |
|---|---|---|---|
| broker_id | Id | required | The broker's id from the catalogue. |
| server_id keyword | Id | None | None | The server's id from the catalogue. |
| account_type keyword | str | None | None |
|
| cursor keyword | str | None | None | Where to continue from; the previous page's next cursor. |
| limit keyword | int | None | None | How many to return at most. |
Returns Page[Symbol]
server_id and account_type narrow the list to one server or one account type, for a tenant with more than one on this broker.
These are the names to pass to terminals.create and to execution.place_order: MFX never renames an instrument on a tenant's behalf, so BTCUSD.lv is what a broker that calls it that will answer to.
One symbol's specification, including pip_value_per_lot.
| Parameter | Type | Default | Description |
|---|---|---|---|
| broker_id | Id | required | The broker's id from the catalogue. |
| symbol | str | required | The broker's own symbol name, exactly as the catalogue returns it. MFX Hub never renames an instrument. |
| server_id keyword | Id | None | None | The server's id from the catalogue. |
| account_type keyword | str | None | None | A symbol listed on more than one of the tenant's servers or account types is answered 409 |
Returns Symbol
A symbol listed on more than one of the tenant's servers or account types is answered 409 ambiguous_symbol; name server_id and account_type to say which.
The current quote for one symbol, with its age.
| Parameter | Type | Default | Description |
|---|---|---|---|
| broker_id | Id | required | The broker's id from the catalogue. |
| symbol | str | required | The broker's own symbol name, exactly as the catalogue returns it. MFX Hub never renames an instrument. |
| server_id keyword | Id | None | None | The server's id from the catalogue. |
| account_type keyword | str | None | None | A symbol listed on more than one of the tenant's servers or account types is answered 409 |
Returns SymbolQuote
A quote is never returned without saying how old it is: a stale quote reads exactly like a live one and gets acted on.
A symbol listed on more than one of the tenant's servers or account types is answered 409 ambiguous_symbol; name server_id and account_type to say which.
UsageReader
One call, because there is one question: what has been used and what is left.
Consumption per metric, this key's ceilings, and the remaining budget with its source.
Returns Usage