Skip to content

trading_agent.gateway.gateway_parts

What the gateway's API routes can reach: the parts of each desk, and the parts every desk shares.

The desk builder fills these in as it builds the desks, and the application hands them to the route groups. Each route group takes only the parts it uses, so it can be tested with stand-ins for the rest.

Typical usage example:

parts = builder.desk_parts('main') parts.sessions.exchanges(session_id)

DeskParts dataclass

DeskParts(sessions, jobs, built_in_jobs, alerts, skills, checkpoints, tools)

One desk's stores and tools.

Attributes:

Name Type Description
sessions SessionStore

Its sessions, exchanges and daily summaries.

jobs CronJobStore

Its scheduled jobs and their runs.

built_in_jobs list[CronJob]

Its heartbeat, rollover and scheduled checks.

alerts PriceAlertStore

Its price alerts.

skills SkillLibrary

Its usable and hidden skills.

checkpoints Checkpoints

The snapshots of its own files.

tools ToolRegistry

Its tools, for actions such as flatten_desk.

SharedParts dataclass

SharedParts(layout, reader, snapshot_reader, risk_engine, ledger, kill_switch, order_book, proposals, subagents, packages, calendar, attachments)

The parts every desk shares.

Attributes:

Name Type Description
layout WorkspaceLayout

Where the workspace's files are.

reader BrokerReader

The UBI reader.

snapshot_reader AccountSnapshotReader

Reads balances and positions.

risk_engine RiskEngine

The one risk engine.

ledger RiskLedger

The risk ledger: ownership, halts, daily profit and loss.

kill_switch KillSwitch

Halts and flattens the whole account.

order_book DeskOrderBook

Which desk placed which order.

proposals ProposalStore

The desks' proposed changes to the user's files.

subagents SubagentLibrary

The subagent definitions.

packages InstalledPackages

The installed packages.

calendar MarketCalendar

The exchange calendar.

attachments AttachmentStore

The files the user sends with messages.