Skip to content

Identity and compatibility

Governance can upgrade the futures program at the same address, and new markets are created every month. A robust integration therefore checks the values that identify the deployment, and reads everything else at run time instead of copying it into code.

For the current addresses, see Deployment.

Field Where to read it Value on Solana mainnet
Genesis hash /v1/config genesisHash, and your RPC’s getGenesisHash 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d
Futures program /v1/config programs.futures Bvp9kiRtJ7dT8unxP4Da39gv2eXDLEHLpcDfzcEuRKMu
Oracle program /v1/config programs.oracle 45YCerssGjg2M29RFc9D4fAJh7dfFpMJ3ZcZtaTnRXRS
USDC mint /v1/config usdcMint EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Governance controller /v1/config governanceController.program 8fhNi6QHU5TYNhoPDM4vs89ZBztnpxp3LnBXRgkBVKtx
Sponsor /v1/config sponsor The fee payer of every sponsored transaction; read it from the API.

Petri does this before every signature: it checks that the RPC serves the trusted chain and that the trusted programs are deployed there, from /v1/config or from a deployment manifest you pin with --deployment.

Read every market parameter from the market itself, never from a constant: GET /v1/markets/:market returns them, and the market account holds them.

  • grid, k, stepValue and valueDecimals: the price scale and what a lot pays.
  • period and the oracle program: the settlement source. Each market is bound to one oracle Period of its index and expiry.
  • vault and the USDC mint: where the market’s cash is held.

Refuse a market that the futures program you trust does not own, or one that settles in another USDC mint or reads another oracle program. Petri refuses such markets.

Value Changes when
The programs’ code Governance upgrades it. The addresses stay the same.
The governance gate epochs Governance acts.
The markets listed New expiries are created; settled markets stop trading.
Market state: book, positions, cash Every trade.

Every futures instruction carries the program’s canonical governance gate as a read-only account, together with the gate’s current epoch. If the gate is frozen or the epoch is stale, the instruction fails and nothing changes. The futures API binds the current epoch when it prepares a transaction, and Petri does the same for the transactions it builds. A transaction prepared before a governance action can fail afterwards: prepare it again. Never edit a transaction after it has been checked.

Deployment identity, current state and the wallet signature are separate checks. A match on one says nothing about the others. Before a wallet signs a prepared transaction:

  1. Deployment. The genesis hash and program IDs match the values you trust.
  2. Transaction. It does exactly what was asked, for this owner, in this market. See Prepared transactions.
  3. Lifetime. The prepared id is less than 90 seconds old, and the transaction has not passed its lastValidBlockHeight.

The program checks every amount, account and the gate again when the transaction runs. Your checks make sure the wallet is asked to approve what the user actually intended.