Docs

twapOrder - Time-Weighted Average Price Orders

Submit TWAP orders on Hyperliquid for gradual position building with minimal market impact.

Submit a Time-Weighted Average Price (TWAP) order that executes gradually over a specified time period. TWAP orders split large orders into smaller pieces to minimize market impact.

Sample Data

JSON
{
  "signature": {
    "r": "0xec414de7c86d85e3c73aba1ed8496e15f48acb37ec7f9b52a1c7d76f091ccd45",
    "s": "0x373d79f4d9731a69b4d93ccebf3fa711eae9550be65878c9358f30b20e798e4b",
    "v": 28
  },
  "action": {
    "type": "twapOrder",
    "twap": {
      "a": 10260,
      "b": true,
      "s": "215.72",
      "r": false,
      "m": 1440,
      "t": false
    }
  },
  "nonce": 1768146926099
}

View this transaction on Hypurrscan

Field Reference

Action Fields

FieldTypeDescription
typestringAlways "twapOrder"
anumberAsset index (e.g., 0 = BTC)
bbooleanSide: true for buy, false for sell
sstringTotal size to execute
rbooleanReduce-only flag
mnumberDuration in minutes
tbooleanRandomize execution (avoid predictable patterns)

TWAP Execution

TWAP orders:

  • Split total size into smaller child orders
  • Execute over the specified duration
  • Can be randomized to avoid detection
  • Minimize market impact for large positions

Use Cases

Institutional Order Detection

Track TWAP order submissions for large position building:

Python
def process_twapOrder_action(action):
    asset = action.get('a')
    side = 'BUY' if action.get('b') else 'SELL'
    size = action.get('s')
    duration = action.get('m')

    print(f"TWAP: {side} {size} of asset {asset} over {duration} minutes")

Market Impact Analysis

Monitor TWAP activity to understand institutional positioning.

Execution Quality Research

Study TWAP execution patterns and slippage.