Example of a simple indexer built on top of NEAR Lake Framework
You can create your own logic to process the NEAR Protocol data in the programming languages of your choice:
Python
PyPI Package
JavaScript
npm Package
Rust
Crates.io Package
GitHub repo: https://github.com/near/near-lake-framework/
Data Lake
The NEAR Lake is a set of AWS S3 buckets which are constantly receiving new blocks from a running indexer maintained by Aurora. Events such as FT Events and NFT Events are constantly being written as JSON files in two AWS S3 buckets:- Mainnet
- Testnet
Bucket:
near-lake-data-mainnetRegion: eu-central-1Contains all production blockchain data from NEAR Protocol mainnet.Latency
Indexers based on the Lake Framework inherit the latency characteristics of a NEAR Indexer plus an extra 0.1-2.1s latency of dumping to and reading from AWS S3. Typical latency breakdown:- Finalization delay: ~3-5 seconds
- S3 write/read overhead: 0.1-2.1 seconds
- Total end-to-end: 3.9-7.1 seconds (estimated average 6-8s)
Cost
Indexers based on NEAR Lake consume 100-500MB of RAM depending on the size of the preloading queue, it does not require any storage, and it can potentially run even on Raspberry PI. Getting the blockchain data from S3 will cost around $30.16 per month as NEAR Lake configured S3 buckets in such a way that the reader is paying the costs.AWS S3 Cost Breakdown
AWS S3 Cost Breakdown
Assuming NEAR Protocol produces 1 block every 600ms, on a full day the network can create up to 144000 blocks (86400s / 600ms per block).According to the Amazon S3 prices Note: 10 requests for each block means we have 9 shards (1 file for common block data and 9 separate files for each shard)LIST requests:Total monthly cost:
list requests are charged for 0.0004 per 1000 requests.Calculations (assuming we are following the tip of the network all the time):GET requests:Comparison with NEAR Indexer Framework
NEAR Lake Framework is reading data from AWS S3, while the NEAR Indexer is running a full node and reading data from the blockchain directly in real time.| Feature | Indexer Framework | Lake Framework |
|---|---|---|
| Follows blocks and transactions | Yes | Yes (mainnet and testnet only) |
| Decentralized | Yes | No (Pagoda Inc dumps blocks to AWS S3) |
| Reaction time (end-to-end) | Minimum 3.8s (estimated average 5-7s) | Minimum 3.9s (estimated average 6-8s) |
| Reaction time (framework overhead) | 0.1s | 0.2-2.2s |
| Infrastructure cost | $500+/mo | $20-40/mo |
| Ease of maintenance | Advanced (follow nearcore upgrades, sync state) | Easy (deploy once and forget) |
| Time to start | Days (on mainnet/testnet) | Seconds |
| Local development | Advanced (localnet option, but testnet/mainnet testing is heavy) | Easy |
| Programming languages | Rust only | Any (Python, JavaScript, Rust) |
Key Benefits
Cost-Efficient
Runs on minimal infrastructure (~500+/month)
Easy Setup
Start indexing in seconds, not days. No blockchain state sync required.
Multiple Languages
Build indexers in Python, JavaScript, or Rust based on your team’s expertise.
Low Maintenance
Deploy once and forget. No need to follow nearcore upgrades or manage node infrastructure.
How It Works
Examples & Tutorials
Raw Printer
Simple example of a data printer built on top of NEAR Lake Framework
Accounts Watcher
Source code for a video tutorial on how to use the NEAR Lake Framework
Transaction Watcher
Indexer example that watches for transactions for specified accounts/contracts
More Tutorials
Browse all NEAR Lake Framework tutorials
Getting Started
- Python
- JavaScript
- Rust
Build Your First Indexer
Follow our step-by-step tutorials to build your first NEAR Lake indexer