Skip to main content

Overview

Sim by Dune is a real-time, multichain developer platform. It has scalable APIs and indexing infrastructure for building onchain applications. It gives you fast access to live blockchain data on 60+ chains, including Sei, with no DevOps overhead. This tutorial shows how to set up Sim, build your first data pipeline, and create onchain applications on Sei. For details on how Sim works, see the Sim by Dune documentation.

What this guide teaches you:

  • How to get your Sim API key, install the dependencies, and connect to Sei
  • How to use all 6 Sim APIs, with practical examples
  • How to run end-to-end code examples that:
    • Fetch Sei token balances with USD values
    • Monitor wallet transactions and activity
    • Get token metadata and holder information
    • Track NFT collections and metadata
  • How to make your code production ready with 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: Multichain 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 gives access to 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 the EVM transactions for any address
  • Use cases: Transaction monitoring, compliance tools, activity tracking

Token Info API

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

Token Holders API

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

Activity API

  • Features: Derived activities, such as swaps, transfers, and approvals, in the transactions of any address
  • Use cases: DeFi analytics, trading analysis, user behavior tracking

Collectibles API

  • Features: All NFT balances (ERC-721 and ERC-1155), including IDs and metadata
  • Use cases: NFT marketplaces, collection analytics, digital asset management

Quick start

1. Getting your API key

To use the Sim APIs, you need an API key from the Sim dashboard:
  1. Go to sim.dune.com.
  2. Create an account, or log in with your existing Dune account.
  3. In the left sidebar, click Keys.
  4. To generate a new API key, click New.
  5. Choose Sim API as the purpose of the key.
  6. Copy the generated API key, and save it 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 a .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. To scale your application, implement caching, database storage, and horizontal scaling.
  2. Build a frontend, such as a React or Vue.js dashboard, to visualize your data.
  3. Implement machine learning for predictive analytics.
  4. Build custom indexers, which are specialized data pipelines for specific protocols.
  5. Connect your application to other services, such as price feeds and news APIs.