Tessera
Try the demo
[D0]Docs · Base Mainnet

Build credit for AI agents on Base.

Tessera is a USDC credit protocol for AI agents. Settlement history goes in, programmable credit lines come out. This page is the engineering surface: how the underwriter scores agents, how to integrate the SDK, and how every product on the platform fits together.

Live on Base mainnet · v0.0.1 SDK · subgraph synced

Verified on BaseScan·0x4ead…cd52
[01]

What is Tessera

Tessera is the first credit card built for AI agents. At its core it’s a USDC line of credit on Base, with limits underwritten on-chain from the agent’s settlement history. Your agent settles invoices through the protocol, that history becomes its credit file, and the limit it can draw against scales with the volume and reliability of its settled work.

The protocol is permissionless on the borrower side — the underwriter is the chain. No KYB, no application, no human in the loop. Default and the limit tightens; pay back on time and it grows. All visible on-chain.

Tessera Credit is currently a simulated demo at /demo — try it to feel exactly how it’ll work the day it ships. The surrounding products (vault, pay-me, agent dashboard, public ledger) are in development and unlock product-by-product after the credit launch.
[02]

Quickstart

Three lines of config gets you on the rails. The SDK ships with all addresses, subgraph URL, and link generators preset for Base mainnet.

install.shbash
npm install @tessera/sdk viem
agent.tstypescript
import { Tessera, TESSERA_BASE_MAINNET } from "@tessera/sdk";
import { createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";

const wallet = createWalletClient({
  account: privateKeyToAccount(process.env.AGENT_PK as `0x${string}`),
  chain: base,
  transport: http(),
});

const tessera = new Tessera({
  ...TESSERA_BASE_MAINNET,
  walletClient: wallet,
});

// Read your agent's current credit picture
const profile = await tessera.getAgentProfile(wallet.account.address);
console.log("Lifetime settled:", profile.settledVolume);
console.log("Repayment rate:",  profile.repayRate);
console.log("Computed limit:",  profile.creditLimit);   // Phase 1

Need a richer starter? github.com/cmxdev1/Tessera/tree/main/examples has working agents for each common flow.

[03]

The product suite

Tessera is a protocol of four live surfaces and three planned ones. Everything reads from the same on-chain state.

Live · Phase 0

Tessera Credit

USDC credit line for AI agents. Limits underwritten on-chain from settlement history.

Try the demo
Building

Lender Vault

ERC-4626 vault. Deposit USDC, fund agent draws, earn the spread linearly toward maturity.

Building

Tessera Pay

Shareable USDC pay-me links. The on-ramp that builds credit history one settlement at a time.

Building

Public Ledger

Every invoice, draw, and repayment on the protocol. Filterable, expandable, on-chain receipts.

Building

Agent Dashboard

Bill another agent. Repay invoices billed to you. One screen for both sides of agent settlement.

Phase 1

Escrow

Deliverable-locked payments for one-off agent hires. Buyer locks, seller delivers, release on confirmation.

Phase 1

Reputation credentials

Portable on-chain credentials built from settlement history. Citable across protocols.

Phase 2

MCP server

Drop-in MCP integration for Claude, Cursor, and other agent frameworks. Wraps the SDK.

[04]

Credit underwriting

Limits are computed from on-chain inputs only. No human in the loop, no application, no quarterly review. The formula is public and runs against the Tessera settlement subgraph. Limits update as new invoices settle.

underwriter.tstypescript
function computeCreditLimit(profile: AgentProfile): number {
  const { settledVolume, avgInvoice, repayRate } = profile;

  const raw =
    settledVolume * 0.40 +       // 40% of lifetime volume
    avgInvoice    * 8    +       // 8x the average ticket
    repayRate     * 5_000;       // up to $5k for perfect repayment

  return Math.min(50_000, raw);  // $50k initial cap
}

Signal weights — what the underwriter actually reads

SignalSourceWeightWhy it matters
settledVolumesubgraph× 0.40Bigger track record → bigger line. Linear.
avgInvoicederived× 8Bigger tickets → bigger working-capital ceiling.
repayRatesubgraph× $5,000Reliability premium. 100% on-time → +$5k.
capprotocol$50,000Initial ceiling, lifts as vault TVL and underwriting data deepen.

What happens when an agent defaults

A missed repayment is recorded on-chain and permanently dents the agent’s repayment rate — the same number the underwriter reads for every future draw. Lenders take the principal loss (no insurance pool in v0). Default events are public on the protocol ledger and shown on the agent’s profile page (both surfaces unlock in a future phase).

[05]

Settlement protocol

The substrate beneath the credit product. Three primitives feed the same on-chain state: invoice (retainer / project work), escrow (deliverable-locked one-offs, Phase 1), and reputation (the credential you build by using either).

Invoice lifecycle

  1. 01createInvoice
    Originator calls the SDK with the buyer’s address, face value in USDC, maturity timestamp, and discount in basis points. An invoice record mints on-chain.
  2. 02fundInvoice
    Any lender in the vault can fund the invoice in a single transaction. The discounted advance (e.g. 97% of face at 3% discount) flows directly to the originator’s wallet.
  3. 03Linear accrual
    Spread accrues to vault NAV linearly toward maturity. Lenders hold tsUSDCv1 ERC-4626 shares; NAV ticks up automatically — no claim transactions.
  4. 04repayInvoice
    On or before maturity, the buyer agent calls repayInvoice with face value in USDC. Funds flow back into vault NAV. Repayment rate ticks up; credit limit recomputes.
[06]

SDK reference

@tessera/sdk is a TypeScript client for any Node.js or Edge runtime. Accepts any viem WalletClient — bring your own signer.

On-chain writes

writes.tstypescript
// Originator side
await tessera.createInvoice({
  buyer: "0x…",
  faceValueUsdc: 1000n * 10n ** 6n,
  maturityUnix: Math.floor(Date.now() / 1000) + 14 * 86400,
  discountBps: 300,                        // 3%
});

// Buyer side
await tessera.repayInvoice(invoiceId);

// Vault side
await tessera.deposit(amountUsdc);
await tessera.redeem(shares);

// Phase 1: credit-line operations (simulated today)
await tessera.drawCredit(amountUsdc);
await tessera.repayCredit(amountUsdc);

Reads (subgraph)

reads.tstypescript
const profile = await tessera.getAgentProfile(address);
// { settledVolume, avgInvoice, repayRate, monthsOnBase,
//   settledInvoices, computedCreditLimit }

const score = await tessera.getReputationScore(address);
// 0..100, weighted blend of repayRate, age, volume

const recent = await tessera.recentInvoices({
  agent: address,
  limit: 25,
});

Helpers

helpers.tstypescript
// Link generators (use anywhere, no wallet needed)
tessera.getPayLink(invoiceId);             // /pay/<id>
tessera.getProfileLink(address);           // /a/<address>
tessera.getPayMeLink(address);             // /pay-me/<address>

// Async wait helpers — for agent automation
await tessera.waitForFunded(invoiceId,  { timeoutMs: 60_000 });
await tessera.waitForRepaid(invoiceId,  { timeoutMs: 60_000 });
await tessera.waitForDraw(drawId,       { timeoutMs: 60_000 });
[07]

Subgraph

Every counter on every product page is derived from the Tessera subgraph. Public endpoint, no auth required.

endpoint.shbash
https://api.studio.thegraph.com/query/1749787/tessera-base/v0.0.1

Useful queries

queries.tstypescript
// Lifetime profile for a single agent
const QUERY_AGENT_PROFILE = `
  query AgentProfile($id: ID!) {
    agent(id: $id) {
      id
      settledInvoiceCount
      settledVolume
      repayedOnTime
      repayedLate
      defaulted
      firstInvoiceAt
    }
  }
`;

// Recent invoices, paginated
const QUERY_RECENT_INVOICES = `
  query Recent($limit: Int!, $skip: Int!) {
    invoices(
      first: $limit, skip: $skip,
      orderBy: createdAt, orderDirection: desc
    ) {
      id  faceValueUsdc  status
      originator { id }  buyer { id }
      createdAt  maturityAt  repaidAt
    }
  }
`;
[08]

Vault mechanics

The lender side. Capital flows from depositors into approved agent draws and invoices; spread accrues back to depositor share NAV.

  • ERC-4626 standard. Share token is tsUSDCv1. Deposit USDC, receive shares; redeem shares, get USDC back at current NAV.
  • Linear accrual. No claim transactions. NAV ticks up automatically as funded paper accrues toward maturity.
  • Withdrawal queue. If liquidity is fully deployed, redemption requests sit in an FIFO queue and clear as positions mature. No lockup — queue is the backstop, not a fixed term.
  • Manual underwriting (v0). Each invoice is approved by the protocol operator (a Gnosis Safe on Base) before lenders can fund it. Programmatic underwriting based on the formula above is a Phase 1 contract upgrade.
  • 25-30% target APY. Reflects the rate the market needs to clear at while the protocol is new and lenders are taking real risk on novel agent counterparties. Expect normalization toward 15-20% as repayment data accumulates.
[09]

Roadmap

  • Phase 0 · live

    Simulated credit demo

    The credit playground is live at /demo so you can preview the full experience. Surrounding products (vault, pay-me, agent dashboard, public ledger) are parked in 'Building' status and unlock product-by-product.

  • Phase 1

    Real credit draws + programmatic underwriting

    drawCredit / repayCredit on a live contract. The formula above replaces manual underwriting for sub-cap draws. Escrow product ships.

  • Phase 1.2

    Multi-tenor pools + reputation credentials

    Separate vault pools by tenor (7/14/30/60 day) so lenders can pick duration risk. Portable reputation credential surfaces as a standalone primitive.

  • Phase 2

    MCP + the broader integration surface

    Native MCP server for Claude / Cursor / etc. Multi-chain expansion if the unit economics hold. Insurance vault as a separate yield product.