# calculateLifecycleReserveFunding

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

Defined in: [packages/synapse-core/src/warm-storage/calculate-lifecycle-reserve-funding.ts:48](https://github.com/FilOzone/synapse-sdk/blob/0c729dad461472f017e4d84f8e6ac16e6afbe7c0/packages/synapse-core/src/warm-storage/calculate-lifecycle-reserve-funding.ts#L48)

Calculate lifecycle-reserve funding for an upload.

FWSS pays operation fees from the PDP rail's fixed lifecycle reserve. Before
the fee flush it replenishes an active reserve when the remaining balance
would fall below `replenishThreshold`. `pieceSizes` represents one
add-pieces operation and therefore one fee flush.

Operation fees remain real charges, but they must not also be added directly
to the deposit: paying a fee reduces account funds and fixed lockup by the
same amount. Only initial reserve creation and conditional replenishments
require additional funding.

## Parameters

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

## Returns

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

Lifecycle funding and expected final balance [calculateLifecycleReserveFunding.OutputType](/reference/filoz/synapse-core/warm-storage/namespaces/calculatelifecyclereservefunding/type-aliases/outputtype/)

## Throws

ValidationError when counts or existing reserve state are invalid