Yield Slippage and the Equimarginal Allocation of Capital Across Decentralized Lending Pools

· Okoro Adokiye

A static, single-period model for optimizing capital allocation across risk-free decentralized lending pools, accounting for yield slippage and token incentives through a marginal-yield framework. Protocol risk is introduced as a structural placeholder, with a full risk-aware treatment deferred to future work.

Abstract

This article investigates the optimization of capital distribution across Decentralized Lending Protocols (DLPs) to maximize aggregate portfolio yield. In decentralized finance, interest rates are endogenous functions of pool utilization; consequently, large capital injections dilute the effective interest rate—a phenomenon we term yield slippage.

We formalize a unified yield function that aggregates supply interest, token incentives (priced via a scalar μ\mu), and a structural risk parameter Ψ\Psi introduced to mark the conceptual location of protocol risk in the framework. The optimization itself is solved under the assumption of risk-free markets (Ψ=0\Psi = 0); a full risk-aware treatment is deferred to future work. By defining a Net Yield Function and applying a constrained optimization framework, we derive the equilibrium condition where the marginal yield is equalized across all active pools.

Introduction

The emergence of Decentralized Finance (DeFi) has reshaped capital markets by replacing traditional intermediaries with autonomous smart contracts. Central to this ecosystem are Decentralized Lending Protocols (DLPs), such as Aave and Compound, which employ algorithmic interest rate models to facilitate the lending and borrowing of cryptocurrency assets with no expiry duration.

Lenders who supply digital assets to these protocols are referred to as Liquidity Providers (LPs). Assets supplied by LPs are pooled together and can be borrowed by users who lock collateral. In traditional shared-pool models, multiple digital assets are accepted as collateral for a single loanable asset. Consequently, even with Over-Collateralized Debt Positions, LPs are exposed to cross-asset contagion, where the failure of a single volatile collateral asset can impact the entire liquidity pool.

To address this, newer protocols utilize isolated markets where each pool accepts only one specific asset as collateral. While this limits contagion risk, it leads to liquidity fragmentation. DLPs such as Morpho and Euler Finance solve this by layering vaults on top of isolated markets. In this system, Lenders deposit capital into a single vault, and professional risk strategists, known as Risk Curators, strategically deploy this capital across multiple pools to optimize yield while minimizing exposure to tail risks.

A key challenge for vault risk curators is the yield slippage effect. In DLPs, the Annual Percentage Yield (APY) of a pool is a direct function of pool utilization. When a large deposit increases the pool supply, utilization—defined as the ratio of borrowed capital to total supplied capital—mechanically falls, causing the effective interest rate to decline. Consequently, a naive strategy that chases the highest instantaneous APY can produce suboptimal returns when the deployed capital is large enough to materially dilute the pool’s yield dynamics.

This article develops a static, single-period model for capital allocation and rebalancing across lending pools. Our contributions are threefold:

  1. Unified Yield Framework: We formalize a comprehensive yield model that aggregates Supply Yield, Token Incentives (priced via a custom scalar μ\mu), and a placeholder for Protocol Risk (via a parameter Ψ\Psi). Risk is introduced structurally; the optimization is solved under risk-free markets, with a full risk-aware treatment left for future work.
  2. Marginal Yield Derivation: We define the Yield Slippage Effect and derive an explicit closed-form decomposition of the Marginal Yield Mi(xi)M_i(x_i) of a deposit. This decomposition quantifies the endogenous dilution of both interest rates and incentive rewards caused by large capital injections.
  3. Equimarginal Equilibrium: Under a Diminishing Marginal Returns assumption, we establish that the Karush–Kuhn–Tucker (KKT) conditions for the constrained maximization problem are both necessary and sufficient, and that the unique global optimum is characterized by equalization of the Marginal Yield across all active pools.

Pools

Pools create a lending and borrowing market for a Base Asset (e.g., USDC) within DLPs. For instance, distinct markets exist such as the Aave USDC pool and the Compound USDC pool across various blockchain networks. Lenders in a pool allocate capital of the base asset, while borrowers borrow this asset primarily by creating an Over-Collateralized Debt Position using another approved asset as collateral.

Interest accrues over time on the debt position. To redeem their collateral, the Borrower must repay the principal amount plus the accrued interest. A portion or the entirety of this repaid interest is then distributed to the Lenders proportional to their deposit size.

Incentivized Pools

Lending in certain pools is incentivized externally to attract capital. We denote these as Incentivized Pools. In such markets, specifically within DLPs like Compound, Lenders earn a secondary yield component in the form of an Incentive Asset (e.g., COMP), in addition to the standard interest accrued on the base asset. These rewards are typically distributed pro-rata based on the lender’s share of the total pool deposits.

Pool Risk

Participants in Decentralized Lending Protocols (DLPs) are exposed to distinct categories of structural and systemic risk. Following the standard industry classification of CryptoEQ, we organize these risks into three primary vectors:

Smart Contract Risk. This refers to the vulnerability of the protocol to software bugs, logic errors, or re-entrancy attacks. Despite rigorous auditing processes, the immutability of the blockchain means that exploited vulnerabilities often result in irreversible loss of funds.

Oracle Risk. Lending protocols rely on external data feeds (oracles) to determine asset prices and calculate account health. Oracle risk arises when these feeds provide inaccurate data—whether due to manipulation, latency, or compromised sources—potentially leading to unjust liquidations or bad debt accrual.

Governance Risk. Most DLPs are managed by Decentralized Autonomous Organizations (DAOs) which control critical parameters such as collateral factors and interest rate models. Governance risk encompasses the potential for malicious upgrades, capture of voting power, or mismanagement of risk parameters during periods of high market volatility.

These three vectors are aggregated into a single scalar Risk Parameter Ψ\Psi in the Yield Decomposition below. A formal mapping from the underlying risk channels to Ψ\Psi—and the dynamics that govern it—is left to future work.

Principal and Accrued Balance

Definition (Principal Balance). A Lender’s Principal Balance at time tt, denoted by AtA_t, is the capital basis upon which interest is calculated.

Definition (Accrued Balance). A Lender’s Accrued Balance at time tt, denoted by LtL_t, is the sum of the Principal Balance and the net value ΔAt\Delta A_t accrued over the interval [t0,t][t_0, t] (comprising interest, priced incentives, and risk cost; decomposed explicitly in the Yield Decomposition section):

LtAt+ΔAtL_t \coloneqq A_t + \Delta A_t

where t0t_0 denotes the time of the last Balance Realization event.

Definition (Balance Realization). Balance Realization is a discrete event at time tt where the Accrued Balance is converted into the new Principal Balance. This effectively resets the basis for future interest calculations (t0tt_0 \leftarrow t). Specifically, the updated Principal Balance AtA_{t} becomes:

AtLt=At+ΔAtA_{t} \leftarrow L_t = A_{t^-} + \Delta A_t

where AtA_{t^-} denotes the pre-realization principal (the left-limit of AA at tt).

Following this event, any interest calculation for a subsequent interval [t,t][t, t'] uses this updated basis.

Assumption (Principal Consistency Constraint). To preserve the integrity of the accrual basis, withdrawals are bounded by available principal. Any withdrawal WW at time tt either (i) is capped at the existing Principal Balance (WAtW \leq A_t), leaving the accrued component unrealized and the time basis t0t_0 unchanged; or (ii) is preceded by a Balance Realization (AtLtA_t \leftarrow L_t, t0tt_0 \leftarrow t), permitting withdrawal up to WLtW \leq L_t.

Pool Yield

Definition (Pool Yield). The Pool Yield, denoted YtY_t, represents the expected return per unit of principal balance over the interval [t,t+1][t, t+1]. It is defined as the conditional expected net earnings accrued by a lender, normalized by their capital basis:

YtEt[ΔAt+1At]AtY_t \coloneqq \frac{\mathbb{E}_{t} [ \Delta A_{t+1} \mid A_t ] }{A_t}

where AtA_t is the lender’s Principal Balance at time tt, and Et[ΔAt+1At]\mathbb{E}_t [ \Delta A_{t+1} \mid A_t ] denotes the expected net change in value due to interest, incentives, and risk factors.

Remark. The term Et[ΔAt+1At]\mathbb{E}_t [ \Delta A_{t+1} \mid A_t ] represents the Net Earnings. To avoid ambiguity, this expectation is calculated under the strict assumption of No External Flows (i.e., the lender does not deposit or withdraw additional capital during the interval [t,t+1][t, t+1]). Under this assumption, ΔAt+1\Delta A_{t+1} strictly quantifies the value generated by the protocol (interest + incentives − risk cost) rather than changes in user principal.

Yield Function

The Pool Yield YtY_t defined above is a snapshot quantity, evaluated at the lender’s current principal balance. To reason about discrete capital changes—the central object of this article—we promote it to a function of the injection size.

Definition (Yield Function). We define the Yield Function, denoted Y(x)Y(x), as the effective yield for a discrete capital injection xx to the principal balance AA at time tt:

Y(x)=Et[ΔAt+1A+x]A+xY(x) = \frac{\mathbb{E}_t [\Delta A_{t+1} \mid A + x] }{A + x}

Consequently, the expected earnings can be expressed as:

Et[ΔAt+1A+x]=Y(x)(A+x)\mathbb{E}_t [\Delta A_{t+1} \mid A + x] = Y(x) \cdot (A + x)

The snapshot Pool Yield is recovered as the special case Yt=Y(0)Y_t = Y(0), corresponding to no capital change.

Supply Yield

Definition (Supply Yield). The Supply Yield, denoted RtR_t, is defined as the interest accrued over the interval [t,t+1][t, t+1] per unit of Principal Balance. It represents the component of pool yield derived exclusively from borrower interest payments:

RtΔLt+1AtR_t \coloneqq \frac{\Delta L_{t+1}}{A_t}

where AtA_t is the lender’s Principal Balance at time tt, and ΔLt+1\Delta L_{t+1} denotes the interest accrued on that balance over [t,t+1][t, t+1].

Definition (Supply Yield Function). Analogously, the Supply Yield Function R(x)R(x) is defined as:

R(x)=ΔL(x)A+xR(x) = \frac{\Delta L(x)}{A + x}

where ΔL(x)\Delta L(x) denotes the effective interest accrued over [t,t+1][t, t+1] given the adjusted principal basis (A+x)(A + x).

Remark. Both Y(x)Y(x) and R(x)R(x) are strictly decreasing, positive-valued functions due to the Yield Slippage Effect defined below.

Definition (Yield Slippage Effect). The Yield Slippage Effect is the endogenous dilution of the per-unit yield with respect to capital injection: formally, the property that

Y(x)<0,R(x)<0,Y'(x) < 0, \qquad R'(x) < 0,

for all xx in the feasible region. It is the structural feature that distinguishes liquidity provision in algorithmically priced DLPs from the constant-rate idealization of traditional fixed-income allocation, and is the central inefficiency this article seeks to optimize against.

Example: The Aave/Compound Kinked Rate Model

To ground the abstract Supply Yield Function R(x)R(x) in a concrete protocol primitive, we instantiate it under the standard kinked utilization rate model used by Aave and Compound.

Let BB denote the total outstanding borrows in the pool (treated as fixed over the interval [t,t+1][t, t+1]), SS the total pool supply immediately preceding the injection (i.e., the sum of the lender’s existing principal AA and the balances of all other lenders), and U(0,1)U^{\ast} \in (0, 1) a target utilization, referred to as the kink. Following a capital change xx, the pool utilization becomes:

U(x)=BS+xU(x) = \frac{B}{S + x}

The borrow interest rate Rb(U)R_b(U) is piecewise linear in utilization:

Rb(U)={R0+UUs1,UUR0+s1+UU1Us2,U>UR_b(U) = \begin{cases} R_0 + \dfrac{U}{U^{\ast}}\, s_1, & U \leq U^{\ast} \\[2mm] R_0 + s_1 + \dfrac{U - U^{\ast}}{1 - U^{\ast}}\, s_2, & U > U^{\ast} \end{cases}

where R0R_0 is the base rate, s1s_1 the pre-kink slope, and s2s1s_2 \gg s_1 the post-kink “jump” slope designed to penalize illiquidity. The supply rate received by lenders, net of the protocol reserve factor rf[0,1)r_f \in [0, 1), is given by:

R(x)=(1rf)U(x)Rb ⁣(U(x))R(x) = (1 - r_f)\, U(x)\, R_b\!\bigl(U(x)\bigr)

Assumption (Single-Regime Operation). We assume that the magnitude of the capital change xx is bounded such that the resulting utilization U(x)U(x) remains within a single regime of the piecewise-linear borrow curve—that is, the operation does not cross the kink UU^{\ast}. This preserves the smoothness of R(x)R(x) and admits a closed-form Marginal Yield without invoking subgradient methods at UU^{\ast}.

Under this assumption, taking the pre-kink regime (UUU \leq U^{\ast}) for concreteness, R(x)R(x) admits the closed form:

R(x)=(1rf)[R0BS+x+s1B2U(S+x)2]R(x) = (1 - r_f)\left[ \frac{R_0\, B}{S + x} + \frac{s_1\, B^2}{U^{\ast}\,(S + x)^2} \right]

which is manifestly strictly decreasing in xx, recovering the Yield Slippage Effect from a microfounded protocol primitive. Should the pool operate in the post-kink regime (U>UU > U^{\ast}) for the duration of the interval, an analogous closed form is obtained by substituting the post-kink branch of Rb(U)R_b(U).

Incentive Function

Definition (Pool Incentive). For incentivized pools, we define the Pool Incentive at time tt, denoted KtK_t, as the quantity of the Incentive Asset earned per unit of Principal Balance over the interval [t,t+1][t, t+1]:

KtI(A,t)AK_t \coloneqq \frac{I(A, t)}{A}

where AA is the principal balance at time tt, and I(A,t)I(A, t) denotes the total quantity of incentive tokens accrued on that balance over the interval [t,t+1][t, t+1].

Assumption (Incentive Predictability). We assume the pool operates under a predictable incentive mechanism: for any given principal balance AA at time tt, the quantity of incentives I(A,t)I(A, t) to be received is a calculable function of the pool state at time tt.

Definition (Incentive Function). We define the Incentive Function, denoted K(x)K(x), as the effective incentive rate for a principal balance adjusted by a capital change xx:

K(x)=I(A+x,t)A+xK(x) = \frac{I(A+x, t)}{A + x}

Example: Pro-Rata Incentive Distribution

A common mechanism, exemplified by the COMP distribution on Compound, allocates a fixed pool-level reward rate ρ\rho (incentive tokens per unit time) to lenders pro-rata by share of total supply. Under this model, the quantity of incentive tokens accrued by a lender with principal A+xA + x over the interval [t,t+1][t, t+1] is:

I(A+x,t)=ρA+xS+xI(A + x, t) = \rho \cdot \frac{A + x}{S + x}

where SS is the total pool supply preceding the injection. Substituting into the definition of K(x)K(x) yields the closed form:

K(x)=ρS+xK(x) = \frac{\rho}{S + x}

which is manifestly strictly decreasing in xx, recovering an incentive-slippage effect structurally analogous to the supply-side yield slippage on R(x)R(x).

Remark. This completes the slippage picture introduced earlier: the Yield Slippage Effect extends to the incentive channel via K(x)<0K'(x) < 0, in symmetry with the supply-side slippage R(x)<0R'(x) < 0.

Incentive Pricing

Since the incentive asset is typically distinct from the base asset, rational allocation requires normalizing these rewards into a common numéraire. We introduce a pricing scalar μ\mu to perform this conversion.

Definition (Incentive Value Scalar). Let μ\mu be a scalar conversion factor representing the value of one unit of the Incentive Asset in terms of the Base Asset over the interval [t,t+1][t, t+1]. The total value of incentives received, denominated in the base asset, is given by:

Vincentive=μI(A+x,t)=μK(x)(A+x)V_{\text{incentive}} = \mu \cdot I(A+x, t) = \mu \cdot K(x) \cdot (A + x)

Remark. The scalar μ\mu represents an effective execution price for the accrued incentives. Relying solely on the spot price at time tt may be insufficient due to volatility during the accrual interval. In practice, μ\mu may represent a time-weighted average price (TWAP) or a hedged price secured via an external derivatives market.

Assumption (Incentive Price Exogeneity). We treat μ\mu as exogenous to the lender’s position size: the realized execution price of the incentive token is independent of the quantity I(A+x,t)I(A + x, t) that the lender must liquidate. This is a deliberate limitation. The framework captures endogenous dilution on both the supply rate (R(x)R(x)) and the incentive emission share (K(x)K(x)), but does not capture market-impact slippage from selling the accrued incentive token into its secondary market. For modest positions—where the accrued incentive quantity is small relative to the depth of the incentive token’s market—the assumption is innocuous. For vault-scale operations it may not be, and a position-dependent execution price μ(I)\mu(I) would be required. This extension is deferred to future work.

Yield Decomposition

The expected net earnings for a Principal Balance AA over the interval [t,t+1][t, t+1] is composed of two positive yield streams (Interest and Incentives) and one negative risk factor.

First, considering only the gross yield components:

Et[ΔAA]gross=ΔL(A)+μI(A,t)\mathbb{E}_t [ \Delta A \mid A ]_{\text{gross}} = \Delta L(A) + \mu \cdot I(A, t)

where ΔL(A)\Delta L(A) is the accrued interest and I(A,t)I(A,t) is the quantity of incentive tokens.

To account for protocol safety, we introduce a Risk Parameter Ψ\Psi, a non-negative scalar representing the expected loss per unit of capital over the interval (e.g., due to smart contract failure or bad debt). The Net Expected Earnings becomes:

Et[ΔAA]=ΔL(A)Interest+μI(A,t)IncentivesAΨRisk Cost\mathbb{E}_t [ \Delta A \mid A ] = \underbrace{\Delta L(A)}_{\text{Interest}} + \underbrace{\mu \cdot I(A, t)}_{\text{Incentives}} - \underbrace{A \cdot \Psi}_{\text{Risk Cost}}

Remark. The parameter Ψ\Psi serves as a rigorous measure of the “cost of safety.” For theoretical Risk-Free markets, Ψ=0\Psi = 0. For risky markets, Ψ>0\Psi > 0, effectively acting as a discount rate on the raw APY.

Remark (Notation: ΔA\Delta A vs ΔL\Delta L). It is important to distinguish the two accrual quantities used throughout this article. The increment ΔLt+1\Delta L_{t+1} denotes the interest component alone—the deterministic supply-yield contribution—while ΔAt+1\Delta A_{t+1} denotes the net value accrued, comprising interest, priced incentives, and risk cost. They are related by the identity

Et[ΔAA]=ΔL(A)+μI(A,t)AΨ.\mathbb{E}_t [\Delta A \mid A] = \Delta L(A) + \mu \cdot I(A, t) - A \cdot \Psi.

In the special case of risk-free, non-incentivized markets (Ψ=0\Psi = 0, μI=0\mu \cdot I = 0), the two quantities coincide.

The Decomposed Yield Function

Substituting the definitions of the Supply Yield Function R(x)R(x) and Incentive Function K(x)K(x) into the expectation above, we derive the general form of the Yield Function Y(x)Y(x) for any capital injection xx:

Y(x)=R(x)+μK(x)ΨY(x) = R(x) + \mu \cdot K(x) - \Psi

Proof. By definition, (A+x)Y(x)=Et[ΔAA+x](A + x) \cdot Y(x) = \mathbb{E}_t [ \Delta A \mid A+x ]. Expanding the terms:

(A+x)Y(x)=ΔL(A+x)+μI(A+x,t)(A+x)Ψ=(A+x)R(x)+(A+x)μK(x)(A+x)Ψ\begin{aligned} (A + x)Y(x) &= \Delta L(A+x) + \mu \cdot I(A+x, t) - (A+x)\Psi \\ &= (A+x)R(x) + (A+x)\mu K(x) - (A+x)\Psi \end{aligned}

Dividing both sides by (A+x)(A+x), we obtain:

Y(x)=R(x)+μK(x)ΨY(x) = R(x) + \mu \cdot K(x) - \Psi \qquad \blacksquare

Net Yield for Multiple Pool Allocation

Having decomposed the single-pool yield function as Y(x)=R(x)+μK(x)ΨY(x) = R(x) + \mu K(x) - \Psi, we now lift the construction to a portfolio. By analogous construction, each pool ii admits a Supply Yield Function Ri(xi)R_i(x_i), an Incentive Function Ki(xi)K_i(x_i), and a risk parameter Ψi\Psi_i. Because pools may distribute distinct incentive tokens (e.g., COMP from Compound, MORPHO from Morpho), each carries a corresponding incentive price μi\mu_i denominated in the base asset. The pool-level Yield Function is

Yi(xi)=Ri(xi)+μiKi(xi)Ψi.Y_i(x_i) = R_i(x_i) + \mu_i \cdot K_i(x_i) - \Psi_i.

Consider a portfolio with capital allocation A=(A1,A2,,An)\mathbf{A} = (A_1, A_2, \dots, A_n) across nn pools denominated in the same base asset at time tt. Let Et[ΔAiAi]\mathbb{E}_t [ \Delta A_i \mid A_i] denote the expected earnings for the ii-th pool over the interval [t,t+1][t, t+1].

The Net Yield of the portfolio, denoted YnetY_{\text{net}}, is the weighted average of the individual pool yields:

Ynet=i=1nEt[ΔAiAi]i=1nAiY_{\text{net}} = \frac{ \sum_{i=1}^{n} \mathbb{E}_{t} [ \Delta A_i \mid A_i]}{\sum_{i=1}^{n}A_i}

Definition (Net Yield Function). Suppose a total capital amount WW of the base asset is distributed across the pools via a vector of capital changes x=(x1,x2,,xn)\mathbf{x} = (x_1, x_2, \dots, x_n) such that i=1nxi=W\sum_{i=1}^n x_i = W. We define the Net Yield Function, denoted Ft(x)F_t(\mathbf{x}), as the effective yield of the portfolio immediately following these discrete changes:

Ft(x)=i=1nEt[ΔAiAi+xi]i=1n(Ai+xi)F_t(\mathbf{x}) = \frac{ \sum_{i=1}^{n} \mathbb{E}_t [ \Delta A_i \mid A_i + x_i]}{\sum_{i=1}^{n} (A_i+ x_i)}

This function evaluates the portfolio efficiency for any specific distribution x\mathbf{x} of the total capital WW. The pre-injection Net Yield is recovered as the special case Ynet=Ft(0)Y_{\text{net}} = F_t(\mathbf{0}).

Remark (Equivalence with Total Earnings). Under the Budget Constraint ixi=W\sum_i x_i = W, the denominator of FtF_t collapses to a constant independent of the specific allocation:

i=1n(Ai+xi)=i=1nAi+W.\sum_{i=1}^{n}(A_i + x_i) = \sum_{i=1}^{n} A_i + W.

Consequently, the rate-form objective Ft(x)F_t(\mathbf{x}) and the Total Expected Earnings E(x)iEt[ΔAiAi+xi]\mathcal{E}(\mathbf{x}) \coloneqq \sum_i \mathbb{E}_t [\Delta A_i \mid A_i + x_i] share the same argmax:

argmaxxFt(x)=argmaxxE(x).\arg\max_{\mathbf{x}} F_t(\mathbf{x}) = \arg\max_{\mathbf{x}} \mathcal{E}(\mathbf{x}).

In the optimization that follows we work with E\mathcal{E} for analytic convenience; all results carry over verbatim to the rate-form objective FtF_t.

Generalized Optimal Capital Allocation

Assumption (Risk-Free Markets). For the remainder of this article we restrict attention to risk-free pools, formally Ψi=0\Psi_i = 0 for all ii. The risk parameter Ψ\Psi is retained as a structural placeholder in the decomposition of Y(x)Y(x) to mark the conceptual location of protocol risk in the framework. Modeling the functional form and dynamics of Ψ\Psi—including its interaction with utilization, leverage cycles, and inter-pool contagion—is non-trivial and is left to future work.

Assumption (Frictionless Rebalancing). We abstract from the on-chain transaction costs of executing the allocation x\mathbf{x}—gas fees, MEV exposure, and any base-asset swap slippage incurred on entry or exit. Real-world implementations will require a no-trade band around the equimarginal equilibrium to suppress rebalances whose expected gain is dominated by the cost of the transaction. We defer this extension to future work.

We generalize the optimization problem by defining WW as the Net Portfolio Capital Change. This allows us to model capital injections (W>0W > 0), neutral rebalancing (W=0W = 0), and withdrawals (W<0W < 0) using a single unified framework.

The objective is to find the vector of individual allocations x=(x1,,xn)\mathbf{x} = (x_1, \dots, x_n) that maximizes the Total Expected Earnings of the final portfolio state. Under the Risk-Free Markets assumption, the objective function is:

Maximize E(x)=i=1n(Ai+xi)[Ri(xi)+μiKi(xi)]\text{Maximize } \mathcal{E}(\mathbf{x}) = \sum_{i=1}^{n} (A_i + x_i)\left[ R_i(x_i) + \mu_i \cdot K_i(x_i) \right]

Constraints and Modes

The problem is subject to two primary constraints:

  1. Budget Constraint: The sum of individual changes must equal the net capital change. g(x)=Wi=1nxi=0g(\mathbf{x}) = W - \sum_{i=1}^{n}x_i = 0
  2. Solvency Constraint: No pool can have a negative balance. xiAiix_i \geq -A_i \quad \forall i

Based on the value of WW, the optimization naturally adapts to three distinct modes:

  • Capital Injection (W>0W > 0): New capital enters the portfolio. The solver distributes WW to pools with the highest Marginal Yields, potentially pulling capital from lower-performing pools (xj<0x_j < 0) to boost best performers (Hybrid Injection/Rebalancing).
  • Pure Rebalancing (W=0W = 0): No external capital is added. The solver moves capital from low-marginal-yield pools (xj<0x_j < 0) to high-marginal-yield pools (xi>0x_i > 0) until equilibrium is reached.
  • Capital Withdrawal (W<0W < 0): Capital leaves the portfolio. The solver removes liquidity from pools with the lowest Marginal Yields first to minimize the loss of total earnings.

Optimization Framework (KKT Conditions)

To rigorously maximize the objective function E(x)\mathcal{E}(\mathbf{x}) subject to both the budget equality constraint and the solvency inequality constraints, we employ the Karush-Kuhn-Tucker (KKT) conditions.

Problem Formulation:

MaximizeE(x)=i=1n(Ai+xi)[Ri(xi)+μiKi(xi)]Subject toWi=1nxi=0(Budget Constraint)Ai+xi0i(Solvency Constraints)\begin{aligned} \text{Maximize} \quad & \mathcal{E}(\mathbf{x}) = \sum_{i=1}^{n} (A_i + x_i)\left[ R_i(x_i) + \mu_i K_i(x_i) \right] \\ \text{Subject to} \quad & W - \sum_{i=1}^{n}x_i = 0 \quad (\text{Budget Constraint}) \\ & A_i + x_i \geq 0 \quad \forall i \quad (\text{Solvency Constraints}) \end{aligned}

We define the generalized Lagrangian L\mathcal{L} with multiplier λ\lambda for the budget constraint and a vector of multipliers γ=(γ1,,γn)\boldsymbol{\gamma} = (\gamma_1, \dots, \gamma_n) for the solvency constraints:

L(x,λ,γ)=E(x)+λ(Wi=1nxi)+i=1nγi(Ai+xi)\mathcal{L}(\mathbf{x}, \lambda, \boldsymbol{\gamma}) = \mathcal{E}(\mathbf{x}) + \lambda \left( W - \sum_{i=1}^{n}x_i \right) + \sum_{i=1}^{n} \gamma_i (A_i + x_i)

KKT Necessary Conditions

The necessary conditions for optimality are:

  1. Stationarity: Lxi=Exiλ+γi=0    Exi=λγi\frac{\partial \mathcal{L}}{\partial x_i} = \frac{\partial \mathcal{E}}{\partial x_i} - \lambda + \gamma_i = 0 \implies \frac{\partial \mathcal{E}}{\partial x_i} = \lambda - \gamma_i
  2. Primal Feasibility: W=xiandAi+xi0W = \sum x_i \quad \text{and} \quad A_i + x_i \geq 0
  3. Dual Feasibility: γi0\gamma_i \geq 0
  4. Complementary Slackness: γi(Ai+xi)=0\gamma_i (A_i + x_i) = 0

Derivation of Marginal Yield

We define the term Exi\frac{\partial \mathcal{E}}{\partial x_i} as the Marginal Yield Mi(xi)M_i(x_i). By applying the product rule to the earnings term (Ai+xi)Yi(xi)(A_i + x_i)Y_i(x_i), we explicitly derive:

Mi(xi)=xi[(Ai+xi)Yi(xi)]=Yi(xi)+(Ai+xi)Yi(xi)=Ri(xi)+μiKi(xi)Current Yield+(Ai+xi)[Ri(xi)+μiKi(xi)]Yield Slippage\begin{aligned} M_i(x_i) &= \frac{\partial}{\partial x_i} \left[ (A_i + x_i) Y_i(x_i) \right] \\ &= Y_i(x_i) + (A_i + x_i) Y'_i(x_i) \\ &= \underbrace{R_i(x_i) + \mu_i K_i(x_i)}_{\text{Current Yield}} + \underbrace{(A_i + x_i) \left[ R'_i(x_i) + \mu_i K'_i(x_i) \right]}_{\text{Yield Slippage}} \end{aligned}

Diminishing Marginal Returns

The KKT conditions above are necessary for stationarity. To ensure that a stationary point is a global maximum, we impose the following structural assumption.

Assumption (Diminishing Marginal Returns). For each pool ii, the per-pool earnings function Ei(xi)(Ai+xi)Yi(xi)E_i(x_i) \coloneqq (A_i + x_i)\, Y_i(x_i) is strictly concave on the feasible region. Equivalently, the Marginal Yield is strictly decreasing in xix_i:

Mi(xi)<0i,xi[Ai,)M'_i(x_i) < 0 \quad \forall i, \, \forall x_i \in [-A_i, \infty)

Remark. This assumption is the central structural requirement of the framework. It captures the economic intuition that each additional unit of capital is less productive than the last, and it can be verified directly for the kinked rate model introduced previously, provided the lender’s existing principal AiA_i is small relative to the total pool supply SiS_i—the typical regime of operation for an individual liquidity provider. Under this assumption, the aggregate objective E(x)\mathcal{E}(\mathbf{x}) is a sum of concave functions, the KKT conditions are both necessary and sufficient, and the equimarginal condition Mi(xi)=λM_i(x_i) = \lambda identifies the unique global optimum.

Interpretation: The Threshold Logic

The KKT conditions reveal two distinct regimes for optimal allocation:

  • Regime 1: Active Pools (Interior Solutions). For any pool ii that maintains a positive balance (Ai+xi>0A_i + x_i > 0), the Complementary Slackness condition requires γi=0\gamma_i = 0. Substituting this into the Stationarity condition yields:

    Mi(xi)=λM_i(x_i) = \lambda

    Conclusion: All active pools must share an identical Marginal Yield equal to the portfolio shadow price λ\lambda.

  • Regime 2: Empty Pools (Corner Solutions). For any pool jj that is fully drained (Aj+xj=0A_j + x_j = 0), the constraint is active, allowing γj0\gamma_j \geq 0. This implies:

    Mj(xj)=λγj    Mj(Aj)λM_j(x_j) = \lambda - \gamma_j \implies M_j(-A_j) \leq \lambda

    Conclusion: A pool is emptied if and only if its maximum possible marginal yield (at zero balance) is strictly less than or equal to the portfolio equilibrium λ\lambda. Effectively, it is “too expensive” to keep active.

Remark. This result formally validates the “Water-Filling” heuristic: Capital flows into the highest-yield pools first, filling them until their marginal yield dilutes to match the next best pool. Pools with yield curves strictly below the equilibrium threshold λ\lambda receive zero allocation.

Conclusion

This article presented a static, single-period framework for optimizing liquidity distribution in decentralized lending markets. We identified yield slippage—the endogenous decay of interest rates caused by capital injection—as the primary inefficiency facing large-scale liquidity providers.

By deriving the Marginal Yield under the assumption of risk-free markets, we proved that the optimal portfolio state satisfies the Equimarginal Principle, where the marginal utility of the last unit of capital is identical across all active pools. Under the Diminishing Marginal Returns assumption, this characterization is both necessary and sufficient, identifying a unique global optimum.

For the vault risk curator introduced at the outset, this delivers a precise prescription: hold each active pool’s marginal yield at a common shadow price λ\lambda, and drain any pool whose maximum attainable marginal yield falls below it. The naive “chase the highest APY” heuristic is thereby replaced by a principled, slippage-aware allocation rule.

← All articles