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

# userTwapSliceFills | Hyperliquid info

> The info endpoint with type: "userTwapSliceFills" retrieves a user's TWAP (Time-Weighted Average Price) slice fills on the Hyperliquid exchange.

<Info>
  You can only use this endpoint on the official Hyperliquid public API. It is not available through Chainstack, as the open-source node implementation does not support it yet. See [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `info` endpoint with `type: "userTwapSliceFills"` retrieves a user's TWAP (Time-Weighted Average Price) slice fills on the Hyperliquid exchange. This endpoint provides detailed information about individual fill executions that result from TWAP order slicing, enabling analysis of TWAP execution quality and performance.

## Parameters

### Request body

* `type` (string, required) — The request type. Must be `"userTwapSliceFills"` to retrieve TWAP slice fills.
* `user` (string, required) — Address in 42-character hexadecimal format; e.g. 0x0000000000000000000000000000000000000000.

## Response

The response is an array of TWAP slice fill objects, each containing detailed fill information and the associated TWAP order ID:

### Response structure

Each TWAP slice fill object contains:

* `fill` — Detailed fill information object (similar to regular fills)
* `twapId` — Unique identifier for the TWAP order that generated this slice fill

### Fill data structure

The `fill` object contains comprehensive execution information:

**Core trade data:**

* `coin` — Asset identifier (simple names like "BTC", "ETH" for perpetuals; spot format like "@107" for spot trades)
* `px` — Fill price as a string for precision
* `sz` — Fill size (quantity traded)
* `side` — Trade side: "A" for Ask/Sell, "B" for Bid/Buy
* `time` — Fill timestamp in milliseconds
* `oid` — Order ID that generated this fill
* `tid` — Unique trade ID

**Position and P\&L data:**

* `startPosition` — Position size before this fill
* `dir` — Trade direction (e.g., "Open Long", "Close Short", "Buy", "Sell")
* `closedPnl` — Realized profit/loss from this fill
* `crossed` — Boolean indicating if this was a crossing order

**Fee and transaction data:**

* `fee` — Trading fee paid for this fill
* `feeToken` — Token used to pay the fee (typically "USDC")
* `hash` — Transaction hash (TWAP fills have a hash of all zeros)

**TWAP-specific characteristics:**

* `twapId` — Links this fill to the parent TWAP order
* `hash` — Always "0x0000000000000000000000000000000000000000000000000000000000000000" for TWAP fills

### Data limits and ordering

**Response limits:**

* Maximum 2000 most recent TWAP slice fills
* Results are ordered by time (most recent first)
* Older fills beyond the 2000 limit are not accessible

**TWAP execution context:**

* Each fill represents one slice execution from a larger TWAP order
* Multiple fills can share the same `twapId` if they're from the same TWAP order
* Fills show the actual execution details of TWAP slicing strategy

## TWAP order execution

### Understanding TWAP fills

**TWAP strategy:**

* Large orders are broken into smaller slices executed over time
* Each slice execution generates a separate fill record
* Goal is to achieve time-weighted average pricing and reduce market impact

**Slice execution:**

* Individual slices are executed as market conditions allow
* Each slice fill shows actual execution price and quantity
* Timing and sizing depend on TWAP algorithm parameters

**Execution tracking:**

* `twapId` groups all fills from the same TWAP order
* Sequential fills show the progression of TWAP execution
* Total execution = sum of all fills with the same `twapId`

### TWAP vs regular fills

**Key differences:**

* TWAP fills have zero hash (`0x000...000`)
* TWAP fills are linked by `twapId`
* TWAP fills represent algorithmic execution slices
* Regular fills represent direct order executions

### Asset identification

**Perpetual contracts:**

* Use simple asset names: "BTC", "ETH", "AVAX", "SOL"
* Represent standard perpetual futures contracts

**Spot markets:**

* Use indexed format: "@107", "@1", etc.
* Index corresponds to the spot pair position in the universe
* Some assets may have remapped names in user interfaces

## Performance analysis

### TWAP execution metrics

**Price performance:**

* Compare individual slice prices to market benchmarks
* Analyze price improvement or slippage across slices
* Calculate volume-weighted average price (VWAP) achieved

**Timing analysis:**

* Review execution timing across the TWAP duration
* Analyze market impact of individual slices
* Assess execution completion rate and timing

**Cost analysis:**

* Sum fees across all slices for total execution cost
* Compare TWAP execution costs to alternative strategies
* Analyze fee efficiency of slice sizing

## Example request

<CodeGroup>
  ```shell Shell theme={"system"}
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{"type": "userTwapSliceFills", "user": "0x31ca8395cf837de08b24da3f660e77761dfb974b"}' \
    https://api.hyperliquid.xyz/info
  ```

  ```python Python (hyperliquid-python-sdk) theme={"system"}
  from hyperliquid.info import Info
  from hyperliquid.utils import constants

  # This method is available only on the public Hyperliquid API.
  info = Info(constants.MAINNET_API_URL, skip_ws=True)

  fills = info.user_twap_slice_fills("0x31ca8395cf837de08b24da3f660e77761dfb974b")
  print(fills)
  ```

  ```typescript TypeScript (@nktkas/hyperliquid) theme={"system"}
  import * as hl from "@nktkas/hyperliquid";

  // This method is available only on the public Hyperliquid API.
  const transport = new hl.HttpTransport();
  const info = new hl.InfoClient({ transport });

  const fills = await info.userTwapSliceFills({
    user: "0x31ca8395cf837de08b24da3f660e77761dfb974b",
  });
  console.log(fills);
  ```
</CodeGroup>

## Example response

```json theme={"system"}
[
  {
    "fill": {
      "closedPnl": "0.0",
      "coin": "AVAX",
      "crossed": true,
      "dir": "Open Long",
      "hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "oid": 90542681,
      "px": "18.435",
      "side": "B",
      "startPosition": "26.86",
      "sz": "93.53",
      "time": 1681222254710,
      "fee": "0.01",
      "feeToken": "USDC",
      "tid": 118906512037719
    },
    "twapId": 3156
  }
]
```

## Use cases

The `info` endpoint with `type: "userTwapSliceFills"` is essential for applications that need to:

* **TWAP execution analysis**: Analyze the performance and efficiency of TWAP order executions
* **Algorithmic trading evaluation**: Assess the effectiveness of TWAP strategies and parameters
* **Market impact studies**: Study how TWAP slicing affects market impact and execution quality
* **Performance attribution**: Attribute trading performance to specific TWAP execution strategies
* **Cost analysis**: Calculate total execution costs and analyze fee efficiency across TWAP slices
* **Execution quality monitoring**: Monitor TWAP execution quality and identify optimization opportunities
* **Risk management**: Assess execution risk and market impact of large order strategies
* **Strategy optimization**: Optimize TWAP parameters based on historical execution data
* **Compliance reporting**: Generate detailed reports on algorithmic execution for regulatory requirements
* **Client reporting**: Provide institutional clients with detailed TWAP execution reports
* **Academic research**: Study algorithmic execution strategies and market microstructure
* **Quantitative analysis**: Perform statistical analysis on TWAP execution patterns and outcomes
* **Benchmark comparison**: Compare TWAP execution against other execution strategies
* **Market timing analysis**: Analyze optimal timing for TWAP execution initiation
* **Liquidity analysis**: Study market liquidity patterns through TWAP execution data
* **Trading system development**: Build and optimize TWAP execution algorithms
* **Portfolio management**: Track large order executions as part of portfolio management
* **Execution consulting**: Provide execution analysis and optimization services
* **Regulatory compliance**: Maintain detailed records of algorithmic execution for audit purposes
* **Performance reporting**: Generate comprehensive execution performance reports for stakeholders

This endpoint provides specialized data for analyzing TWAP execution performance, enabling sophisticated analysis of algorithmic trading strategies and execution quality on the Hyperliquid platform.


## OpenAPI

````yaml openapi/hyperliquid_node_api/hypercore_info/info_user_twap_slice_fills.json post /info
openapi: 3.0.0
info:
  title: Hyperliquid Node API - User TWAP Slice Fills
  version: 1.0.0
servers:
  - url: https://api.hyperliquid.xyz
security: []
paths:
  /info:
    post:
      summary: Retrieve a user's TWAP slice fills
      description: >-
        Retrieve the most recent TWAP (Time-Weighted Average Price) slice fills
        for a specific user. Returns at most 2000 most recent TWAP slice fills
        with detailed execution information.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - type
                - user
              properties:
                type:
                  type: string
                  enum:
                    - userTwapSliceFills
                  default: userTwapSliceFills
                  description: >-
                    The request type. Must be 'userTwapSliceFills' to retrieve
                    TWAP slice fills.
                user:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  default: '0x31ca8395cf837de08b24da3f660e77761dfb974b'
                  description: >-
                    Address in 42-character hexadecimal format; e.g.
                    0x0000000000000000000000000000000000000000.
            example:
              type: userTwapSliceFills
              user: '0x31ca8395cf837de08b24da3f660e77761dfb974b'
      responses:
        '200':
          description: Successful response with TWAP slice fills data
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    fill:
                      type: object
                      properties:
                        closedPnl:
                          type: string
                          description: Realized profit/loss from this fill
                        coin:
                          type: string
                          description: >-
                            Asset identifier (simple names like 'BTC', 'ETH' for
                            perpetuals; spot format like '@107' for spot trades)
                        crossed:
                          type: boolean
                          description: Boolean indicating if this was a crossing order
                        dir:
                          type: string
                          description: >-
                            Trade direction (e.g., 'Open Long', 'Close Short',
                            'Buy', 'Sell')
                        hash:
                          type: string
                          description: >-
                            Transaction hash (TWAP fills have a hash of
                            0x0000000000000000000000000000000000000000000000000000000000000000)
                        oid:
                          type: integer
                          format: int64
                          description: Order ID that generated this fill
                        px:
                          type: string
                          description: Fill price as a string for precision
                        side:
                          type: string
                          enum:
                            - A
                            - B
                          description: 'Trade side: ''A'' for Ask/Sell, ''B'' for Bid/Buy'
                        startPosition:
                          type: string
                          description: Position size before this fill
                        sz:
                          type: string
                          description: Fill size (quantity traded)
                        time:
                          type: integer
                          format: int64
                          description: Fill timestamp in milliseconds
                        fee:
                          type: string
                          description: Trading fee paid for this fill
                        feeToken:
                          type: string
                          description: Token used to pay the fee (typically 'USDC')
                        tid:
                          type: integer
                          format: int64
                          description: Unique trade ID
                      required:
                        - closedPnl
                        - coin
                        - crossed
                        - dir
                        - hash
                        - oid
                        - px
                        - side
                        - startPosition
                        - sz
                        - time
                        - fee
                        - feeToken
                        - tid
                    twapId:
                      type: integer
                      format: int64
                      description: >-
                        Unique identifier for the TWAP order that generated this
                        slice fill
                  required:
                    - fill
                    - twapId
              example:
                - fill:
                    closedPnl: '0.0'
                    coin: AVAX
                    crossed: true
                    dir: Open Long
                    hash: >-
                      0x0000000000000000000000000000000000000000000000000000000000000000
                    oid: 90542681
                    px: '18.435'
                    side: B
                    startPosition: '26.86'
                    sz: '93.53'
                    time: 1681222254710
                    fee: '0.01'
                    feeToken: USDC
                    tid: 118906512037719
                  twapId: 3156

````