> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inkwell.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Embedded Lending

> Integrate Leviathan's credit infrastructure directly into your protocol — users get leverage without leaving your app.

> **CONFIDENTIAL & PROPRIETARY © 2026 Inkwell Finance, Inc. All Rights Reserved.**
>
> This document is for informational purposes only and does not constitute legal, tax, or investment advice, nor an offer to sell or a solicitation to buy any security or other financial instrument. Any examples, structures, or flows described here are design intent only and may change.

## What Is Embedded Lending?

Embedded Lending lets protocols integrate Leviathan's credit infrastructure directly into their own UI. Instead of sending users to a separate lending platform, protocols offer borrowing as a native feature — users get access to leverage without leaving the app they're already using.

From the user's perspective, it feels like a built-in feature of the protocol. Under the hood, Leviathan handles credit assessment, policy enforcement, and revenue-based repayment.

## How It Works

```
┌─────────────────────────────────────────────┐
│              Protocol Frontend              │
│                                             │
│   User clicks "Enable Leverage" ───────┐    │
│                                        │    │
│   ┌────────────────────────────────┐   │    │
│   │    Leviathan Embedded SDK      │◄──┘    │
│   │    (@leviathan/sdk/embedded)   │        │
│   └──────────┬─────────────────────┘        │
└──────────────┼──────────────────────────────┘
               │
    ┌──────────▼──────────────┐
    │   Leviathan On-Chain    │
    │   Programs (Solana)     │
    │                         │
    │   • Credit scoring      │
    │   • Loan origination    │
    │   • Policy enforcement  │
    │   • Revenue splitting   │
    └─────────────────────────┘
```

1. A protocol integrates the Leviathan Embedded SDK into their frontend
2. Users interact with lending features natively within the protocol's interface
3. The SDK communicates with Leviathan's on-chain programs for credit checks, loan origination, and policy enforcement
4. Borrowed capital is **caged** to the integrating protocol — it can only be used within that protocol's whitelisted destinations
5. Revenue from the user's activity flows through automated splitters for repayment

## Value Proposition

<CardGroup cols={2}>
  <Card title="For Protocols" icon="building">
    **New revenue stream and deeper engagement**

    * Earn revenue share on lending fees generated through your platform
    * Increase TVL as users deploy leveraged capital within your protocol
    * Improve user retention — borrowers have an ongoing relationship with your platform
    * No balance sheet risk — Leviathan handles the credit infrastructure
  </Card>

  <Card title="For Users" icon="user">
    **Seamless leverage within your existing workflow**

    * Access credit without leaving the protocol you already use
    * No separate onboarding or platform switching
    * Credit eligibility based on your on-chain track record
    * Repayment tied to your activity — automated and flexible
  </Card>
</CardGroup>

## How Embedded Differs from Credit Line

The **Credit Line** product is Leviathan's direct lending platform — borrowers apply through Leviathan's own interface, receive capital, and deploy it across approved destinations on multiple protocols.

**Embedded Lending** is different in several key ways:

|                       | Credit Line                      | Embedded                            |
| --------------------- | -------------------------------- | ----------------------------------- |
| **Distribution**      | Leviathan's own app              | Partner protocol's UI               |
| **Capital scope**     | Multi-protocol (whitelisted set) | Single protocol (caged)             |
| **User relationship** | Borrower ↔ Leviathan             | Borrower ↔ Protocol                 |
| **Revenue model**     | Leviathan collects fees          | Revenue share with protocol         |
| **Policy scope**      | Broad destination whitelist      | Narrow, protocol-specific functions |

The capital caging is the critical distinction: in Embedded, borrowed funds can **only** be used within the integrating protocol's approved contract set. This tighter scope simplifies policy enforcement and aligns incentives — the protocol benefits from increased activity, and lenders benefit from reduced risk surface.

## How Embedded Differs from Prime Brokerage

**Prime Brokerage** offers multi-protocol margin accounts where sophisticated traders deploy capital across many venues simultaneously. It's designed for professional participants who need cross-protocol flexibility.

**Embedded** is single-protocol scope — capital stays within the integrating protocol. It's designed for the protocol's existing user base, not external traders. The integration is lighter, the policy enforcement is simpler, and the user experience is seamless within one product.

## Use Cases

### DEXs — Margin Trading

A decentralized exchange integrates Embedded Lending to offer margin trading. Users can open leveraged positions directly in the DEX interface, with borrowed capital restricted to trading on that exchange. Revenue from trading fees flows through automated splitters to service the loan.

### Yield Protocols — Leveraged Positions

A yield aggregator offers leveraged yield farming. Users deposit collateral and borrow additional capital that can only be deployed into the protocol's approved yield strategies. Higher yields accelerate loan repayment through the revenue split.

### NFT Marketplaces — Working Capital

An NFT marketplace provides working capital to active traders. Borrowed capital can only be used to purchase NFTs on that marketplace, and a portion of future sale proceeds is automatically directed to loan repayment.

### AI Agent Platforms — Treasury Credit

An AI agent platform offers credit lines to agents with proven revenue track records. Borrowed capital is caged to the platform's approved operations, and agent earnings are split for automated repayment.

## Next Steps

<CardGroup cols={2}>
  <Card title="Architecture" icon="diagram-project" href="/leviathan/embedded/architecture">
    How the embedded lending system is built
  </Card>

  <Card title="Integration Guide" icon="code" href="/leviathan/embedded/integration-guide">
    Start integrating Leviathan into your protocol
  </Card>

  <Card title="Protocol Onboarding" icon="handshake" href="/leviathan/embedded/protocol-onboarding">
    Apply to become an embedded lending partner
  </Card>
</CardGroup>
