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:- Go to sim.dune.com.
- Create an account, or log in with your existing Dune account.
- In the left sidebar, click Keys.
- To generate a new API key, click New.
- Choose Sim API as the purpose of the key.
- Copy the generated API key, and save it securely.
2. Project setup
.env file:
3. Your first API call
Createindex.js:
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
- Sim documentation: https://docs.sim.dune.com
- Sim dashboard: https://sim.dune.com
- Sei explorer: https://seiscan.io
Community resources
- Dune Discord: https://discord.gg/dune
- Sei Discord: https://discord.gg/sei
Next steps
- To scale your application, implement caching, database storage, and horizontal scaling.
- Build a frontend, such as a React or Vue.js dashboard, to visualize your data.
- Implement machine learning for predictive analytics.
- Build custom indexers, which are specialized data pipelines for specific protocols.
- Connect your application to other services, such as price feeds and news APIs.