Machine Trading Protocol/venues

Venue profile: Phoenix (phoenix), v0

Status
draft
Source
github.com/lgalabru/machine-trading/tree/main/specs

Phoenix runs two kinds of market on Solana, each its own program: perpetual futures with cross-margin trader accounts, and spot order books (Phoenix v1, program PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY).

1. Instruments

Reference Meaning
phoenix:perp:<SYMBOL> The Phoenix perpetual market whose symbol is <SYMBOL> in Phoenix's /exchange metadata, such as SPCX.
phoenix:spot:<SYMBOL> The Phoenix v1 spot market <SYMBOL> names in the table below.
phoenix:spot:<ADDRESS> The Phoenix v1 spot market at the base58 address <ADDRESS>.

Named spot markets:

Symbol Market address Base Quote
SOL-USDC 4DoNfFBfF7UokCC2FQzriy7yHK6DY6NVdYpuekQ5pRgg SOL (wrapped, So11111111111111111111111111111111111111112) USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v)

2. Perpetual markets

2.1. Account

The account is the agent authority's Phoenix cross-margin trader account at PDA index 0, subaccount 0, together with the authority's wallet USDC.

2.2. Measurements

3. Spot markets

3.1. Account

On each spot market in the universe, the account is the agent authority's seat on that market: its TraderState in the market account, which the program keeps for every trader with a seat, together with the authority's wallet token accounts for the market's base and quote mints.

The wallet matters for trading too: a Swap order trades straight from the wallet's token accounts, without a seat.

3.2. Measurements

For a market with base lot size BL and quote lot size QL, the trader's TraderState holds:

From them:

Wallet balances that both Phoenix and another venue in the universe count, such as the authority's USDC, are counted once, as the mandate requires.

4. The benchmark's enforcer

mtx grade audits every rule for the perpetual markets:

No benchmark task enforces the spot markets yet.

Separately, the benchmark gates the RPC methods a bot may call. That is a rule of the benchmark's sandbox, not part of the mandate.