fastboxex.platform¶
Unified entry point for the SDK. Obtain via Platform.login().
Platform¶
from fastboxex import Platform, load_config
import os
cfg = load_config()
p = Platform.login(cfg, "alice", os.environ["FASTBOXEX_PASSWORD"])
Platform.login()¶
@classmethod
def login(cls, cfg, username, password, *, runtime=None, runtime_id=None) -> "Platform"
Probes every profile in cfg, then logs in to the first reachable one.
| Parameter | Type | Description |
|---|---|---|
cfg |
ClientConfig |
From load_config() |
username |
str |
Login |
password |
str |
Password |
runtime |
int \| str \| None |
Runtime id, or "exchange" / "arena" |
runtime_id |
int \| None |
Older integer-only form of runtime |
An explicit selection always wins. Without one, FASTBOXEX_RUNTIME_ID applies, else
the only discovered runtime, else the only exchange, else login fails listing the
choices.
Platform.auto_login()¶
Logs in from saved settings, and asks at the terminal for whatever is missing. See Authentication.
Registration¶
Platform.register()¶
Request a new account. The exchange sends a confirmation code to email if
registration is enabled and the email is whitelisted.
password must be at most 16 bytes.
Platform.confirm_registration()¶
Confirm a pending registration with the emailed code. On success, the account is
created and can be used with Platform.login().
Password reset¶
Platform.forgot_password()¶
Request a password reset token sent to email. Always returns a generic success
message to prevent email enumeration. The reset code is a 5-digit numeric token
that expires after 30 minutes.
Rate limited: wait 60 seconds between requests for the same email.
Platform.reset_password()¶
@staticmethod
def reset_password(
cfg: ClientConfig,
email: str,
token: str,
new_password: str,
) -> str
Reset password using the token sent by forgot_password(). new_password must be
at most 16 bytes.
Properties¶
| Property | Type | Description |
|---|---|---|
p.username |
str |
The login of this session |
p.user_id |
int |
Exchange-assigned numeric user ID |
p.token |
int |
128-bit session token |
Asset resolution¶
p.assets → list[dict]¶
All assets listed on the exchange.
p.asset_ids → list[int]¶
All asset IDs.
p.asset_by_symbol(symbol) → dict¶
Resolve ticker symbol to asset info dict (contains asset_id, symbol, price params).
Trading connection¶
p.connection(...) → Connection¶
Open a trading connection to the live exchange.
Market data¶
p.market(...) → Market¶
Live market data for the books of this runtime, over the market relay.
p.arena_market(...) → Market¶
Market data for your arenas, over the same relay.
Use
arena_marketin07a.py/07b.py— notconn.lob().
Observer¶
p.observer() → Observer¶
Read-only monitoring connection that sees fills, acks, and portfolio events from all connections for your user.
Arena management¶
p.create_arena(symbol, ...) → Arena¶
Create a new arena. See Arena guide for parameters.
p.join_arena(invite_code, *, num_traders=1, label=None) → Arena¶
Join an existing arena. label is the name the owner sees. Joining again after a
crash returns to the same seat.
Arena owners use
reconnect_arena()instead.
p.arena_quota() → (max_arenas, max_traders, current_arenas)¶
What this account may do on the Arena runtime.
p.reconnect_arena(arena_id) → Arena¶
Re-access an arena you own, without joining. Returns an Arena with all
pre-allocated slots available.
p.close_arena(arena_id) → None¶
Destroy an arena you own. Cancels all orders and discards balances.
p.list_server_arenas() → list[dict]¶
List all arenas visible on the exchange server.
load_config()¶
from fastboxex import load_config
cfg = load_config()
cfg = load_config(profile="campus") # select a profile by name substring
See the config reference.