# Initialize a Solana perps account and recover an order

Select a Solana perpetual market and subaccount, sign the native order intent, and handle a required initialization, an empty cancellation or a missing receipt.

Guide: https://www.bitpont.com/help/ai-agents/solana-perps-account-and-order-recovery/

MCP resource: `bitpont://guides/solana-perps-account-and-order-recovery`

## 1. Select the market and subaccount

Read perpMarkets for the Solana venue and retain the market index. With the owner’s address, inspect viewSolanaMarginAccount for the specific subaccount and its open orders. For collateral actions, confirm the mint and spot market index separately. A cancellation across the whole subaccount can affect multiple markets.

## 2. Sign the native intent before reviewing a transaction

Call solPerpIntent with the wallet, action and subaccount. Sign its exact UTF-8 message locally. Keep bodyJson verbatim with the returned path, timestamp and body. Send these and the base58 signature as input to executionPrepare with action solPerpTransaction and a persistent request UUID. Review any signable transaction before applying the separate wallet signature.

## 3. Use the returned preparation state

For initialization-required, prepare and review a separate initialize action for that subaccount. After confirmation, request a fresh intent for the original trade. For no-action, there is no transaction to sign or submit. If a response is lost, look up the original request UUID in the same workspace; keep the execution ID for status and reconcile any broadcast signature against the subaccount’s orders or position.

## 4. Send the authorized transaction

Use the supported action with executionPrepare in the same workspace. Review the returned signing payload. On the wallet host use bitpont_walletExecute, or sign locally and send executionSubmit. Save the executionId to follow settlement and recover after a timeout.

## Read Solana perpetual markets before choosing an index

```
curl -fsS "https://www.bitpont.com/api/v1/agent/perps/markets" \
  -H 'Content-Type: application/json' \
  -d '{"venue":"solana"}'
```

### MCP tool call

```json
{
  "method": "tools/call",
  "params": {
    "name": "bitpont_perpMarkets",
    "arguments": {
      "venue": "solana"
    }
  }
}
```

## Tools

- `perpMarkets`
- `viewSolanaMarginAccount`
- `solPerpIntent`
- `solPerpTransaction`
- `executionLookup`
- `executionStatus`

## Further reading

- [Perpetual trading and collateral](<https://www.bitpont.com/help/perps/>)
- [Wallet-authorized execution](<https://www.bitpont.com/developers/agent-execution/>)
- [Execute a DeFi trade from an agent wallet](<https://www.bitpont.com/help/ai-agents/execute-with-agent-wallet/>)
- [Trade perpetuals and inspect funding-rate markets](<https://www.bitpont.com/help/ai-agents/perpetuals-and-funding-rates/>)
- [Sign wallet actions and recover an agent order](<https://www.bitpont.com/help/ai-agents/wallet-signing-and-order-recovery/>)
- [Approve and revoke a customer trading session](<https://www.bitpont.com/help/ai-agents/customer-trading-sessions/>)
