Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

YAML Configuration Reference

Complete reference for the tiders-x402-server CLI configuration file. The config uses five top-level sections: server, facilitator, database, payment, and tables.

Unknown fields are rejected – the CLI will report an error if a key is misspelled or unsupported.


Server

Required. Network configuration for the HTTP server.

FieldTypeRequiredDescription
bind_addressstringyesAddress and port to bind (e.g., "0.0.0.0:4021")
base_urlstringyesPublic URL of the server, used in x402 payment responses (e.g., "https://api.example.com")
server:
  bind_address: "0.0.0.0:4021"
  base_url: "http://localhost:4021"

Facilitator

Required. Configuration for the x402 facilitator service that handles payment verification and settlement.

FieldTypeRequiredDescription
urlstringyesFacilitator endpoint (e.g., "https://facilitator.x402.rs")
timeoutintegernoRequest timeout in seconds
headersmapnoCustom HTTP headers sent with every facilitator request
facilitator:
  url: "https://facilitator.x402.rs"
  timeout: 30
  headers:
    X-Api-Key: "${FACILITATOR_API_KEY}"

Database

Required. Database backend configuration. Exactly one backend must be specified.

DuckDb

FieldTypeRequiredDescription
pathstringyesPath to the DuckDB database file
database:
  duckdb:
    path: "./data/my_data.duckdb"

PostgreSQL

FieldTypeRequiredDescription
connection_stringstringyesPostgreSQL connection string
database:
  postgresql:
    connection_string: "host=${PG_HOST} port=5432 user=${PG_USER} password=${PG_PASSWORD} dbname=tiders"

Clickhouse

FieldTypeRequiredDescription
urlstringyesClickHouse HTTP endpoint
userstringnoDatabase user
passwordstringnoDatabase password
databasestringnoDatabase name
access_tokenstringnoAccess token for authentication
compressionstringnoCompression mode: "none" or "lz4"
database:
  clickhouse:
    url: "http://${CLICKHOUSE_HOST}:${CLICKHOUSE_PORT}"
    user: "${CLICKHOUSE_USER}"
    password: "${CLICKHOUSE_PASSWORD}"
    database: "${CLICKHOUSE_DB}"
    compression: "lz4"

Payment

Optional. Global payment settings. All fields have defaults.

FieldTypeDefaultDescription
max_timeout_secondsinteger300How long a payment offer remains valid (seconds)
default_descriptionstring"Query execution payment"Fallback description for tables without their own
payment:
  max_timeout_seconds: 300
  default_description: "Query execution payment"

Tables

Optional. List of tables exposed by the server. Each table is auto-discovered from the database; the config defines pricing and descriptions.

FieldTypeRequiredDescription
namestringyesTable name in the database
descriptionstringnoHuman-readable description
price_tagslistnoPricing tiers. Empty or absent means the table is free
tables:
  - name: my_table
    description: "My dataset"
    price_tags:
      - type: per_row
        pay_to: "0xYourAddress"
        token: usdc/base_sepolia
        amount_per_item: "0.002"
        is_default: true

Price Tag Types

Price tags use a type field to select the pricing model. Three types are supported:

Per Row

Price scales linearly with the number of rows returned. Supports tiered pricing via min_items / max_items.

FieldTypeRequiredDescription
pay_tostringyesRecipient wallet address
tokenstringyesToken identifier (see below)
amount_per_itemstringyesPrice per row as a human-readable decimal (e.g., "0.002")
min_itemsintegernoMinimum row count for this tier to apply
max_itemsintegernoMaximum row count for this tier to apply
min_total_amountstringnoMinimum total charge, even if per-row calculation is lower
descriptionstringnoLabel for this tier
is_defaultbooleannoWhether this is the default tier (default: false)
# Default tier: $0.002 per row
- type: per_row
  pay_to: "0xYourAddress"
  token: usdc/base_sepolia
  amount_per_item: "0.002"
  is_default: true

# Bulk tier: $0.001 per row for 100+ rows
- type: per_row
  pay_to: "0xYourAddress"
  token: usdc/base_sepolia
  amount_per_item: "0.001"
  min_items: 100

Fixed

A flat fee regardless of how many rows are returned.

FieldTypeRequiredDescription
pay_tostringyesRecipient wallet address
tokenstringyesToken identifier (see below)
amountstringyesFixed amount as a human-readable decimal (e.g., "1.00")
descriptionstringnoLabel for this tier
is_defaultbooleannoWhether this is the default tier (default: false)
- type: fixed
  pay_to: "0xYourAddress"
  token: usdc/base_sepolia
  amount: "1.00"
  description: "Fixed price query"

Metadata Price

A flat fee for accessing table metadata (schema and payment offers) via the GET /api/table/{name} endpoint. Without this tag, metadata is returned freely. Charging for the metadata API calls can be used to prevent API abuse.

FieldTypeRequiredDescription
pay_tostringyesRecipient wallet address
tokenstringyesToken identifier (see below)
amountstringyesFixed amount as a human-readable decimal (e.g., "0.01")
descriptionstringnoLabel for this tier
is_defaultbooleannoWhether this is the default tier (default: false)
- type: metadata_price
  pay_to: "0xYourAddress"
  token: usdc/base_sepolia
  amount: "1.00"
  description: "Metadata access fee"

Token Identifiers

Token identifiers use the format token_name/network. Supported tokens:

IdentifierTokenNetwork
usdc/base_sepoliaUSDCBase Sepolia (testnet)
usdc/baseUSDCBase
usdc/avalanche_fujiUSDCAvalanche Fuji (testnet)
usdc/avalancheUSDCAvalanche
usdc/polygonUSDCPolygon
usdc/polygon_amoyUSDCPolygon Amoy (testnet)

See also examples/cli/ for a ready-to-use config and .env.example.


Dashboards

Optional. Configures Evidence dashboards served by the server. Each entry is served as a static site at /<slug>/. Use tiders-x402-server dashboard <slug> to scaffold the Evidence project on disk.

Top-level fields

FieldTypeDefaultDescription
rootstring./dashboards/Root directory where dashboard project folders are scaffolded (resolved relative to the config file)
entrieslist[]List of dashboard definitions
dashboards:
  root: "./dashboards"   # optional
  entries:
    - slug: my-dashboard
      title: "My Dashboard"
      description: "A short description shown on the landing page."
      tags: ["DeFi", "Ethereum"]

Entry fields

FieldTypeRequiredDescription
slugstringyesURL-safe identifier; becomes the route prefix /<slug>/. Must match ^[a-z0-9][a-z0-9_-]*$. Reserved: api, assets, static
titlestringyesHuman-readable name shown on the landing page
descriptionstringnoOne-line description shown under the title on the landing page card
tagslistnoLabels rendered as pills on the landing page card (e.g., ["DeFi", "Ethereum"])
disabledbooleannoSet to true to exclude this dashboard from the server without removing the entry (default: false)
folder_pathstringnoPath where the Evidence project will be scaffolded. Defaults to <root>/<slug>/. Resolved relative to the config file
build_pathstringnoPath to the built static site served at runtime. Defaults to <folder_path>/build. Resolved relative to the config file
dashboards:
  entries:
    - slug: uniswap_v3
      title: "Uniswap V3"
      description: "Pool swaps and liquidity events on Uniswap V3."
      tags: ["Dex", "DeFi", "Ethereum"]
      # disabled: true
      # folder_path: "./dashboards/uniswap_v3"
      # build_path: "./dashboards/uniswap_v3/build"

Scaffolding and serving

Scaffold a dashboard project with:

tiders-x402-server dashboard uniswap_v3        # scaffold one dashboard
tiders-x402-server dashboard                    # scaffold all dashboards
tiders-x402-server dashboard uniswap_v3 --force # overwrite managed files

After scaffolding, build the Evidence project:

cd dashboards/uniswap_v3 && npm install && npm run build

Then start the server — the built site is served automatically at /<slug>/.