Average Down
workflow.run_average_downShould-I-average-down check: for an already-open position, compares adding more at a worse price against the always-available alternative of buying the same final total size fresh at today's price. Returns the new blended average entry, liquidation price and breakeven (before vs. after), margin_added (the actual cash/margin required for the add at this leverage, not the full notional), and three risk figures at your stop-loss: existing_risk (what you already risk, before adding), pyramid_risk (what you'd risk after adding), and clean_entry_risk (what a fresh entry at add_price for the same total size would risk). risk_penalty_pct is how much MORE than that fresh-entry alternative you're risking - for any genuine average-down (add_price worse than existing_entry_price) pyramid_risk is provably always greater than clean_entry_risk. liquidation_before_stop is true when the new liquidation price sits at or beyond your own stop-loss, meaning the exchange would force-close the position before the stop-loss ever triggers. Use when user asks "should I add to this losing position?" or "what does averaging down actually cost me here?".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mmr | No | Maintenance margin rate (default 0.005) | |
| side | Yes | ||
| add_size | Yes | Additional size being considered, same unit convention as existing_size | |
| leverage | Yes | Leverage multiplier | |
| add_price | Yes | Proposed price to add at - also treated as today's current price for the fresh-entry comparison | |
| stop_loss | Yes | Stop-loss price (must be below add_price for a long, above it for a short - the position should already be closed otherwise) | |
| contractType | No | linear = USDT-margined (default), inverse = coin-margined. Risk figures come back denominated in the base coin for inverse. | |
| fee_open_pct | No | Open fee rate (default 0.0002) | |
| existing_size | Yes | Size already held: base-asset quantity for linear, USD notional (contracts) for inverse | |
| fee_close_pct | No | Close fee rate (default 0.0005) | |
| existing_entry_price | Yes | Entry price of the position already held |