Self-hosted trading infrastructure platform

Scale your trading infrastructure as you grow. Secure and managed from day one.

PerkBridge is one integrated platform, installed on your own servers, to run, connect and control your trading: servers, trading accounts, one API, Python strategies, risk rules and alerts, all in one dashboard.

Supported connectorsMetaTrader 5 · availablecTrader · coming soon
  • Runs on your own servers. Broker passwords never leave them.
  • One API and one dashboard for every account and connector.
  • Risk rules check every order before it reaches the broker.
  • Your servers keep running when the dashboard is offline, and each deployment can switch to a standby server.

Workflow

From a bare server to a protected, automated account.

Four steps, all from the same dashboard. Each step builds on the one before it, and nothing needs a remote desktop.

1

Connect your servers

Add an Ubuntu server by address. PerkBridge checks it, installs Docker and the Fleet Agent over SSH and enrols the agent. Your SSH key is used for one setup run and never stored.

fra-1 · 203.0.113.24
Agent connected · mutual TLS
2

Deploy connectors

Pick a trading platform from the signed catalog and create a deployment: one terminal in its own container, with its own resource limits. The broker password is delivered encrypted end to end.

eurusd-desk · Broker-Demo
Installed · latest
3

Trade through one API

Create an API token for the account and send orders over REST, or over DirectConnect for the lowest latency. A retried request with the same client_order_id never becomes a second order.

POST …/orders
202 · queued → filled
4

Add strategies, risk and monitoring

Upload Python strategies, set risk rules per account, protect open positions, send alerts to your channels and choose a standby server. All of it acts on the same accounts and orders.

ema-cross_v3 · running
Risk policy applied

Trading API and API management

One API for every account, with tokens you control.

A broker-style REST API for market, limit, stop and stop limit orders with stop loss and take profit, time in force, modify, cancel and partial close, plus positions, quotes with tick values, bars and history, and the reason each trade closed.

  • API tokens per account. Each token works on one trading account, with Read only or Full access, an optional route for one program, and an expiry of 1 to 365 days. Rotate or revoke it at any time.
  • Idempotent orders. Every order carries a client_order_id. A retry with the same ID returns the stored order with Idempotent-Replayed: true. An order is never sent twice.
  • WebSockets only with DirectConnect. DirectConnect is a licensed, opt-in low-latency order path: your program keeps one TLS WebSocket open and gets an ack and a result for each order. Everything else uses REST, and account events such as order.filled are followed through a cursor-based event feed.

One token model. The dashboard, your own programs and platform-run strategies all use the same per-account tokens, and a token can never have more access than the person who created it.

API tokensTrading account: eurusd-desk
NameAccessStarts withState
ema-cross on fra-1
anna@example.com
Full (can trade)
Route: ema-cross
nile_tat_…Active
reporting
ops@example.com
Read only
Any route
nile_tat_…Expires soon
POST /api/v1/trading/accounts/{account_id}/orders
Authorization: Bearer $PB_TOKEN

{ "client_order_id": "ema-0412-1",
  "symbol": "EURUSD", "side": "buy",
  "type": "market", "volume": "0.10",
  "stop_loss": "1.0780" }

202 accepted and queued
200 Idempotent-Replayed: true  (same ID sent again)
Deploymentsstage=proddesk=fx
DeploymentServerConnectorHealth
eurusd-desk
Broker-Demo · risk mode
fra-1MetaTrader 5
Installed · latest
Healthy
metals-a
Broker-Demo · risk mode
fra-1MetaTrader 5
Installed · latest
Healthy
index-swing
Broker-Demo
lon-2MetaTrader 5
Older version on the server
Healthy
Container
Healthy
Terminal
Healthy
Bridge
Healthy
Broker
Healthy

Deployments and fleet

Servers, agents and deployments in one inventory.

PerkBridge is an infrastructure manager first. It prepares your servers over SSH, keeps a Fleet Agent on each, and runs every account as its own isolated container.

  • Signed catalog and versions. Platforms come from a signed catalog that the control plane and the agent both verify. A new deployment uses the latest version; one that already runs is never changed.
  • Layered health. Agent, telemetry and host per server; container, terminal, bridge and broker per deployment. Old data is never shown as current.
  • Tags. Up to five key=value tags on each resource, such as stage=prod or desk=fx. Filter any list, or limit the whole dashboard to one tag with the scope control.
  • Health checks with a fix. nile-install doctor and the Health card check the installation and fix what can be fixed from the dashboard. Platform metrics and host logs are one click away.

One set of tags. The same tags work on servers, deployments, accounts, routes, strategies, API tokens and notification rules, and alerts carry them too.

Python strategies

Upload a zip. It runs on your server, next to your accounts.

A strategy is your Python code with a main.py and a requirements.txt. PerkBridge installs it into its own environment, starts it in an isolated container and restarts it after a crash, with a back-off.

  • Four event sources. A schedule, a trading event such as a fill, a webhook, or Run now. Schedules and trading events fire inside the container, so they keep firing while the control plane is unreachable.
  • Versions and typed parameters. A new version installs beside the running one. Change parameters from the dashboard without a new upload; every change is saved as a revision.
  • Sealed secrets. Secrets never go in the zip. The control plane encrypts them at rest and sends them, sealed to that server's agent, only when the strategy starts.
  • Live or dry. Start a new strategy dry: it runs as usual but cannot open a position. Switch it to live when you trust it.

Same rules for every order. A strategy gets one API token per account and never holds a broker password. Every order it places passes the account's risk rules and the emergency stop, like any other order.

How it works: you write a Python strategy (main.py, requirements.txt, strategy.yaml); PerkBridge checks it, keeps versions, parameters, encrypted secrets and one token per account; it runs in a container on your server next to the trading terminal, whose risk rules check every order; the broker executes. A schedule, a webhook, a trading event or Run now starts your code.
first_script.pypip install --pre perkbridge-connect
from perkbridge import Config, Connect

with Connect(Config.load()) as pb:
    acct = pb.account()
    print(acct.balance, acct.currency)

    q = pb.quote("EURUSD")
    print("bid", q.bid, "ask", q.ask)

    # market buy, then a stop loss
    order = pb.buy("EURUSD", then_stops=("1.0800", None))
    print(order.status)   # filled, or unknown

    pos = pb.position("EURUSD")
    if pos is not None:
        pb.close(pos)

Python library · perkbridge-connect

The careful parts of a trading program, already written.

perkbridge-connect talks to the same Trading API as your own HTTP code would. Use it as a client in scripts and notebooks, or as a strategy runner with on_run and on_event.

  • Every order is idempotent. The order key is written to a local journal before the request leaves the process, so a crash and restart cannot buy twice.
  • No invented outcomes. A lost answer is reported as unknown while the platform checks with the broker. It is never sent again under a new key.
  • Same file, two places. Run a strategy on your computer with an API token, replay it over the past in the Time Machine, then upload it to run on your server.
Python 3.10 to 3.13Apache-2.0Beta · 1.5.0b2DirectConnect client included

Risk management and protection

Risk rules checked before every order, on your server.

In risk mode, each account's risk policy is enforced by nile-risk, a separate process next to the terminal. Every order passes through it before it reaches the broker, and it keeps enforcing the last policy when the control plane is unreachable.

  • Risk rules. Loss and profit limits, trade and order counts, open positions, volume, price age and spread, per account, route, strategy or symbol. A tripped rule blocks new exposure; closing is still allowed.
  • Hours and news. Trading hours, market close and news windows can block new orders, close open positions ahead of time and cancel pending orders.
  • Position protections. Trailing stop, break-even, stop ladder, take-profit levels and a time exit, evaluated on the trading server. They keep working when the dashboard or your program is offline.
  • Stop checks in pips. Each symbol has its own pip size, so stops in pips convert correctly on EURUSD and on BTCUSD alike. A stop inside the spread or on the wrong side of the price is refused before it reaches the broker.
  • Emergency stop. Stop new positions on one account or on every account at once, with a recorded reason, and close all positions too if you choose. You can always close: a close goes through during a halt and after a rule trips.

One risk engine for every path. Orders from the dashboard, the REST API, DirectConnect and your strategies are checked by the same rules on the same server.

eurusd-desk · RiskPolicy applied on fra-1
Daily loss · accountLimit reached · new exposure blocked
Open positions · route ema-crossWithin the limit
News · close positions before high-impact newsOn
Refused: BUY GBPUSD
risk_rule_tripped · Daily loss
EURUSD · buy · ProtectionActive on the host
Trailing stopBreak-evenTake-profit levels
Notifications · Channels
Ops on-call
Telegram · ops group
Enabled
#trading-alerts
Slack · incoming webhook
Enabled
Desk leads
Email · ops@example.com
Enabled
Pager
Webhook · signed
Enabled
Rule
Production outages
Critical only · server, deployment · to Ops on-call, Pager
Delivery log
SERVER_OFFLINE · lon-2 → Ops on-callDELIVERED
Test · PagerDELIVERED

Notifications

Alerts reach the people who need to act.

Every alert is shown in the dashboard and the API. Notifications send a copy of the alerts you choose to channels outside PerkBridge.

  • Channels. Telegram, Slack, email through your own SMTP server, and signed HTTPS webhooks, which also reach paging services.
  • Rules. A rule sends matching alerts to one or more channels, by minimum severity and by category: server, deployment, credentials, notifications or license.
  • Delivery log. Each delivery is stored and each attempt is written to the audit trail. Send test proves a channel works before you rely on it.

Notifications never touch trading. A separate process, nile-notifier, makes every call to a provider. If it stops, your servers keep trading and deliveries wait for up to 6 hours.

Failover and standby

Built to keep running, and never to send an order twice.

Choose a standby server for a deployment. When the server, container or terminal fails, PerkBridge moves the deployment to the standby, checks the account against the broker and then lets trading continue.

fra-1 · was active
Unreachable for the hold time
Taken out of service for this deployment. Nothing more is sent to it.
1 · SWITCHING
Account halted for new positions.
2 · RECONCILING
Positions, pending orders and deals read from the standby's own session.
3 · READY TO RESUME
Only when no order of the old server is open and unexplained.
4 · ACTIVE
Resume trading by hand, or automatically when every check passed.
fra-2 · standby
Hot · armed · broker login ready
Becomes active with its trading switch still off until the checks pass.

Standby per deployment

Hot (logged in and ready) or warm (prepared, logs in at the switch). Switch by hand with one button or automatically, and choose what happens on a server, container, terminal or broker failure.

Dashboard offline? Servers keep running

A lost connection never stops a terminal or closes a position. Broker logins stay up, risk rules and position protections keep holding, and strategy schedules keep firing. New API orders wait until the control plane is back.

Start again after a reboot

With remembered credentials, a deployment can start a new session when its server comes back. The session starts halted, is checked against the broker and then resumes. Nothing restarts unless you chose it.

Backup and restore

Scheduled, encrypted backups of the control plane go off site on their own, with an alert if one fails or is late, and the database can be recovered to a point in time. A restore never resends an unfinished operation, and your servers keep trading throughout.

Being qualified. Failover is built and tested with automated tests and is still being qualified on real servers and broker demo servers. A standby control plane is new and not yet qualified either.

Security and self-hosting

Your servers, your credentials, your audit log.

The management software and the trading servers are yours. The broker connection is the only link that leaves your premises.

Credentials stay with you

Broker passwords are delivered encrypted end to end to the server, or remembered there by nile-vault with a split key that neither side can open alone.

Outbound-only agents

Each Fleet Agent opens one outbound, mutually authenticated TLS connection and accepts only commands the control plane has signed. Unregistered addresses are refused before the TLS handshake.

Single sign-on and grants

Sign users in with passwords, a second factor or single sign-on. Access is denied unless a grant allows it, per organization, server, deployment or trading account, with bundles such as OPERATOR, VIEWER and AUDITOR.

One audit log

Every sign-in, change and refused action is written to the audit log, across deployments, tokens, risk changes, failover settings and notification attempts.

Events · Audit trailAll times UTC
09:41:12anna@example.com created API token "ema-cross on fra-1"
09:38:50ops@example.com changed failover settings on eurusd-desk
09:30:07viewer@example.com authorization.denied · stop deployment
09:12:44ops@example.com signed in · single sign-on
Values that look like secrets are redacted. Security overview →

Connectors

Trading platforms plug in at the edge.

A connector turns a trading platform into the PerkBridge API, dashboard and risk engine. Your code talks to one interface, whatever is behind it. Add a platform and keep everything else.

Available
MetaTrader 5MT5 from the MetaQuotes installer or your broker's own, run headless in an isolated container on your server. Find your broker by server name. Live and demo accounts.Set up guide →
Coming soon
cTradercTrader accounts next to your MetaTrader fleet. Already listed as coming soon in the platform catalog; no date yet.All connectors →
Direction only
More platformsFutures platforms, crypto exchanges and a connector SDK are directions we are exploring, with no plan or date yet. Requests decide what we build next.Ask for a connector →

See the whole platform working together.

Request a demo sandbox with sample data, or open the live demo dashboard. Sandboxes are approved by hand.