export interface ResolveMarginParams { /** * Per-signal `marginPct` override (% of withdrawable, 0–100). Highest priority. * Same basis + `/100` math as config `margin_pct`. */ signalMarginPct?: number; /** margin_pct from strategy config (% of withdrawable). */ marginPct?: number; /** Withdrawable balance from ClearinghouseState. Required when marginPct is used. */ withdrawable?: number; /** Fixed margin_per_slot from strategy config. */ marginPerSlot?: number; /** Total strategy budget (USD). Used as the lowest-priority fallback divided by `slots`. */ budget?: number; /** Number of strategy slots. Divisor for the `budget` fallback. */ slots?: number; } /** * Resolve margin amount using the priority chain: * signal marginPct (% of withdrawable) > config margin_pct (% of withdrawable) * > margin_per_slot > budget / slots * * `withdrawable` should be a snapshot captured once per signal batch so that * every position in the same batch gets equal sizing. Across separate events * the balance will naturally shrink as positions are opened — this is expected. * * The `budget / slots` fallback exists for 1.0.97 backward compatibility: * recipes that set only `strategy.budget` and `strategy.slots` (no * `margin_per_slot`/`margin_pct`) must continue to size positions. * * Returns undefined when no margin source is available. */ export declare function resolveMargin(params: ResolveMarginParams): number | undefined; /** Which precedence branch produced the margin amount (for the sizing breadcrumb). */ export type MarginSource = "signal_marginPct" | "config_margin_pct" | "margin_per_slot" | "budget_over_slots" | "none"; /** * Same precedence as {@link resolveMargin}, additionally naming WHICH branch won. * Single source of truth — `resolveMargin` is `resolveMarginWithSource(params).amount` * — so the logged source can never drift from the amount actually used. */ export declare function resolveMarginWithSource(params: ResolveMarginParams): { amount: number | undefined; source: MarginSource; }; //# sourceMappingURL=resolve-margin.d.ts.map