Skip to main content

Overview

Sim by Dune is a real-time, multichain developer platform that provides scalable APIs and indexing infrastructure for building onchain applications. It offers the fastest way to access live blockchain data across 60+ chains, including Sei, with zero DevOps overhead. In this tutorial, you’ll learn how to set up Sim, build your first data pipeline, and create powerful onchain applications on Sei. To understand more and deep dive into how it works under the hood, please refer to the Sim by Dune Documentation

What this guide teaches you:

This tutorial guides you through:
  • Setup: Get your Sim API key, install dependencies, and connect to Sei
  • Core APIs: Learn to use all 6 Sim APIs with practical examples
  • End-to-End Examples: You’ll run practical code to:
    • Fetch Sei token balances with USD values
    • Monitor wallet transactions and activity
    • Get token metadata and holder information
    • Track NFT collections and metadata
  • Production Ready: Error handling, rate limiting, and monitoring

Some Use Cases:

  • DeFi Analytics Platforms: Real-time tracking of liquidity, volumes, and yields across Sei protocols
  • Portfolio Trackers: Multi-chain portfolio management with Sei integration
  • Trading Bots: Automated trading based on real-time onchain signals
  • Risk Management: Monitor positions and liquidation risks across protocols
  • Governance Tools: Track voting power and proposal activity
  • MEV Analysis: Detect and analyze MEV opportunities on Sei

Supported APIs

Sim by Dune provides access to comprehensive EVM blockchain data through these core APIs:

Balances API

  • Features: All EVM token balances for a wallet or address, ordered by USD value
  • Use cases: Portfolio trackers, wallet applications, asset management dashboards

Transactions API

  • Features: Quick and accurate lookup of EVM transactions associated with any address
  • Use cases: Transaction monitoring, compliance tools, activity tracking

Token Info API

  • Features: Metadata including symbol, name, decimals, supply information, logo URLs, and realtime prices
  • Use cases: Token discovery, price tracking, market analysis

Token Holders API

  • Features: Holders of an ERC20 token, sorted by balance
  • Use cases: Governance analysis, token distribution studies, whale tracking

Activity API

  • Features: Derived activities including swaps, transfers, and approvals within transactions for any address
  • Use cases: DeFi analytics, trading analysis, user behavior tracking

Collectibles API

  • Features: All NFT (ERC721 and ERC1155) balances, including IDs and metadata
  • Use cases: NFT marketplaces, collection analytics, digital asset management

Quick Start

1. Getting Your API Key

To use Sim APIs, you’ll need an API key from the Sim dashboard:
  1. Visit Sim Dashboard: Go to sim.dune.com
  2. Sign Up/Login: Create an account or login with your existing Dune account
  3. Navigate to Keys: In the left sidebar, click on “Keys”
  4. Create New Key: Click the “New” button to generate a new API key
  5. Select API Type: Choose “Sim API” as the key’s purpose
  6. Copy Your Key: Save the generated API key securely
Security Notes:
  • Never share your API key in public repositories
  • Keep your API keys secure and rotate them regularly
  • Use environment variables to store your keys

2. Project Setup

Create .env file:

3. Your First API Call

Create index.js:
Run your first query:
Expected Output:

API Examples

Balances API - Get Token Balances

Transactions API - Monitor Wallet Transactions

Token Info API - Get Token Metadata

Token Holders API - Find Top Holders

Activity API - Track Swaps and Transfers

Collectibles API - Get NFT Collections

Advanced Use Cases

Portfolio Analytics Dashboard

Token Analysis Tool

Error Handling & Best Practices

Comprehensive Error Handling

Rate Limiting

Troubleshooting

Resources

Official Documentation

Community Resources

Next Steps

  1. Scale Your Application: Implement caching, database storage, and horizontal scaling
  2. Build a Frontend: Create React/Vue.js dashboards to visualize your data
  3. Advanced Analytics: Implement machine learning for predictive analytics
  4. Custom Indexers: Build specialized data pipelines for specific protocols
  5. API Integration: Connect with other services like price feeds, news APIs