> ## Documentation Index
> Fetch the complete documentation index at: https://pond.dflow.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Trading Data Model

> How trading data is structured around `/order` requests

Use this page as a reference for the key objects returned by the [`/order
`](/resources/trading-api/order/order) endpoint and where each one appears in the request/response flow.

This page focuses on **imperative** trades.

<Info>
  We recommend using the `/order` endpoint for new integrations. The `/quote`, `/swap`, and
  `/swap-instructions` endpoints are still available but `/order` is the preferred approach.
</Info>

## High-Level Model

You request an **Order**, which returns a **Quote** and, if `userPublicKey` is
provided, a **Transaction** to sign and submit. The response may include a
**routePlan** (one or more legs) and an **executionMode** (sync or async).

```mermaid theme={null}
flowchart TD
  OrderRequest -->|returns| OrderResponse
  OrderResponse -->|may_include| Transaction
  OrderResponse -->|may_include| RoutePlanLeg
  Transaction -->|submit| SolanaRPC
  SolanaRPC -->|track| OrderStatus
```

## Example (Trade SOL → USDC)

**Input mint**: SOL\
**Output mint**: USDC

Flow:

1. Call [`GET /order`](/resources/trading-api/order/order) with `inputMint`,
   `outputMint`, and `amount`.
2. Inspect `priceImpactPct`, `routePlan`, and `executionMode`.
3. If `transaction` is returned, sign it and send it to Solana.
4. For async execution, poll [`GET /order-status`](/resources/trading-api/order/order-status).

## Entity Reference

### Order Request (Query Parameters)

Core parameters:

| Field | Type | Notes |
| - | - | - |
| `inputMint` | string | Base58 input mint |
| `outputMint` | string | Base58 output mint |
| `amount` | integer | Input amount (scaled integer) |
| `userPublicKey` | string | Wallet; includes `transaction` in response |
| `slippageBps` | integer \| `"auto"` | Max allowed slippage |
| `priceImpactTolerancePct` | integer | Max price impact % override |

Routing controls:

| Field | Type | Notes |
| - | - | - |
| `dexes` | string | Comma-separated include list |
| `excludeDexes` | string | Comma-separated exclude list |
| `onlyDirectRoutes` | boolean | Force single-leg routes |
| `maxRouteLength` | integer | Max legs (ignored if `onlyDirectRoutes`) |
| `onlyJitRoutes` | boolean | Force JIT routes |
| `forJitoBundle` | boolean | Routes compatible with Jito bundles |

Execution controls:

| Field | Type | Notes |
| - | - | - |
| `allowSyncExec` | boolean | Allow sync execution |
| `allowAsyncExec` | boolean | Allow async execution |
| `restrictRevertMint` | boolean | Input must be revert mint for async |

Fees and accounts:

| Field | Type | Notes |
| - | - | - |
| `platformFeeMode` | enum | Fee collected from input/output |
| `platformFeeBps` | integer | Platform fee in bps |
| `feeAccount` | string | Token account for platform fees |
| `positiveSlippageFeeAccount` | string | Account for positive slippage |
| `positiveSlippageLimitPct` | integer | Cap on positive slippage fee |
| `sponsor` | string | Sponsor wallet (gasless) |
| `destinationTokenAccount` | string | Output token account |
| `destinationWallet` | string | Output wallet (ATA if needed) |
| `revertWallet` | string | Revert wallet for async orders |

<Note>
  In `POST /swap`, if you set `destinationTokenAccount.address` and want native SOL output, pass the wallet address (owner) instead of the wallet's WSOL associated token account address.
</Note>

Transaction configuration:

| Field | Type | Notes |
| - | - | - |
| `wrapAndUnwrapSol` | boolean | Use native SOL if true |
| `prioritizationFeeLamports` | integer \| enum | Priority fee or level |
| `computeUnitPriceMicroLamports` | integer | CU price (mutually exclusive) |
| `dynamicComputeUnitLimit` | boolean | Simulate to determine CU limit |
| `includeJitoSandwichMitigationAccount` | boolean \| string | Jito mitigation |
| `maxAccounts` | integer | Max number of accounts the transaction can use. Mutually exclusive with `reserveAccounts`. |
| `maxTransactionSize` | integer | Max transaction size in bytes. Mutually exclusive with `reserveTransactionSize`. |
| `reserveAccounts` | integer | Number of accounts to leave unused. The server ensures the transaction uses at most `TRANSACTION_MAX_ACCOUNTS - reserveAccounts` accounts. Use this when you add instructions to the transaction — specify only the unique accounts your additions will introduce, not accounts already in the transaction. Mutually exclusive with `maxAccounts`. |
| `reserveTransactionSize` | integer | Bytes to leave unused. The server ensures the transaction size is at most `TRANSACTION_MAX_SIZE - reserveTransactionSize` bytes. Use this when you add instructions to the transaction — specify the number of bytes your modifications will add. Mutually exclusive with `maxTransactionSize`. |

### Order Response (OrderResponse)

| Field | Type | Notes |
| - | - | - |
| `inputMint` | string | Base58 input mint |
| `inAmount` | string | Max input amount (scaled integer) |
| `outputMint` | string | Base58 output mint |
| `outAmount` | string | Expected output amount (scaled integer) |
| `otherAmountThreshold` | string | Min output after fees |
| `minOutAmount` | string | Same as `otherAmountThreshold` |
| `slippageBps` | integer | Max slippage in bps |
| `priceImpactPct` | string | Estimated price impact |
| `contextSlot` | integer | Slot at evaluation time |
| `executionMode` | enum | `sync` or `async` |
| `routePlan` | array | Route legs (sync and known routes) |
| `platformFee` | object \| null | Platform fee if applied |
| `revertMint` | string | Revert mint for async orders |
| `transaction` | string | Base64 tx to sign/send |
| `lastValidBlockHeight` | integer | Last valid block height |
| `computeUnitLimit` | integer | Compute unit limit |
| `prioritizationFeeLamports` | integer | Priority fee in lamports |
| `prioritizationType` | object | Priority fee type |

### Route Leg (RoutePlanLeg)

Each leg is either a **DynamicRoutePlanLeg** or **SingleMarketRoutePlanLeg**.

Common fields:

| Field | Type | Notes |
| - | - | - |
| `venue` | string | Venue for the leg |
| `marketKey` | string | Market key for venue |
| `inputMint` | string | Input mint |
| `outputMint` | string | Output mint |
| `inAmount` | string | Max input amount |
| `outAmount` | string | Expected output amount |
| `inputMintDecimals` | integer | Input decimals |
| `outputMintDecimals` | integer | Output decimals |
| `data` | string | Present only on dynamic legs |
