Skip to main content
Glama

obol

Pay the ferryman. Solana agent gateway via x402.

Obol is a pay-per-use Solana API for AI agents. No API keys, no subscriptions — agents pay per request in USDC using the x402 payment protocol. Solana's sub-cent transaction costs make micropayments viable for the first time.

Named after the coin placed on the tongue of the dead to pay Charon for passage across the River Styx. The original micropayment.

How it works

  1. Agent requests data from a paid endpoint

  2. Obol returns HTTP 402 with a payment requirement (amount, recipient, network)

  3. Agent sends USDC on Solana matching the requirement

  4. Agent retries with transaction proof in the X-PAYMENT header

  5. Obol verifies on-chain and returns the data

No accounts. No tokens. No onboarding. Just pay and go.

Related MCP server: boo-x402-mcp

Endpoints

Wallet Analytics

Endpoint

Price

Description

GET /api/v1/wallet/:addr/overview

$0.01

SOL balance, token count, total value

GET /api/v1/wallet/:addr/portfolio

$0.05

Full holdings with prices, NFTs, breakdown

GET /api/v1/wallet/:addr/activity

$0.05

Transaction history with categorization

GET /api/v1/wallet/:addr/risk

$0.10

Multi-factor risk assessment

GET /api/v1/wallet/:addr/pnl

$0.15

Token flow analysis, current values, P&L

Token Data

Endpoint

Price

Description

GET /api/v1/token/:mint/price

$0.005

Real-time price via Jupiter

GET /api/v1/token/:mint/metadata

$0.01

Name, symbol, supply, decimals

DeFi

Endpoint

Price

Description

GET /api/v1/defi/swap/quote

$0.005

Jupiter swap quote with route planning

POST /api/v1/defi/swap/execute

$0.25

Jupiter swap transaction builder

GET /api/v1/defi/positions/:addr

$0.10

DeFi positions — LSTs, LPs, lending

GET /api/v1/defi/lst/yields

$0.02

LST yield comparison across Solana

Free

Endpoint

Description

GET /

API info and pricing

GET /health

Service status

POST /api/v1/rpc

Proxied Helius RPC (allowlisted methods)

Agent Example

See examples/agent-client.ts for a full reference implementation. The key flow:

import { ObolAgent } from './examples/agent-client';

const agent = new ObolAgent();
await agent.discover();  // fetch pricing
agent.loadWallet(process.env.AGENT_PRIVATE_KEY);

// Auto-discovers price, pays, and returns data
const price = await agent.fetch('/api/v1/token/USDC_MINT/price');

Run in discovery-only mode (no wallet needed):

npx tsx examples/agent-client.ts

MCP Server

Obol ships as an MCP server — any AI agent that supports the Model Context Protocol can discover and call Obol's tools natively.

Install from npm

npm install -g obol-mcp

Claude Desktop / Claude Code

Add to your MCP config:

{
  "mcpServers": {
    "obol": {
      "command": "npx",
      "args": ["-y", "obol-mcp"],
      "env": {
        "OBOL_URL": "https://obol-production.up.railway.app"
      }
    }
  }
}

Or if developing locally:

{
  "mcpServers": {
    "obol": {
      "command": "npx",
      "args": ["tsx", "/path/to/obol/src/mcp.ts"],
      "env": {
        "OBOL_URL": "http://localhost:3000"
      }
    }
  }
}

Available MCP Tools

Tool

Description

obol_wallet_overview

SOL balance, token count, total value

obol_wallet_portfolio

Full holdings with prices and breakdown

obol_wallet_activity

Transaction history with categorization

obol_wallet_risk

Multi-factor risk assessment

obol_wallet_pnl

Token flow analysis and P&L

obol_token_price

Real-time price via Jupiter

obol_token_metadata

Name, symbol, supply, decimals

obol_swap_quote

Jupiter swap quote with routing

obol_swap_execute

Build swap transaction for signing

obol_defi_positions

LSTs, LPs, lending positions

obol_lst_yields

LST yield comparison

obol_health

API health check (free)

obol_info

Endpoint pricing and info (free)

Run locally

npm run mcp

Stack

  • Fastify 5 — high-performance HTTP

  • @x402/svm — official x402 SDK for Solana

  • Helius — RPC + DAS API

  • Jupiter — token prices + swap execution

  • Upstash Redis — cache + payment receipts

  • TypeScript — full type safety

  • Zod — runtime validation

Setup

git clone https://github.com/halfkey/obol.git
cd obol
npm install
cp .env.example .env
# Edit .env with your Helius key and merchant wallet address
npm run dev

Testing

# Unit + integration tests (46 tests)
npm test -- --run

# Smoke test against live deployment
npx tsx scripts/smoke-test.ts https://obol-production.up.railway.app

# Manual payment test
npx tsx scripts/test-payment.ts <tx-signature>

Environment

See .env.example. Key variables:

  • PAYMENT_MODE — mock (dev, auto-approve) or onchain (production)

  • PAYMENT_RECIPIENT_ADDRESS — your Solana wallet that receives USDC

  • HELIUS_API_KEY — Helius RPC access

  • UPSTASH_REDIS_REST_URL / TOKEN — cache layer

Roadmap

  • 11 paid endpoints (wallet, token, DeFi, LST, P&L)

  • On-chain USDC verification with replay prevention

  • Test suite (46 vitest + 20-point smoke test)

  • Agent client reference implementation

  • GitHub Actions CI

  • WebSocket subscriptions for wallet monitoring

  • Dynamic congestion-based pricing

  • Multi-chain support

License

MIT

Available Tools

13 tools
obol_defi_positionsB

Get DeFi positions for a wallet — LSTs, LP tokens, lending positions, categorized by protocol. Costs $0.10 USDC.

Inputs: address (required).

obol_healthA

Check Obol API health and status. Free.

Inputs: no named parameters.

obol_infoA

Get Obol API info — all available endpoints, pricing, and payment mode. Free.

Inputs: no named parameters.

obol_lst_yieldsA

Compare LST yields across Solana — jitoSOL, mSOL, bSOL, jupSOL, hSOL, and more. APYs from Sanctum, exchange rates from Jupiter. Costs $0.02 USDC.

Inputs: no named parameters.

obol_swap_executeA

Build a Jupiter swap transaction for signing. Returns a serialized transaction the agent must sign and submit. Costs $0.25 USDC.

Inputs: amount (required), inputMint (required), outputMint (required), userPublicKey (required), +2 more.

obol_swap_quoteB

Get a Jupiter swap quote with route planning and price impact. Costs $0.005 USDC.

Inputs: amount (required), inputMint (required), outputMint (required), slippageBps.

obol_token_metadataA

Get token metadata — name, symbol, supply, decimals. Costs $0.01 USDC.

Inputs: mint (required).

obol_token_priceB

Get real-time token price via Jupiter. Costs $0.005 USDC.

Inputs: mint (required).

obol_wallet_activityA

Get wallet transaction history with categorization (swaps, transfers, etc). Costs $0.05 USDC.

Inputs: address (required).

obol_wallet_overviewA

Get a Solana wallet overview — SOL balance, token count, total value. Costs $0.01 USDC.

Inputs: address (required).

obol_wallet_pnlC

Wallet P&L analysis — token flows, current values, transaction history analysis. Costs $0.15 USDC.

Inputs: address (required).

obol_wallet_portfolioA

Get full wallet portfolio — all token holdings with prices, NFTs, and breakdown. Costs $0.05 USDC.

Inputs: address (required).

obol_wallet_riskB

Multi-factor risk assessment for a Solana wallet — age, diversification, activity patterns. Costs $0.10 USDC.

Inputs: address (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 13 tools

    Disambiguation5/5

    Each tool targets a clearly distinct resource or granularity level: wallet overview vs. full portfolio vs. activity vs. risk vs. P&L vs. DeFi positions are separately scoped. Token price/metadata, swap quote/execute, LST yields, health, and info also have unambiguous purposes.

    Naming Consistency5/5

    All tools follow the consistent `obol_<area>_<detail>` snake_case pattern, e.g. wallet_overview, token_price, swap_quote, lst_yields. Even the simpler health and info tools fit the prefix convention without disrupting the pattern.

    Tool Count5/5

    13 tools is well within the ideal range and each tool earns its place by covering a distinct wallet analytics, token data, or swap workflow. The count feels complete without being bloated.

    Completeness5/5

    The tool surface covers the full advertised Solana workflow: wallet analytics, portfolio detail, transaction history, risk, P&L, DeFi positions, token price/metadata, swap quoting/execution, and LST yield comparison. There are no obvious dead ends or missing core operations for the stated domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers