Smart Contracts

Locale Lending Architecture: Smart Contract System Overview

Locale Lending Architecture: Smart Contract System Overview

This document outlines the architecture of Locale Lending’s production system, highlighting how Arbitrum Stylus smart contracts interact with the Cartesi Rollup Framework, external data providers, and investor/borrower flows to enable automated, secure, and compliant decentralized lending. Refer to the attached diagram for a visual guide.

1. UniqueIdentity

The identity verification and compliance layer for both retail investors and borrowers.

  • Plaid APIs (KYC/AML): Handle identity validation and compliance checks during onboarding.

  • Soulbound NFT: Issued upon verification to signal identity compliance, enabling access to investor or borrower roles.


2. Senior Pool (Retail Investors)

The main liquidity pool for retail investor capital.

  • Staking: Investors deposit USDC into the pool and receive a yield-bearing token in return.

  • Leverage Strategy: Senior Pool capital is allocated to Loan Pools based on a fixed leverage model to optimize returns while managing risk.

  • Compliance: Access gated through UniqueIdentity verification.


3. Loan Pools (Institutional Investors)

Capital pools created by institutional investors to fund borrowers.

  • Smart Contracts: Manage disbursement, repayment, and interest adjustment logic.

  • Loan Health Logic: Powered by Cartesi, off-chain data is used to calculate Debt Service Ratios (DSR). Interest rates are automatically adjusted if the DSR falls below a 1.25x threshold.

  • Repayment Distribution: Borrowers repay directly to the pool; repayments are distributed to stakers in real time.


4. Cartesi Rollup Framework

The computational engine powering off-chain data processing and dynamic loan logic.

  • Cartesi Machine: Executes custom logic in a Linux VM for performance and flexibility.

  • Rollup Smart Contract: Connects the off-chain Cartesi logic to Arbitrum's Stylus smart contracts.

  • Rollup Node + Back-End: Executes loan logic in Python and queries SQLite for real-time borrower data.

  • SQLite Database: Stores encrypted borrower financial data retrieved via Plaid APIs.


5. Integration with External Data Providers

Secure, privacy-preserving data flow into the lending system.

  • Plaid APIs: Fetch borrower financial activity such as account balances and transaction history.

  • HTTPs Gateway: Encrypts sensitive data before being passed into the system.

  • Reclaim Protocol: Converts the raw data into zkProofs for zero-knowledge validation, preserving privacy while ensuring accuracy and compliance.


Locale Lending's architecture is designed to be a next-generation approach to DeFi and RWAs. One that fuses real-world financial data, off-chain computation, and on-chain programmability to deliver a fully automated, low-risk, and privacy-preserving on-chain lending system. By leveraging the power of off-chain computation, IoT devices and direct APIs, Locale Lending enables dynamic risk management, streamlined loan servicing, and transparent investor-borrower interactions at scale.

Last updated