PhoenixPerpetualsDocs API v1
Get an API key

Going live

Going live⁠.

From the sandbox to a live account: the checklist, what changes on live, what bots may and may not do, and how to keep a key safe.

View as Markdown

On this page
  1. The checklist
  2. What is different on live
  3. What bots may do
  4. Keeping it safe

Your code does not change between the sandbox and live: the same calls, the same answers, the same SDK. What changes is that real money is at stake, so a few habits matter.

The checklist#

  1. Run it on the sandbox first, long enough to see it through a restart, a lost connection, a refused order and a breached limit. The sandbox has the same rules as an evaluation, so a breach there shows you what one looks like.
  2. Read the account's rule from GET .../trading-policy rather than assume it: limits differ from one account to the next (see Accounts and risk).
  3. Create a live key with only what the bot needs in the dashboard, under Developers, Keys: the markets it trades, its largest order and position, and a daily loss stop of its own, below the account's (see Keys and limits). A dashboard or a report gets a read-only key.
  4. Lock it to your server's address with an IP allowlist. A live key that never expires must have one.
  5. Swap the key, not the code. The SDKs pick the live host from a ppk_live_ key by themselves; without an SDK, change the host to api.phoenixperpsfunding.com.
  6. Protect every position: attach exits to entries, so a stop rests on the trading servers even if your bot stops.
  7. Know when something happens: follow the account stream, or point a webhook at fills and risk warnings.

What is different on live#

  • Creating a live key, webhook endpoint or TradingView link takes a code we email you.
  • Live keys expire (90 days unless you choose another length, at most 365), and we email you 7 days before.
  • An AI assistant never takes a live key: it signs in, and a trade can ask for your confirmation first (see AI assistants).
  • Your orders reach the trading servers with no delay added: an API order is as fast as one from the trading platform.

What bots may do#

Your own bots and scripts, and your own TradingView alerts, are welcome on every account. Not allowed:

  • sharing an API key with anyone else;
  • letting a third-party copier or signal service control the account;
  • exploiting latency, stale prices or defects;
  • flooding the API.

Keeping it safe#

Keeping keys safe covers the keys themselves. Beyond them:

  • Give each bot its own key and limits: one bot's mistake then stops at its own key's daily loss stop.
  • Check every webhook's signature before you act on it (see Webhooks).
  • Treat a TradingView link's address like a password: anyone who has it can trade within the link's limits.
  • Revoke at the first doubt. A revoked key's next call is refused and its streams close within seconds.

Guides, endpoints, fields and error codes.