Getting Started
Start earning yield on agent USDC in under a minute. One SDK call, no config, no human required.
Prerequisites
Node.js
Node.js 18+ is required.
node --versionEthers v6
The SDK uses ethers v6 for blockchain interactions.
npm install ethers@^6Base RPC
Clicks Protocol runs on Base mainnet. Use this RPC endpoint:
https://mainnet.base.orgOr use any Base-compatible RPC provider (Alchemy, Infura, etc.).
Install SDK
Install the Clicks Protocol SDK and ethers v6:
npm install @clicks-protocol/sdk ethers@^6Or with yarn:
yarn add @clicks-protocol/sdk ethers@^6Quick Start (3 Steps)
Step 1: Import and Initialize
Import the SDK and create a ClicksClient instance with a signer.
import { ClicksClient } from '@clicks-protocol/sdk';
// Create a signer (ethers v6)
const signer = new ethers.Wallet(privateKey, provider);
// Initialize ClicksClient
const clicks = new ClicksClient(signer);Step 2: Quick Start
Call quickStart with an amount and agent address.
// One-call setup: registers agent, approves USDC, and splits first payment
await clicks.quickStart('1000', agentAddress);
// Result: 800 USDC → liquid (instant access)
// 200 USDC → earning 7-13% APY on MorphoThe method automatically splits payments 80% liquid / 20% yield by default.
Step 3: Receive Payments
For subsequent payments, use receivePayment.
// All future payments are automatically split 80/20
await clicks.receivePayment('500', agentAddress);No additional setup needed. The agent is now earning yield on 20% of all incoming USDC.
MCP Server Setup
AI agents can discover and use Clicks via Model Context Protocol (MCP). The server provides 9 tools for autonomous operation.
npx @clicks-protocol/mcp-serverOr install globally:
npm install -g @clicks-protocol/mcp-server
CLICKS_PRIVATE_KEY=0x... clicks-mcpAvailable Tools (9)
clicks_quick_start— One-call setup + first paymentclicks_receive_payment— Split incoming USDC paymentclicks_withdraw_yield— Withdraw principal + yieldclicks_register_agent— Register new agentclicks_set_yield_pct— Set custom yield percentageclicks_get_agent_info— Agent registration + balance infoclicks_simulate_split— Preview payment splitclicks_get_yield_info— Current APY + active protocolclicks_get_referral_stats— Referral network stats
Check Yield Balance
Monitor an agent's yield balance and accumulated earnings.
// Get agent info including deposited amount
const agentInfo = await clicks.getAgentInfo(agentAddress);
console.log(agentInfo);
// { isRegistered: true, deposited: 200000000n, yieldPct: 20n }
// Get current yield protocol and APY rates
const yieldInfo = await clicks.getYieldInfo();
console.log(yieldInfo);
// { activeProtocol: 'Morpho', morphoAPY: 950, aaveAPY: 700 }The getAgentInfo method works with a provider (no signer needed).
Withdraw Yield
Withdraw principal plus accumulated yield at any time. No lockup period.
// Withdraw all principal + yield for an agent
await clicks.withdrawYield(agentAddress);The full amount (principal + accrued yield) is returned to the agent's wallet in USDC.
Next Steps
Summary
- • Install SDK:
npm install @clicks-protocol/sdk ethers@^6 - • Initialize:
new ClicksClient(signer) - • Quick start:
clicks.quickStart('amount', agentAddress) - • Default split: 80% liquid, 20% earning 7-13% APY on Morpho
- • Check balance:
clicks.getAgentInfo(agentAddress) - • Withdraw anytime:
clicks.withdrawYield(agentAddress) - • MCP server:
npx @clicks-protocol/mcp-server(9 tools)