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

# Create a task

> Queues a new paired position. Both venues must be different, granted by the key and bound by its owner.

The example requests **\$100 per leg**: long ETH on Hyperliquid and short ETH on Robinhood Lighter. Both venues need stored, approved bindings. Missing bindings return `409 venue_not_bound` with an `issues` array.

Published minimum notional and base quantity are checked before acceptance. The worker checks sizing, venue readiness, and approvals again before trading, so an accepted task can still fail.

Do not send order prices, leverage, margin mode, or unknown fields. Configure account settings on the venue first. `autoClose: false` disables the funding-APY opening and auto-close rule.

<Warning>This request can place real orders. Confirm the venues, symbols, and per-leg size before running it.</Warning>

## Send a command

Generate and persist the idempotency key **once**, then run the request. For an uncertain retry, rerun only `curl` with the same key and body.

```bash theme={null}
export IDEMPOTENCY_KEY="$(uuidgen)"
```

```bash theme={null}
curl -i "$MOBIUS_API_BASE_URL/v1/delta-neutral/tasks" \
  -H "Authorization: Bearer $MOBIUS_API_KEY" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"longVenue":"hl","shortVenue":"lighter","longMarket":"ETH","shortMarket":"ETH","sizeUsd":100}'
```

Save the actual `taskId` from the response. `202` with `pending` means queued; [read the task](/api-reference/get-task) to check execution.

<RequestExample>
  ```bash cURL theme={null}
  : "${MOBIUS_API_BASE_URL:?Set the API URL from your app}"
  : "${MOBIUS_API_KEY:?Set your API key locally}"
  : "${IDEMPOTENCY_KEY:?Generate and persist an ID before this mutation}"

  curl -i "$MOBIUS_API_BASE_URL/v1/delta-neutral/tasks" \
    -H "Authorization: Bearer $MOBIUS_API_KEY" \
    -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
    -H "Content-Type: application/json" \
    -d '{"longVenue":"hl","shortVenue":"lighter","longMarket":"ETH","shortMarket":"ETH","sizeUsd":100}'
  ```
</RequestExample>


## OpenAPI

````yaml api-reference/openapi.json POST /v1/delta-neutral/tasks
openapi: 3.1.1
info:
  title: MöB Delta Neutral API
  version: 1.0.0
  description: >-
    Create and manage paired positions through your bound venue accounts.


    Create an API key in this environment and pass it as a Bearer token. Keys
    grant specific venues and a maximum USD size per leg; they cannot withdraw
    funds. Local and demo deployments can execute real trades.


    All POST requests require a persisted Idempotency-Key. Reuse the same key,
    method, path and equivalent JSON when retrying an uncertain result. Keys are
    scoped to the wallet owner across API keys. HTTP 202 acknowledges a command;
    poll the task to observe execution.


    Authenticated requests are limited to 120 per minute per key. Respect
    Retry-After on 429. Numeric database fields in task responses are decimal
    strings.
servers: []
security:
  - BearerAuth: []
tags:
  - name: Service
  - name: Tasks
  - name: Request logs
paths:
  /v1/delta-neutral/tasks:
    post:
      tags:
        - Tasks
      summary: Create a task
      description: >-
        Queues a new paired position. Both venues must be different, granted by
        the key and bound by its owner.
      operationId: createTask
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTask'
            example:
              longVenue: hl
              shortVenue: lighter
              longMarket: ETH
              shortMarket: ETH
              sizeUsd: 100
      responses:
        '202':
          description: Command accepted. Inspect task status for execution.
          content:
            application/json:
              schema:
                type: object
                properties:
                  taskId:
                    type: string
                    format: uuid
                  status:
                    type: string
                    const: pending
                required:
                  - taskId
                  - status
              example:
                taskId: 00000000-0000-4000-8000-000000000001
                status: pending
          headers:
            X-Request-Id:
              schema:
                type: string
                format: uuid
              description: Support correlation ID.
            X-RateLimit-Limit:
              schema:
                type: integer
                const: 120
            X-RateLimit-Remaining:
              schema:
                type: integer
                minimum: 0
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '413':
          $ref: '#/components/responses/Error413'
        '415':
          $ref: '#/components/responses/Error415'
        '429':
          $ref: '#/components/responses/Error429'
        '503':
          $ref: '#/components/responses/Error503'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: true
      description: >-
        Persist one ID per intended mutation before sending. Reuse it with the
        same request for retries; different content returns 409.
      schema:
        type: string
        minLength: 1
        maxLength: 128
        pattern: ^[!-~]+$
  schemas:
    CreateTask:
      type: object
      properties:
        longVenue:
          $ref: '#/components/schemas/Venue'
        shortVenue:
          $ref: '#/components/schemas/Venue'
        longMarket:
          $ref: '#/components/schemas/Market'
        shortMarket:
          $ref: '#/components/schemas/Market'
        sizeUsd:
          type: number
          minimum: 10
          maximum: 99999999999999
          description: USD per leg, within this key’s maximum and venue minimums.
        minFundingApy:
          type: number
          minimum: 0
          maximum: 999999
          default: 0
        autoClose:
          type: boolean
          default: true
        maxSpreadBps:
          type: number
          exclusiveMinimum: 0
          maximum: 99999999999999
        liqProtectionPct:
          type: number
          exclusiveMinimum: 0
          maximum: 100
        sizeMismatchPct:
          type: number
          minimum: 0.5
          maximum: 100
      required:
        - longVenue
        - shortVenue
        - longMarket
        - shortMarket
        - sizeUsd
      additionalProperties: false
      description: >-
        Use two different, granted and bound venues. Leverage and margin mode
        are configured on venue accounts, not through this API.
    Venue:
      type: string
      enum:
        - hl
        - lighter
        - lighter-mainnet
        - aster
      description: >-
        hl = Hyperliquid; lighter = Lighter RH (Robinhood); lighter-mainnet =
        canonical Lighter; aster = Aster.
    Market:
      type: string
      description: >-
        Exact listed venue symbol. Examples: ETH; Hyperliquid xyz:NVDA or
        io:ANTH; Aster USD1:XAU or U:BTC. Check current listings.
      examples:
        - ETH
        - xyz:NVDA
        - USD1:XAU
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
      required:
        - error
        - code
      additionalProperties: true
  responses:
    Error400:
      description: Invalid fields, query, JSON or idempotency key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error401:
      description: Missing, invalid or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error403:
      description: Key does not grant the required venues.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error404:
      description: Task not found or inaccessible.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error409:
      description: Conflicting state, owner operation, binding or idempotency key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error413:
      description: JSON body exceeds 16,384 bytes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error415:
      description: Content-Type must be application/json.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
    Error429:
      description: 120 requests per minute per key exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
        Retry-After:
          schema:
            type: integer
            minimum: 1
          description: Seconds to wait before retrying.
    Error503:
      description: Storage, market data or worker feature unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        X-Request-Id:
          schema:
            type: string
            format: uuid
          description: Support correlation ID.
        X-RateLimit-Limit:
          schema:
            type: integer
            const: 120
        X-RateLimit-Remaining:
          schema:
            type: integer
            minimum: 0
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key created in this environment: mobius_<uuid>.<secret>. Keep it in
        a local environment variable; never commit it.

````