Overview
Onchain activity webhooks let you subscribe to real-time HTTP notifications for smart contract events on Base — token transfers, swaps, NFT activity, liquidity pool actions, oracle updates, and any other event your contract emits. Events fire from the tip of chain with sub-second freshness.Looking to track wallet operations (transactions, signing, delegation) instead of onchain events? See Wallet webhooks. To watch up to 100 wallet addresses for ERC-20 activity under a single subscription, see Multi-address subscriptions.
Event types
Onchain events
A single event type covers all onchain activity, filtered server-side by the labels on your subscription:| Event | Description |
|---|---|
onchain.activity.detected | A smart contract event matching your subscription’s filters fired onchain |
Wallet activity events
| Event | Description |
|---|---|
wallet.activity.detected | An EVM transaction matching your subscription’s filters was sent or received |
Creating a subscription
Use the CDP CLI to create a webhook subscription. The example below subscribes to USDCTransfer events on Base mainnet.
response.json
Label filtering
Foronchain.activity.detected subscriptions, labels apply server-side with AND logic. You can include up to 20 labels per subscription.
Allowed labels
| Label | Required | Description |
|---|---|---|
network | Yes | Blockchain network (e.g. base-mainnet, base-sepolia) |
contract_address | No | Smart contract address (hex with 0x prefix) |
event_name | No | Event name from the contract ABI (e.g. Transfer, Burn) |
event_signature | No | Full event signature (e.g. Transfer(address,address,uint256)) |
transaction_from | No | Transaction sender address |
transaction_to | No | Transaction recipient address |
params.* | No | Any indexed event parameter (e.g. params.from, params.to, params.value, params.tokenId) |
Filter examples
| Use case | Labels |
|---|---|
| Liquidity pool burns | network=base-mainnet, contract_address=0xcd1f9777..., event_name=Burn |
| Price oracle updates | network=base-mainnet, contract_address=0xbac4a942..., event_name=PriceUpdated |
| DeFi deposits | network=base-mainnet, contract_address=0x45c6e6a4..., event_name=Deposit |
| Outgoing wallet activity | network=base-mainnet, params.from=0xB7f5BF79... |
Webhook payload
Onchain activity payloads include the block context, contract identifiers, the decoded event parameters, and the surrounding transaction’sfrom / to addresses.
event-payload.json
onchain.activity.detected payloads include block_number, timestamp, transaction_hash, network, the contract identifiers, and event-specific decoded parameters.
Supported networks
- Base mainnet
- Base Sepolia testnet
Use cases
- Stablecoin movement: subscribe to USDC
Transferevents and react instantly when digital dollars change hands. - NFT ownership tracking: track wallet transfers on any ERC-721 contract.
- Exchange & portfolio monitoring: track ERC-20 activity across hundreds of user addresses with multi-address subscriptions.
- DeFi protocol activity: monitor deposits, swaps, and oracle updates on any contract you care about.
Best practices
Verify webhook signatures
Verify webhook signatures
Always verify the signature on incoming webhook payloads using the
secret returned when you created the subscription. This ensures the payload is genuinely from CDP and has not been tampered with. See Verify signatures for implementation details.Filter narrowly server-side
Filter narrowly server-side
Subscriptions accept up to 20 labels and apply them with AND logic — push as much filtering into the subscription as possible to keep delivery volume manageable and your handler simple.
Acknowledge quickly
Acknowledge quickly
Return a
200 response as soon as the payload is received and signature-verified. Process the event asynchronously to avoid blocking delivery and to prevent retries from piling up.Plan for at-least-once delivery
Plan for at-least-once delivery
CDP guarantees at-least-once delivery, so duplicate events are possible. Use the
transaction_hash and log_index together as a unique key in your handler to skip events you have already processed.What to read next
Multi-address subscriptions
Monitor up to 100 wallet addresses with a single subscription.
Wallet webhooks
Track transactions, signing operations, and delegation events for Server and Embedded Wallets.
Verify signatures
Validate that webhook payloads are genuinely from CDP.
Webhooks overview
All webhook surfaces and shared concepts.