March 18, 2026

ZK-Proven Lending Incentives: Bringing Borrower and LP Intelligence onchain

Transform lending protocols from TVL-focused rewards to intelligent, protocol health-based incentives that automatically recognize borrower quality and capital commitment through onchain monitoring

Space and Time Foundation

The Space and Time Foundation is an independent organization dedicated to the advancement and adoption of Space and Time.

DeFi lending protocols have a problem that most project teams are aware of yet few have solved: that in some ways, their incentive programs actively work against the health of the protocol.

TVL-based rewards attract capital that is explicitly looking for the best short-term yield. That capital parks itself in your protocol, inflates your headline numbers, and leaves the moment a competitor offers another fifty basis points. Meanwhile, the borrower who has maintained a healthy collateral ratio for eighteen months, never triggered a liquidation, and generated consistent protocol revenue gets the same reward rate as someone borrowing at the edge of their liquidation threshold. The protocol subsidizes the incentive farmer and the genuine contributor equally, despite the fact that one of them is a liability and the other generates real value.

This isn't a product design failure. The teams building these protocols know what good borrower behavior looks like; the problem is that smart contracts cannot properly evaluate it. Under current models, a contract can against data that exists onchain at the moment it runs, and nothing more. Collateralization history, repayment patterns, behavior during the last three volatility events, cross-pool contribution over six months: none of this is computable inside a contract. The only workaround to date has been to run the analysis offchain and push results into the protocol through a trusted intermediary, which comes with two integral downsides: users have no way to verify the criteria were applied correctly or at all, and the trustless guarantee that makes onchain systems valuable in the first place is sacrificed. 

Space and Time's Proof of SQL gives lending protocols a new and superior option.

The Mechanism: Verifiable offchain Computation

Proof of SQL is a zero-knowledge proof system built specifically for SQL query execution against indexed blockchain data. The setup is straightforward. Space and Time ingests your lending protocol's onchain activity and makes it queryable: every borrow and repayment, every collateral deposit and withdrawal, every liquidation trigger, every LP position change across every pool. You write SQL queries against that data. Those queries can be as computationally complex as the analysis requires, because they run offchain.

What makes this different from simply trusting an offchain data feed is what happens to the query result. Proof of SQL generates a cryptographic proof that the query ran correctly against the exact data it claims to have used. Your reward contract receives that result and its proof, verifies the proof onchain, and acts on the result. No outside intermediary needs to vouch for the data; the proof itself assures the integrity of the query.

Proof of SQL closes the critical gap between what lending protocols need to do and what their smart contracts can currently execute.

What Becomes Possible

Borrower health scoring. You can define what responsible borrowing looks like in SQL: collateral ratios maintained above a threshold over a rolling window, no liquidation events in the past year, repayment behavior within a certain number of blocks of due date, and so on. The query computes a numerical score for each borrower based on their actual on-chain behavior, such as collateralization ratio over time, repayment consistency, position size, and liquidation history. The contract receives that score with a proof it was calculated correctly, and it distributes rewards accordingly. Borrowers who strengthen the protocol get more. Borrowers who strain it get less. This distinction has been impossible to enforce onchain until now.

Commitment-weighted LP rewards. Time in the pool matters, but it matters differently depending on when and under what conditions. An LP who added liquidity three days before a major market dislocation and continued to maintain that liquidity through it is providing far superior value to one who deposited during a quiet period and withdrew at the first sign of volatility. SQL lets you encode that difference with precision: time-weighted positions, stress-period presence, withdrawal behavior relative to market events. The result is a commitment score that reflects actual behavior rather than current balance.

Cross-pool contribution. Users who provide liquidity across multiple pools, or who borrow responsibly across asset classes, contribute to protocol-wide health in ways that single-pool metrics miss entirely. Calculating this kind of aggregate contribution requires joining data across contracts and time periods. It's a routine SQL operation. But it's something a smart contract can’t do on its own.

How the System is Structured for Onchain Lending Incentives

The architecture has three layers that handle distinct responsibilities.

The indexing layer ingests your protocol's onchain activity and makes it queryable. You configure this by selecting the contracts and event types you want monitored, e.g., lending pools, collateral contracts, interest rate models, liquidation mechanisms. The indexer normalizes data across pools and handles the ongoing work of tracking activity as it happens.

The query layer is where your protocol's definition of quality lives. You write SQL that encodes borrower health criteria, LP commitment logic, or risk-adjusted contribution calculations, for example. Proof of SQL runs those queries and produces results with cryptographic proofs attached. The sophistication of your incentive program is limited solely by what you can express in SQL.

The contract layer receives query results alongside their proofs, verifies onchain that the computation happened as specified, and executes reward distribution. Because verification is onchain, any participant can confirm that the criteria were applied correctly. There is no offchain administrator whose judgment users need to accept.

Three Steps to Deploy Intelligent Onchain Lending Incentives

Implementing health-based lending incentives using Space and Time requires only three simple steps that transform static TVL rewards into intelligent, protocol-optimized onchain systems:

Step 1: Index the Right Onchain Data with Ease

First, you select the contracts and events to index through the Space and Time Studio: your lending pools, collateral contracts, borrow and repayment events, liquidation triggers, LP position changes, and so on. The indexer begins tracking from that point forward, and it can backfill historical data for queries that require it.

Step 2: Configure the Onchain Smart Contract Logic

Second, you configure the reward contract with two components: the SQL query that calculates borrower quality and LP commitment scores, and the reward logic that translates those scores into distribution amounts and schedules. The query is where your protocol's incentive philosophy gets expressed. The contract logic is where it gets enforced.

Step 3: Deploy and Activate Onchain Health Intelligence

Third, you deploy. The contract connects to Space and Time's query infrastructure and begins operating. Rewards are distributed based on verified behavioral analysis. The system adapts as participant behavior and market conditions change, without manual parameter updates.

For complete technical details on implementing onchain Proof of SQL smart contracts, including code examples and deployment guides, see the full onchain deployment documentation.

The Lending-Specific Case for Getting This Right

Every DeFi protocol benefits from better incentive design, but lending protocols have more at stake than most. At a DEX, low-quality liquidity provision leads to worse execution and thinner order books. In a lending protocol, low-quality borrowing creates bad debt. The stakes differ not only in kind, but also in degree. 

Protocols that can build genuine feedback loops between participant behavior and reward outcomes will attract better borrowers, better retain committed LPs, and run healthier books. Those that stay on TVL-based rewards will keep winning the mercenary capital race and losing the one that matters. The infrastructure to build something better now exists. 

Get in touch→

About Space and Time:
Space and Time provides the onchain intelligence infrastructure that enables sophisticated, health-based lending incentive systems. Our Proof of SQL technology helps lending protocols build intelligent reward programs that continuously optimize for protocol health while automatically recognizing genuine borrower quality and LP commitment.

Space and Time Foundation

The Space and Time Foundation is an independent organization dedicated to the advancement and adoption of Space and Time.