Skip to main content

Delivery Method Comparison

Choosing the right delivery method is crucial for cost optimization. BlockDB offers three primary pricing models: API (Compute Units) for on-demand queries, WSS (Real Time Delivery) for real-time data streaming, and Archive Delivery (SFTP/S3/etc.) for bulk data exports.

When to Use API

The API is optimized for:
  • Deltas and incremental updates: Fetching only new data since your last sync
  • Strictly selected periods: Querying specific time ranges, block numbers, or addresses
  • Filtered queries: Retrieving specific subsets of data (e.g., transactions for specific contracts)
  • Ad-hoc analysis: One-off queries and exploratory data analysis
API pricing is based on Compute Units (CU) per request. Each request consumes CUs regardless of result size, making it cost-effective for targeted queries. See Compute Units for detailed pricing.

When to Use WSS

The WSS is optimized for:
  • Real-time data streaming: Low-latency queries for interactive applications
  • Event-driven architecture: Subscribing to specific events and streams
  • Data streaming: Streaming data to your applications in real time
WSS pricing is subscription-based. Contact [email protected] for WSS pricing details and subscription options.

When to Use Archive Delivery (SFTP/S3/Azure/etc.)

Archive delivery is more economical for:
  • Broad market views: Getting all ERC-20 tokens across all chains
  • Comprehensive historical data: All swaps on all supported DEXes in the previous month
  • Full dataset snapshots: Complete historical backfills of entire datasets
  • Bulk analytics: Processing large volumes of data for research or reporting
Using the API for broad queries (e.g., “get all ERC-20 tokens” or “all swaps last month”) can consume thousands of CUs due to pagination and multiple requests. Archive delivery provides these datasets as complete snapshots at a fixed cost.

Cost Comparison Examples

Example 1: All ERC-20 Tokens

API Approach:
- Query all ERC-20 tokens: ~50,000+ tokens
- Requires pagination: ~500 requests (assuming 100 tokens per page)
- CU Cost: 500 requests × 2 CU = 1,000 CU
- Additional cost: Multiple requests, rate limiting considerations
Archive Delivery Approach:
- Single SFTP/S3 snapshot: Complete ERC-20 token registry
- Fixed cost: One-time delivery fee (typically much lower than 1,000 CU)
- Benefits: Complete dataset, no pagination, ready for bulk processing
Recommendation: Use Archive Delivery for complete token registries.

Example 2: All DEX Swaps (Previous Month)

API Approach:
- Query swaps across all supported DEXes
- Multiple requests needed: Filter by pool addresses, date ranges
- Estimated: ~1,000+ requests for comprehensive coverage
- CU Cost: 1,000 requests × 1 CU = 1,000+ CU
- Complexity: Managing pagination, rate limits, multiple queries
Archive Delivery Approach:
- Single monthly snapshot: All swap transactions for the period
- Fixed cost: Monthly archive delivery subscription
- Benefits: Complete dataset, pre-aggregated, optimized for analytics
Recommendation: Use Archive Delivery for comprehensive historical analysis.

Example 3: Recent Transactions for Specific Contract

API Approach:
- Query: Transactions for contract 0x... in last 24 hours
- Single request with filters: chain_id, contract_address, timestamp range
- CU Cost: 1 request × 1 CU = 1 CU
- Benefits: Real-time, low latency, precise filtering
Archive Delivery Approach:
- Would require downloading full transaction dataset
- Processing entire archive to filter specific contract
- Overkill for targeted queries
Recommendation: Use API for targeted, real-time queries.

Example 4: Real-Time Price Monitoring

WSS Approach:
- Subscribe to price streams for specific token pairs
- Real-time updates as prices change
- Subscription-based pricing
- Benefits: Low latency, event-driven, no polling overhead
API Approach:
- Polling price endpoints every few seconds
- Multiple requests: 3,600 requests/hour (1 per second)
- CU Cost: 3,600 requests × 4 CU = 14,400 CU/hour
- Complexity: Managing polling intervals, rate limits
Recommendation: Use WSS for real-time price monitoring and event-driven applications.

Hybrid Approach

Most production systems use a combination of Archive Delivery, API, and WSS:
  1. Initial backfill: Use Archive Delivery to load historical data into your warehouse
  2. Incremental updates: Use API to fetch deltas and new data outside potential chain reorganization windows since last sync
  3. Real-time streaming: Use WSS for real-time data streaming and event-driven architecture (prepare for potential chain reorganization windows)
The _tracing_id field is consistent across all delivery methods, allowing you to reconcile records and track lineage regardless of delivery method.

Decision Matrix

Use CaseRecommended MethodWhy
All ERC-20 tokensArchive DeliveryBroad dataset, fixed cost
All swaps on all pools (monthly)Archive DeliveryComprehensive historical data
Recent transactions for specific contractAPITargeted query, low CU cost
Deltas since last syncAPIIncremental updates, efficient
Real-time price monitoringWSSLow latency, event-driven, no polling
Complete historical backfillArchive DeliveryBulk data, economical
Ad-hoc exploratory queriesAPIFlexible, pay-per-query
Event-driven applicationsWSSReal-time streaming, subscriptions

Getting Started with Archive Delivery

To set up Archive Delivery:
  1. Contact [email protected] to discuss your bulk data needs
  2. Specify datasets, chains, and time ranges required
  3. Choose delivery method: SFTP, S3, Azure Blob, Snowflake Share, etc.
  4. Receive scheduled snapshots or one-time exports
See Archive Delivery Introduction for detailed setup instructions.

See Also