> For the complete documentation index, see [llms.txt](https://docs.kpk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kpk.io/funds/infrastructure/architecture/core-concepts/subscriptions.md).

# Subscriptions

The request-based deposit flow, from an investor's request to operator-settled, newly minted shares.

A subscription is a **user's request to enter the fund** by depositing an approved asset (for example USDC) in exchange for **newly minted shares** priced against the current NAV.

<figure><img src="https://1699303810-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUsQM4bzcmOPSgkWddkeN%2Fuploads%2Fgit-blob-dea20bbaf230c03a83b99343dbe54e2fbc77fe34%2Fsubscription-flow.svg?alt=media" alt="Subscription flow: an investor requests a subscription, assets are escrowed, the operator settles at a price, and shares are minted while assets move to the Portfolio Safe."><figcaption><p>The subscription lifecycle.</p></figcaption></figure>

## Lifecycle

{% stepper %}
{% step %}
**Request.** After approving the asset, the investor calls `requestSubscription(assetsIn, minSharesOut, subscriptionAsset, receiver)`. The deposited assets are pulled into **escrow** inside the `kpkShares` contract, a `PENDING` request is recorded, and a `SubscriptionRequest` event is emitted with the request id. `minSharesOut` is **slippage protection**; the actual shares are computed at settlement time. `receiver` may differ from the investor.
{% endstep %}

{% step %}
**Settlement.** An operator calls `processRequests(approveIds, rejectIds, asset, sharesPrice)`. For each approved subscription it computes `shares = assetsToShares(assetAmount, sharesPrice, asset)`, checks `shares ≥ minSharesOut`, **mints** the shares to the `receiver`, and transfers the escrowed assets to the **Portfolio Safe** (portfolio). The request becomes `PROCESSED` and `SubscriptionApproval` is emitted.
{% endstep %}

{% step %}
**Or rejection / expiry.** An operator can reject a request (`SubscriptionDenial`), returning the escrowed assets to the investor. Any request older than its 7-day lifetime is skipped during processing and auto-rejected (`SubscriptionRequestExpired`), also returning the assets.
{% endstep %}

{% step %}
**Or cancellation.** While still `PENDING`, the investor or receiver can cancel after the request's TTL has elapsed (`cancelSubscription(id)`), recovering the escrowed assets. See [Cancel a request](/funds/kpk-fund-integration/cancel-a-request.md).
{% endstep %}
{% endstepper %}

A request moves through exactly one terminal state: `PROCESSED`, `REJECTED`, or `CANCELLED`.

## The request event

```solidity
event SubscriptionRequest(
    address indexed investor,
    uint256 requestId,
    address indexed receiver,
    address indexed subscriptionAsset,
    uint256 assetsAmount,
    uint256 sharesAmount,   // the minSharesOut at request time
    uint64  timestamp,
    uint64  cancelableFrom, // timestamp + subscriptionRequestTtl
    uint64  expiryAt        // timestamp + 7 days
);
```

`cancelableFrom` is when the investor may cancel; `expiryAt` is when the request can no longer be approved. See [Subscription request](/funds/kpk-fund-integration/subscription-request.md) for integration code, and [Fees](/funds/infrastructure/architecture/core-concepts/fees.md) for the management/performance fees charged during settlement.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kpk.io/funds/infrastructure/architecture/core-concepts/subscriptions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
