Signal Architect
Agent API Zero Custody v1.0 — Non-custodial agent-to-agent swap router with feeBps fee routing
Revenue Dashboard
Protocol Status
Routing Activity
Architecture
FarmDash is the Matchmaker, not the Bank. The protocol executes the swap. FarmDash collects a haircut fee routed directly to treasury — no escrow, no custody, no money transmission.
API Reference
| Method | Endpoint | Description |
|---|---|---|
POST | /api/agents/swap | Execute authenticated swap with fee attached |
GET | /api/agents/quote | Preview quote without executing (no auth) |
GET | /api/agents/history | Fee revenue log & aggregate metrics |
POST /api/agents/swap
Authenticates the agent via EIP-191 signature, selects the optimal protocol, attaches feeBps, and returns a ready-to-sign transaction.
{
"fromChainId": 8453,
"toChainId": 8453,
"fromToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"toToken": "0x4200000000000000000000000000000000000006",
"fromAmount": "1000000",
"agentAddress": "0xYourAgentWallet",
"toAddress": "0xRecipientAgent",
"slippage": 0.5,
"nonce": "1709000000000",
"signature": "0xEIP191SignatureHere..."
}
{
"protocol": "x402",
"estimatedOutput": "550000000000000",
"feeBps": 50,
"feeAmountUSD": "0.50",
"gasEstimate": "21000",
"txData": {
"to": "0xProtocolContract",
"data": "0xEncodedCalldata...",
"value": "0",
"chainId": 8453
},
"expiresAt": 1709000030000
}
Authentication
Agents sign a deterministic payload using EIP-191. The payload format is:
FARMDASH_SWAP:{fromChainId}:{toChainId}:{fromToken}:{toToken}:{fromAmount}:{agentAddress}:{toAddress}:{nonce}
All addresses must be lowercased. Nonce must be a timestamp within 60 seconds of the current time (replay protection).
Agent SDK Example
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(AGENT_PRIVATE_KEY);
const nonce = Date.now().toString();
const payload = [
'FARMDASH_SWAP', 8453, 8453,
USDC_ADDRESS.toLowerCase(),
WETH_ADDRESS.toLowerCase(),
'1000000',
account.address.toLowerCase(),
RECIPIENT.toLowerCase(),
nonce,
].join(':');
const signature = await account.signMessage({ message: payload });
const res = await fetch('https://farmdash.one/api/agents/swap', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
fromChainId: 8453, toChainId: 8453,
fromToken: USDC_ADDRESS, toToken: WETH_ADDRESS,
fromAmount: '1000000',
agentAddress: account.address,
toAddress: RECIPIENT,
nonce, signature,
}),
});
const quote = await res.json();
// quote.txData is ready-to-sign — agent executes via own wallet
Fee Structure
| Tier | Volume | Fee (bps) | Fee (%) |
|---|---|---|---|
| Standard | < $10K | 50 | 0.50% |
| Mid | $10K – $100K | 35 | 0.35% |
| Whale | > $100K | 25 | 0.25% |
GET /api/agents/quote
Preview pricing without authentication. Pass query params: fromChainId, toChainId, fromToken, toToken, fromAmount, protocol (optional).
GET /api/agents/history
Query fee event log. Params: agentAddress (optional filter), limit, offset. Add metrics=true for aggregate dashboard metrics.
Security Model
| Threat | Mitigation | Status |
|---|---|---|
| Replay attack | Nonce + 60s window validation | Built In |
| Signature forgery | EIP-191 verifyMessage via viem | Built In |
| Fee address swap (MITM) | Treasury wallet is env-only, never in request | Built In |
| API key exposure | Server-side only, never returned to client | Built In |
| Rate limit abuse | 20 req/min per agent address | Built In |
| Quote expiry ignored | 30s expiry enforced on all quotes | Built In |