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

# Create RFQ

> Open a request for quote and solicit market maker pricing

Opens a request for quote (RFQ). The requester specifies a token pair, a side, and a base amount, and registered market makers respond with executable quotes. RFQs are short-lived: they expire after `expiryMs` (default applies if omitted), after which no further quotes or acceptances are accepted.

Use [List Quotes](/endpoints/stock-trading/list-rfq-quotes) to retrieve the quotes received, then [Accept Quote](/endpoints/stock-trading/accept-rfq-quote) to execute against one.

## Authentication

Requires an instance API key with the `trading` service enabled.

## Idempotency

This endpoint accepts an optional `Idempotency-Key` header. Reusing a key with the same body returns the original RFQ; reusing it with a different body returns `IDEMPOTENCY_MISMATCH`.

## Request Body

<ParamField body="requesterAddress" type="string" required>
  EVM address of the requesting party. Must match `0x[a-fA-F0-9]{40}`.
</ParamField>

<ParamField body="baseToken" type="string" required>
  EVM address of the base token (the asset being bought or sold). Must match `0x[a-fA-F0-9]{40}`.
</ParamField>

<ParamField body="quoteToken" type="string" required>
  EVM address of the quote token (the currency used for pricing). Must match `0x[a-fA-F0-9]{40}`.
</ParamField>

<ParamField body="custodyContract" type="string" required>
  EVM address of the custody contract that will escrow and settle the trade. Must match `0x[a-fA-F0-9]{40}`.
</ParamField>

<ParamField body="side" type="string" required>
  The requester's side. One of `BUY` or `SELL`.
</ParamField>

<ParamField body="baseAmount" type="string" required>
  Amount of the base token to trade, in base units (wei). Numeric string.
</ParamField>

<ParamField body="expiryMs" type="integer">
  Lifetime of the RFQ in milliseconds. 5000-60000. If omitted, the instance default applies.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "requesterAddress": "0x1111111111111111111111111111111111111111",
    "baseToken": "0x1234567890abcdef1234567890abcdef12345678",
    "quoteToken": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
    "custodyContract": "0x9876543210fedcba9876543210fedcba98765432",
    "side": "BUY",
    "baseAmount": "5000000000000000000",
    "expiryMs": 15000
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "rfq_abc123",
      "requesterAddress": "0x1111111111111111111111111111111111111111",
      "baseToken": "0x1234567890abcdef1234567890abcdef12345678",
      "quoteToken": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
      "custodyContract": "0x9876543210fedcba9876543210fedcba98765432",
      "side": "BUY",
      "baseAmount": "5000000000000000000",
      "status": "OPEN",
      "expiresAt": "2025-01-15T10:30:15.000Z",
      "createdAt": "2025-01-15T10:30:00.000Z"
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-01-15T10:30:00.000Z",
      "instanceId": "inst_abc"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                           | Status | Description                                                  |
| ------------------------------ | ------ | ------------------------------------------------------------ |
| `INSUFFICIENT_CUSTODY_BALANCE` | 400    | The requester lacks sufficient custody balance for the trade |
| `MM_REQUIRED`                  | 403    | No eligible market maker is available for this pair          |
| `MM_CONFIG_VIOLATION`          | 400    | The request violates market maker configuration constraints  |
| `IDEMPOTENCY_MISMATCH`         | 409    | Idempotency key reused with a different request body         |
| `VALIDATION_ERROR`             | 400    | Request body failed schema validation                        |
