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.
- 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.
How it runs · sample data
1Signals and callers
TradingView alerts
Signed webhooksYour Python strategies
Order source · run on your serversYour apps and bots
REST Trading APIYour team
Dashboard · SSO · 2FAHTTPS
API
tokens
2Control plane · your machine
Manages servers, users and tokens. Never places trades itself.
mTLS
No inbound
port
3Your trading servers
Risk engine
On each server, checks every orderfra-1
MT5 · Broker A · livePython strategy · ema-cross · livelon-2
MT5 · Broker B · livePython strategy · breakout · dry runfra-2 standbyQUALIFYING
Takes over if a server failsDIRECT
To your
broker
4Brokers
MetaTrader 5
Broker AMetaTrader 5
Broker BcTrader
Coming soonBroker passwords never leave your servers.
5 · Live metrics
6 · Health checks
7 · Alerts
LOW_DISKlon-2 disk 88 % → Ops on-call✓ deliveredRISKXAUUSD 5.00 refused · lots above 2.0✓ deliveredWorkflow
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.
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.
Agent connected · mutual TLS
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.
Installed · latest
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.
202 · queued → filled
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.
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.
anna@example.comFull (can trade)
Route: ema-crossnile_tat_…Active
ops@example.comRead only
Any routenile_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)
Broker-Demo · risk modefra-1MetaTrader 5
Installed · latestHealthy
Broker-Demo · risk modefra-1MetaTrader 5
Installed · latestHealthy
Broker-Demolon-2MetaTrader 5
Older version on the serverHealthy
HealthyTerminal
HealthyBridge
HealthyBroker
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.

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.
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.
Telegram · ops groupEnabled
Slack · incoming webhookEnabled
Email · ops@example.comEnabled
Webhook · signedEnabled
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.
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.
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.
See the whole platform working together.
Request a demo sandbox with sample data, or open the live demo dashboard. Sandboxes are approved by hand.