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

# Flatten all positions at market (kill switch tier 3)

> Nuclear option: close all open positions AND cancel all working
orders. Each affected card gets an audit entry marked as
'user-initiated emergency flatten'.



## OpenAPI

````yaml /api/openapi.json post /api/graph/v1/trade/flatten-all
openapi: 3.1.0
info:
  title: Sequency Graph API
  description: >

    # Sequency Graph-Native Trading API


    Graph-native API for trading intelligence, built on FalkorDB.


    ## Features


    - **Screener**: Filter stocks using graph-native queries with relationship
    expansion

    - **Stock Detail**: Complete stock context with all relationships

    - **Confluence Scoring**: Setup quality assessment with weighted components

    - **Strategy Matching**: Find matching options strategies via graph
    traversal

    - **Market Context**: Current market-wide context for trading decisions


    ## Data Sources


    All data is sourced from the FalkorDB knowledge graph, populated by:

    - Pattern detector (Go) - Technical indicators, patterns

    - Graph sync service - Levels, volume profiles, news, day classification
  version: 1.0.0
servers: []
security: []
paths:
  /api/graph/v1/trade/flatten-all:
    post:
      tags:
        - trade-cards
      summary: Flatten all positions at market (kill switch tier 3)
      description: |-
        Nuclear option: close all open positions AND cancel all working
        orders. Each affected card gets an audit entry marked as
        'user-initiated emergency flatten'.
      operationId: flatten_all_api_graph_v1_trade_flatten_all_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ControlActionResponse'
components:
  schemas:
    ControlActionResponse:
      properties:
        action:
          type: string
          title: Action
        affected_count:
          type: integer
          title: Affected Count
          default: 0
        card_ids:
          items:
            type: string
          type: array
          title: Card Ids
        errors:
          items:
            type: string
          type: array
          title: Errors
      type: object
      required:
        - action
      title: ControlActionResponse

````