# Overview

This section is for **integrators** building on top of KPK vaults: wallets adding an Earn section, fintech apps offering yield to end-users, custodians and CEXs allocating client assets, and distribution partners that want to charge a fee on top of KPK strategies.

End-users who simply want to deposit should use the protocol UI directly. Vault addresses, supported assets, and current parameters are listed on each [vault page](https://github.com/karpatkey/kpk-docs-gitbook/blob/main/vaults/vaults/README.md).

This page covers the protocol-agnostic shape of an integration: who is integrating, what they need to build, and which functions to wire up. For protocol-specific nuances (SDKs, batch flows, referral codes, fee wrappers), follow the links into the per-protocol pages:

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-cover-dark data-type="image">Cover image (dark)</th></tr></thead><tbody><tr><td align="center"><strong>Morpho</strong></td><td><a href="/pages/qeoZ4VNxQIpv8Kbffbm0">/pages/qeoZ4VNxQIpv8Kbffbm0</a></td><td><a href="/files/c1HkEA8uhgRiH1sKh8sh">/files/c1HkEA8uhgRiH1sKh8sh</a></td><td><a href="/files/7LqFU1HFIskOIGOX156T">/files/7LqFU1HFIskOIGOX156T</a></td></tr><tr><td align="center"><strong>Euler</strong></td><td><a href="/pages/u04SAJktpqE3hxpqdEAb">/pages/u04SAJktpqE3hxpqdEAb</a></td><td><a href="/files/9t0GcmQcou2t3mdv3ik8">/files/9t0GcmQcou2t3mdv3ik8</a></td><td><a href="/files/UlbfSRhYRtbtYAFUFbMJ">/files/UlbfSRhYRtbtYAFUFbMJ</a></td></tr><tr><td align="center"><strong>Gearbox</strong></td><td><a href="/pages/hCSDjLtK49fqnfe55mJY">/pages/hCSDjLtK49fqnfe55mJY</a></td><td><a href="/files/pD2JkUtd1zfEc8y25O62">/files/pD2JkUtd1zfEc8y25O62</a></td><td><a href="/files/1y5mvOaEIIFZZ7smKbbZ">/files/1y5mvOaEIIFZZ7smKbbZ</a></td></tr></tbody></table>

### Pick your integration path

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Wallets and fintech apps</strong></td><td>Adding an Earn section to a wallet, neobank, or savings app where users hold their own keys.</td><td><a href="#building-an-earn-section">#building-an-earn-section</a></td></tr><tr><td><strong>Existing dApps and aggregators</strong></td><td>Already have an Earn product; just need vault references and the right SDK or interface.</td><td><a href="#sdks-and-direct-integration">#sdks-and-direct-integration</a></td></tr><tr><td><strong>Custodians and CEXs</strong></td><td>Allocating from a custodial wallet via direct contract calls.</td><td><a href="#direct-contract-integration">#direct-contract-integration</a></td></tr><tr><td><strong>Distribution partners</strong></td><td>Want to charge a performance or management fee on top of a KPK vault.</td><td><a href="#fee-wrappers-for-distribution-partners">#fee-wrappers-for-distribution-partners</a></td></tr></tbody></table>

### Building an Earn section

If you don't yet have an Earn surface, this section walks through what to build and how the pieces connect. If you already have one, skip to [SDKs and direct integration](#sdks-and-direct-integration).

An Earn section gives users a way to put idle assets to work. They deposit from their own wallet, yield accrues over time, and they can withdraw whenever they want. No intermediary holds the funds; every interaction is between the user's wallet and the vault.

#### What to build

A complete Earn integration covers four areas:

* **Position display.** Show the user their current deposit, accrued yield, current APY, and any claimable rewards. Update in real time.
* **Deposit and withdrawal flows.** Deposits require an asset approval (or permit signature) before the deposit transaction; withdrawals are a single call. Give users clear feedback on what's happening at each step.
* **Rewards.** Some vaults distribute additional incentive tokens on top of base yield. Surface claimable amounts and let users claim independently of their deposited position.
* **Monitoring.** Refresh user position and yield data continuously, and surface meaningful changes to vault parameters when they happen.

#### Integration checklist

1. Pick the vault(s) from the [vault directory](https://github.com/karpatkey/kpk-docs-gitbook/blob/main/vaults/vaults/README.md) and copy the addresses from each vault's **Key information** table.
2. Choose the integration path based on which protocol(s) the vault(s) live on:
   * Morpho-hosted vaults: install the [Morpho SDK](/vaults/integration/integration/morpho.md#integrating-via-the-morpho-sdk).
   * Euler-hosted vaults: use the [EVK batch or direct ERC-4626 flow](/vaults/integration/integration/euler.md).
   * Gearbox-hosted vaults: use [`depositWithReferral`](/vaults/integration/integration/gearbox.md#deposit) with the KPK referral code.
3. Display vault APY and the user's position via the relevant SDK or contract reads.
4. Build the deposit flow following the per-protocol page.
5. Build the withdrawal flow following the per-protocol page.
6. Surface claimable rewards via the [Merkl API](https://docs.merkl.xyz/) where applicable.
7. Set up real-time refresh for position and yield data.

### SDKs and direct integration

All KPK vaults are ERC-4626 compliant, so any integrator can interact with them via the standard `deposit`, `withdraw`, `redeem`, `previewDeposit`, and `previewWithdraw` methods. Each protocol exposes additional helpers and routing on top of the ERC-4626 surface:

* **Morpho-hosted vaults** are best integrated through the [Morpho SDK](https://docs.morpho.org/tools/offchain/sdks/morpho-sdk/). The SDK handles approvals, permit signatures, slippage protection, and bundler routing into the underlying v1 markets. See [Morpho integration](/vaults/integration/integration/morpho.md#integrating-via-the-morpho-sdk) for code samples.
* **Euler-hosted vaults** can be integrated either through Euler's EVK `batch()` flow (recommended when bundling Permit2 + deposit) or via direct ERC-4626 calls on the vault. See [Euler integration](/vaults/integration/integration/euler.md).
* **Gearbox-hosted vaults** are integrated through direct ERC-4626 calls, with `depositWithReferral` used in place of the standard `deposit` so KPK is correctly attributed. See [Gearbox integration](/vaults/integration/integration/gearbox.md).

### Direct contract integration

For custodians, CEXs, and onchain protocols that prefer raw contract calls without a JavaScript SDK, all KPK vaults expose the standard ERC-4626 interface: `approve` the vault on the underlying asset, then call `deposit(assets, receiver)` or `withdraw(assets, receiver, owner)` on the vault.

The protocol-specific deposit and withdrawal flows below cover the additional steps each protocol requires (bundlers, batch calls, referral codes):

* [Morpho direct contract integration](/vaults/integration/integration/morpho.md#direct-contract-integration)
* [Euler direct contract integration](/vaults/integration/integration/euler.md#deposit)
* [Gearbox direct contract integration](/vaults/integration/integration/gearbox.md#deposit)

### Fee wrappers for distribution partners

Distribution partners can request KPK to deploy a fee wrapper on top of a curated vault, charging their users a performance or management fee on the underlying KPK strategy without changing the vault itself.

<figure><picture><source srcset="/files/mLlZZOPJEjtduRX2BuxC" media="(prefers-color-scheme: dark)"><img src="/files/jmydnG77Gb4Popgi2UHS" alt=""></picture><figcaption></figcaption></figure>

Fee wrappers are currently available for **Morpho-hosted vaults** through the [Morpho Fee Wrapper](https://docs.morpho.org/build/earn/concepts/fee-wrapper). See [Morpho integration → Fee wrapper](/vaults/integration/integration/morpho.md#fee-wrapper-for-distribution-partners) for the full feature set, including flexible fee configuration and optional permissioned setups.

For partners interested in a fee arrangement on a Euler- or Gearbox-hosted vault, contact <sales@karpatkey.com> or use the [contact form](https://kpk.io/contact) to discuss what's possible.

### Protocol-specific integration

For deposit and withdrawal flows, SDK details, and protocol-specific quirks (bundlers, batch calls, referral codes, fee wrappers), follow the relevant protocol page:

* [Morpho integration](/vaults/integration/integration/morpho.md)
* [Euler integration](/vaults/integration/integration/euler.md)
* [Gearbox integration](/vaults/integration/integration/gearbox.md)

### Support

For integration questions, technical reviews, or hands-on help, reach out to <sales@karpatkey.com> or use the [contact form](https://kpk.io/contact).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kpk.io/vaults/integration/integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
