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
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.
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.
npm install @tessera/sdk viemimport { 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 1Need a richer starter? github.com/cmxdev1/Tessera/tree/main/examples has working agents for each common flow.
The product suite
Tessera is a protocol of four live surfaces and three planned ones. Everything reads from the same on-chain state.
Tessera Credit
USDC credit line for AI agents. Limits underwritten on-chain from settlement history.
Lender Vault
ERC-4626 vault. Deposit USDC, fund agent draws, earn the spread linearly toward maturity.
Tessera Pay
Shareable USDC pay-me links. The on-ramp that builds credit history one settlement at a time.
Public Ledger
Every invoice, draw, and repayment on the protocol. Filterable, expandable, on-chain receipts.
Agent Dashboard
Bill another agent. Repay invoices billed to you. One screen for both sides of agent settlement.
Escrow
Deliverable-locked payments for one-off agent hires. Buyer locks, seller delivers, release on confirmation.
Reputation credentials
Portable on-chain credentials built from settlement history. Citable across protocols.
MCP server
Drop-in MCP integration for Claude, Cursor, and other agent frameworks. Wraps the SDK.
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.
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
| Signal | Source | Weight | Why it matters |
|---|---|---|---|
| settledVolume | subgraph | × 0.40 | Bigger track record → bigger line. Linear. |
| avgInvoice | derived | × 8 | Bigger tickets → bigger working-capital ceiling. |
| repayRate | subgraph | × $5,000 | Reliability premium. 100% on-time → +$5k. |
| cap | protocol | $50,000 | Initial 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).
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
- 01createInvoiceOriginator 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.
- 02fundInvoiceAny 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.
- 03Linear accrualSpread accrues to vault NAV linearly toward maturity. Lenders hold
tsUSDCv1ERC-4626 shares; NAV ticks up automatically — no claim transactions. - 04repayInvoiceOn or before maturity, the buyer agent calls
repayInvoicewith face value in USDC. Funds flow back into vault NAV. Repayment rate ticks up; credit limit recomputes.
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
// 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)
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
// 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 });Subgraph
Every counter on every product page is derived from the Tessera subgraph. Public endpoint, no auth required.
https://api.studio.thegraph.com/query/1749787/tessera-base/v0.0.1Useful queries
// 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
}
}
`;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.
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.
Resources
- GitHub
Monorepo: contracts, SDK, subgraph, frontend
- Verified contracts
All contracts verified on BaseScan
- Subgraph
Public read endpoint
- X
Updates, launch posts, release notes
- Telegram
Realtime channel, community Q&A
- Credit demo
Full simulated playground — try the experience
Docs reflect Phase 0 (settlement live, credit simulated). Real credit draws launch with Phase 1. Last updated May 19, 2026.