Average Entry Price
primitive.average_entryCalculate the weighted average entry price from multiple buy/sell fills (DCA): the bare number only, no breakeven or per-fill breakdown. Use when user asks only "what's my average entry?" and wants just that figure. Each fill is { price, quantity } here (workflow.run_dca_entry calls the same field size). For breakeven and a per-level summary too, use workflow.run_dca_entry instead. Returns: averagePrice, totalSize, totalCost.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Object with a "fills" array, e.g. { "fills": [{ "price": 60000, "quantity": 0.5 }, { "price": 58000, "quantity": 1 }] } | |
| symbol | Yes | Trading pair symbol, e.g. BTCUSDT | |
| contractType | No | linear = USDT-margined, average is the arithmetic mean (default). inverse = coin-margined, average is the harmonic mean (fill quantity is USD notional). | |
| exchangeCode | No | Exchange identifier (optional) |