Skip to main content

Building a Self-Sustaining Agent

Design an agent that funds its own compute costs through trading fees.

The Self-Sustaining Model​

┌─────────────────┐
│ Your Agent │
│ (provides │
│ value) │
└────────┬────────┘
│ Users interact
▼
┌─────────────────┐
│ Token Trading │
│ (generates │
│ fees) │
└────────┬────────┘
│ Fees accumulate
▼
┌─────────────────┐
│ Fee Claims │
│ (ETH/WETH) │
└────────┬────────┘
│ Revenue
▼
┌─────────────────┐
│ Your Agent │◀──┐
│ (continues │ │
│ running) │───┘
└─────────────────┘
Gas Sponsorship

Bankr covers gas for embedded agent wallets on most chains, up to 10 sponsored transactions and $3 of gas per wallet per day; past either limit the wallet pays its own gas until the window resets. Launch gas is sponsored on Base only. See the Wallets FAQ for which chains are covered.

Choose Your Integration​

The simplest path to a self-sustaining agent. Bankr handles wallet management, transaction execution, security, and gas fees.

Install in your agent

Tell your agent (Claude Code, OpenClaw, Cursor, or any other skills-compatible framework):

install the bankr skill from https://github.com/BankrBot/skills

Your agent can then:

  • Deploy tokens and earn fees
  • Execute trades automatically
  • Claim fees with natural language
  • No wallet management code needed

Option 2: Agent API​

For custom integrations with full wallet control via API key authentication.

const API_KEY = process.env.BANKR_API_KEY;
const BASE_URL = 'https://api.bankr.bot/agent';

async function executePrompt(prompt: string) {
// Submit prompt
const submitRes = await fetch(`${BASE_URL}/prompt`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY,
},
body: JSON.stringify({ prompt }),
});

const { jobId } = await submitRes.json();

// Poll for completion
while (true) {
const statusRes = await fetch(`${BASE_URL}/job/${jobId}`, {
headers: { 'X-API-Key': API_KEY },
});
const job = await statusRes.json();

if (job.status === 'completed') return job.response;
if (job.status === 'failed' || job.status === 'cancelled') {
throw new Error(job.error ?? `Job ${job.status}`);
}

await new Promise(r => setTimeout(r, 2000));
}
}

// Use it
const fees = await executePrompt('check fees for MyToken');
await executePrompt('claim my fees for MyToken');

Benefits:

  • Bankr manages wallet security
  • No private keys in your code
  • Gas fees covered on sponsored chains (see Gas Sponsorship above)
  • Simple REST API

Calculating Sustainability​

Fee Revenue​

As creator you earn 95% of the 0.7% pool fee on every trade (0.665% of volume):

  • High volume token: $10-100+/day possible
  • Moderate volume: $1-10/day
  • Low volume: Less than $1/day

Break-Even​

With the Agent API:

  • Prompts need Bankr Club (a flat monthly fee) or Max Mode (billed per request from LLM credits)
  • Gas fees are covered by Bankr on sponsored chains, within the daily limits above
  • Your trading fees go directly to growing your treasury

Strategies for Sustainability​

1. Smart Fee Collection​

Automate fee collection with the Agent API:

async function collectFees() {
// Check fees
const fees = await executePrompt('check fees for MyToken');
console.log('Current fees:', fees);

// Claim if worthwhile
await executePrompt('claim my fees for MyToken');
console.log('Fees claimed');
}

// Run daily
setInterval(collectFees, 24 * 60 * 60 * 1000);

If the fee recipient is a wallet you hold the private key for, you can skip the API and run the CLI from cron with --not-interactive — claim-wallet claims Base launches only:

# crontab -e
0 3 * * * BANKR_PRIVATE_KEY=0x... bankr --ni fees claim-wallet --all

--ni skips all confirmation prompts and fails fast on missing inputs, so the job either succeeds or exits with a clear error — never hangs.

2. Batch Operations​

Combine related queries:

// Instead of:
"price of ETH"
"price of BTC"
"price of SOL"

// Use:
"prices of ETH, BTC, and SOL"

Monitoring Sustainability​

Track these metrics:

MetricGoal
Daily fee revenueKnow your income
Token trading volumeLeading indicator
ETH/WETH balanceAvailable for gas
Claim frequencyOptimize collection