Skip to main content
Builder Codes are ERC-8021 attribution codes that associate onchain activity with the app, wallet, or agent that drove it. CDP SQL API indexes this attribution metadata on Base so you can measure the activity tied to your code with standard SQL—no custom indexer required.
Get your Builder Code by registering on base.dev. You can find your code under SettingsBuilder Code.

Where Builder Code data lives

Attribution is indexed into two tables, because Base carries Builder Codes differently for regular (EOA) transactions and for smart-account (ERC-4337) user operations. Two things to keep in mind when querying either table:
  • Deduplicate transactions. In base.transaction_attributions a transaction attributed to multiple Builder Codes appears once per code, so count DISTINCT transaction_hash when you want a transaction count.
  • Scope to active rows. Both tables use an action column (Int8): 1 means the record was added to the chain and -1 means it was removed by a re-org. Filter action = 1 for a quick view, or aggregate with SUM(action) > 0 if you need re-org-safe totals.
See the schema reference for the full column list of each table.

Access

SQL Playground

Try queries in your browser (no API keys needed)

REST API

Programmatic access with free API keys

Example queries

Try these in the SQL Playground before integrating programmatically. Replace your_builder_code with your own code.

EOA transactions for a Builder Code

Most recent transactions attributed to your code:

User operations for a Builder Code

builder_codes is an array, so use has() to match your code within a user operation:

Daily attributed transaction count

Count distinct EOA transactions per day for your code:

Query tips

Follow the SQL API best practices when querying attribution data:
  1. Match the right column per table — filter builder_code = '...' on base.transaction_attributions and has(builder_codes, '...') on base.decoded_user_operations.
  2. Deduplicate transactions — a transaction attributed to multiple codes appears once per code in base.transaction_attributions; count DISTINCT transaction_hash.
  3. Scope to active records — add action = 1 for a quick view, or SUM(action) > 0 in a HAVING/aggregate for re-org-safe totals.
  4. Bound your scan — filter on block_timestamp and add a LIMIT while iterating to keep queries fast.

Learn more