Skip to content

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()

@classmethod
def auto_login(cls, cfg=None, *, runtime=None, runtime_id=None) -> "Platform"

Logs in from saved settings, and asks at the terminal for whatever is missing. See Authentication.


Registration

Platform.register()

@staticmethod
def register(
    cfg: ClientConfig,
    username: str,
    password: str,
    email: str,
) -> str

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()

@staticmethod
def confirm_registration(
    cfg: ClientConfig,
    email: str,
    code: str,
) -> str

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()

@staticmethod
def forgot_password(
    cfg: ClientConfig,
    email: str,
) -> str

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).

info = p.asset_by_symbol("JTW")
asset_id = info["asset_id"]

Trading connection

p.connection(...) → Connection

Open a trading connection to the live exchange.

conn = p.connection()
conn.activate(asset_id=1)

Market data

p.market(...) → Market

Live market data for the books of this runtime, over the market relay.

market = p.market()
md     = market.get_latest(asset_id=1)

p.arena_market(...) → Market

Market data for your arenas, over the same relay.

arena_market = p.arena_market()
md           = arena_market.get_latest(arena.asset_id)

Use arena_market in 07a.py / 07b.py — not conn.lob().


Observer

p.observer() → Observer

Read-only monitoring connection that sees fills, acks, and portfolio events from all connections for your user.

obs = p.observer()
for fill in obs.drain_fills():
    print(fill)

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 = p.join_arena("QJNNFP", label=p.username)
conn  = arena.connect_trader(0)

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.

arena = p.reconnect_arena(arena_id)
conn  = arena.connect_trader(0)   # same-user AI agent slot 0

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.