Getting Started
Clicks Protocol is an on-chain yield layer for AI agents on Base. Your agent deposits USDC, and the protocol automatically splits it: 80% stays liquid, 20% earns yield.
Quick Start
Three lines to start earning yield:
import { ClicksClient } from '@clicks-protocol/sdk'
import { ethers } from 'ethers'
const provider = new ethers.JsonRpcProvider('https://mainnet.base.org')
const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)
const clicks = new ClicksClient(signer)
// Register agent + set split + deposit in one call
await clicks.quickStart('5000', agentAddress)
Installation
npm install @clicks-protocol/sdk
Requirements: Node.js 18+, ethers.js v6.
For MCP-compatible agents:
npm install @clicks-protocol/mcp-server
ClicksClient
new ClicksClient(signerOrProvider, options?)
| Parameter | Type | Description |
|---|---|---|
signerOrProvider | Signer | Provider | ethers v6 Signer (write) or Provider (read-only) |
options.chainId | number | Chain ID. Default: 8453 (Base Mainnet) |
options.addresses | Partial<ClicksAddresses> | Override contract addresses |
Write Methods
All write methods require a Signer.
registerAgent(agentAddress)
Register an AI agent. The caller becomes the operator.
receivePayment(amount, agentAddress)
Deposit USDC. Automatically splits based on the agent's yield percentage (default 20%).
withdrawYield(agentAddress)
Withdraw accumulated yield + the yield portion of principal.
setYieldPct(agentAddress, pct)
Adjust the yield split (0-50%). Default is 20%.
approveUSDC(amount)
Approve USDC spending. Pass 'max' for unlimited approval.
quickStart(amount, agentAddress) Recommended
One function that does three things: register agent (if needed), set yield split, and deposit. Idempotent.
await clicks.quickStart('1000', agentAddress)
// Registers agent if not registered
// Sets 20% yield split
// Deposits 1000 USDC (800 liquid, 200 yield)
Read Methods
Work with both Signer and Provider.
getAgentInfo(agentAddress)
Returns registration status, operator, yield percentage.
getYieldInfo(agentAddress)
Returns accumulated yield, principal in yield pool, current APY estimate.
simulateSplit(amount, agentAddress)
Preview how a deposit would be split without making a transaction.
MCP Server Setup
npm install @clicks-protocol/mcp-server
Add to your MCP client config:
{
"mcpServers": {
"clicks": {
"command": "npx",
"args": ["@clicks-protocol/mcp-server"],
"env": {
"PRIVATE_KEY": "your-private-key",
"RPC_URL": "https://mainnet.base.org"
}
}
}
}
MCP Tools
| Tool | Type | Description |
|---|---|---|
clicks_quick_start | Write | Register + deposit in one call |
clicks_receive_payment | Write | Deposit USDC with auto-split |
clicks_withdraw_yield | Write | Withdraw yield + principal |
clicks_register_agent | Write | Register an agent |
clicks_set_yield_pct | Write | Adjust yield percentage |
clicks_get_agent_info | Read | Agent registration info |
clicks_get_yield_info | Read | Yield + principal info |
clicks_simulate_split | Read | Preview deposit split |
clicks_get_referral_stats | Read | Referral tier + earnings |
Resource: clicks://info returns protocol overview.
Contract Architecture
Five contracts work together:
Agent → ClicksSplitterV3 → 80% agent wallet
→ 20% ClicksYieldRouter → Aave/Compound/Morpho
ClicksRegistry (agent records)
ClicksFee (protocol fee on yield only)
The protocol fee is taken from yield earned, never from deposits or principal. If an agent earns nothing, the protocol charges nothing.
Contract Addresses (Base Mainnet)
| Contract | Address |
|---|---|
| ClicksRegistry | 0x898d8a3B04e5E333E88f798372129C6a622fF48d |
| ClicksFee | 0xb90cd287d30587dAF40B2E1ce32cefA99FD10E12 |
| ClicksYieldRouter | 0x47d6Add0a3bdFe856b39a0311D8c055481F76f29 |
| ClicksSplitterV3 | 0xA1D0c1D6EaE051a2d01319562828b297Be96Bac5 |
| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
Security
All contracts are verified on Basescan. No proxy upgrade patterns. No admin keys on user funds.
The protocol has not been audited by a third-party firm. A self-audit with Slither and DeFiHackLabs checklists is planned before public launch.
If you find a vulnerability, email dev@clicksprotocol.xyz.