# calculateDepositNeeded

> **calculateDepositNeeded**(`params`): [`OutputType`](/reference/filoz/synapse-core/warm-storage/namespaces/calculatedepositneeded/type-aliases/outputtype/)

Defined in: [packages/synapse-core/src/warm-storage/calculate-deposit-needed.ts:72](https://github.com/FilOzone/synapse-sdk/blob/0c729dad461472f017e4d84f8e6ac16e6afbe7c0/packages/synapse-core/src/warm-storage/calculate-deposit-needed.ts#L72)

Orchestrate lockup + lifecycle-reserve replenishment + runway + debt + buffer
to compute total deposit needed.

This compatibility helper adapts one data set to the shared pure
`calculateUploadCosts` utility, so its funding result stays aligned with the
single-context and multi-context top-level APIs.

Operation fees are returned as costs but are not added directly to the
deposit. FWSS pays them from the lifecycle reserve, reducing account funds
and fixed lockup together. The deposit includes only the initial reserve and
any fixed-lockup increase needed when the reserve crosses its replenish
threshold.

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `params` | [`ParamsType`](/reference/filoz/synapse-core/warm-storage/namespaces/calculatedepositneeded/type-aliases/paramstype/) | [calculateDepositNeeded.ParamsType](/reference/filoz/synapse-core/warm-storage/namespaces/calculatedepositneeded/type-aliases/paramstype/) |

## Returns

[`OutputType`](/reference/filoz/synapse-core/warm-storage/namespaces/calculatedepositneeded/type-aliases/outputtype/)

[calculateDepositNeeded.OutputType](/reference/filoz/synapse-core/warm-storage/namespaces/calculatedepositneeded/type-aliases/outputtype/)

## Throws

ValidationError when lifecycle reserve state, leaf count, or piece sizes are invalid