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

# Subblock: Contract and Capital Layer

This section describes the on-chain financial infrastructure that powers SuperPumped's leverage protocol. It explains how liquidity provider (LP) capital is managed, how leveraged positions borrow and repay funds, how settlement is enforced through escrow contracts, and how the protocol maintains strict capital accounting. The design ensures that every leveraged position has isolated debt, transparent settlement, and clearly defined financial responsibilities.

## **4.1 Introduction**

Introduces the Contract and Capital Layer as the financial core of SuperPumped, responsible for managing capital movement, borrow accounting, and settlement while ensuring that user funds, borrowed liquidity, and protocol assets remain isolated and accurately tracked.

## **4.2 LiquidVault**

Explains the ERC-4626 liquidity vault where Liquidity Providers (LPs) deposit capital. The vault supplies borrowable liquidity for leveraged positions, manages deposits and withdrawals, tracks asset utilization, and serves as the primary source of protocol lending capital.

## **4.3 LeverageVaultAdapter**

Describes the adapter contract that connects the vault to individual leveraged positions. It reserves borrowing capacity, issues capital for each position, records repayments, and ensures that debt remains isolated instead of being pooled across multiple traders.

## **4.4 LeverageEscrow**

Explains the escrow contract that manages every leveraged position throughout its lifecycle. It records position metadata, holds user margin, receives borrowed capital, coordinates funding of execution accounts, processes settlement, repays the vault first, distributes remaining user proceeds, and supports recovery of failed position openings.

## **4.5 LeverageConfig**

Describes the configuration contract that stores protocol parameters such as leverage limits, fee rates, liquidation thresholds, emergency pause controls, and other operator-defined risk management settings that govern the leverage system.

## **4.6 Capital Invariants**

Defines the core financial rules that the protocol must always enforce. These include maintaining isolated debt for every position, ensuring vault repayment before user payouts, explicitly recognizing bad debt when losses occur, and correctly distinguishing failed position openings from successfully executed trades.

## **4.7 Relation to Legacy Borrowing Components**

Explains that older borrowing modules remain in the repository for historical or compatibility purposes but are no longer part of the primary leverage architecture. The production system instead relies on the dedicated escrow-backed leverage framework described throughout the whitepaper.
