All packages

dawabit_eth_substreams

bizznezz89
v0.1.0/2 downloads/Repository

Package ref

dawabit-eth-substreams@v0.1.0

Run package

CLI

Run map_wabit_transfers from the command line.

substreams run dawabit-eth-substreams@v0.1.0 map_wabit_transfers -e mainnet --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

DaWabit Ethereum Substreams

DaWabit Ethereum Substreams provides Ethereum Mainnet market and token activity for the original WABIT token and its two primary Uniswap V2 liquidity markets.

This package is the Ethereum-side companion to the existing Robinhood Chain DaWabit Substreams package.

The two packages are intentionally separate:

Ethereum Mainnet
    |
    | WABIT token activity
    | WABIT/WETH market activity
    | WABIT/USDT market activity
    v
dawabit_eth_substreams

Robinhood Chain Mainnet
    |
    | ReLaunchpad curve discovery
    | Bonding-curve activity
    | Graduation
    | Post-graduation AMM activity
    v
dawabit_substreams

The existing Robinhood Chain package remains unchanged.


Package

Name:     dawabit_eth_substreams
Version:  v0.1.0
Network:  Ethereum Mainnet
Chain ID: 1

Built package:

dawabit-eth-substreams-v0.1.0.spkg

Substreams network identifier:

mainnet

Ethereum Contracts

WABIT

Original Ethereum WABIT token:

0x5857CF3FD35D1FB4EC56151B5Dcff289e7BE8000

Decimals:

18

WABIT is a fee-on-transfer token with transfer-burn mechanics.

The Substream does not estimate burn activity from swap amounts.

Instead, it indexes the WABIT contract's actual Transfer events and identifies transfers sent to the configured burn address:

0xdEAD000000000000000042069420694206942069

This lets downstream consumers distinguish observed token burns from ordinary token transfers.


WETH

Ethereum Wrapped Ether:

0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

Decimals:

18

USDT

Ethereum Tether:

0xdAC17F958D2ee523a2206206994597C13D831ec7

Decimals:

6

Indexed Ethereum Markets

WABIT / WETH

Uniswap V2 pair:

0xB5C6ee9949aB5323B266a8507DC2D80285e55774

Pair ordering:

token0 = WABIT
token1 = WETH

Normalized market symbol:

WABIT/WETH

WABIT / USDT

Uniswap V2 pair:

0x2E64071209C8a3642BE74fEbD001e09f727f8EEe

Pair ordering:

token0 = WABIT
token1 = USDT

Normalized market symbol:

WABIT/USDT

Architecture

The package produces three public modules:

                     Ethereum Mainnet
                            |
             +--------------+--------------+
             |                             |
             v                             v
        WABIT token                Uniswap V2 pairs
             |                             |
             | Transfer                    | Swap
             |                             | Sync
             |                             | Mint
             |                             | Burn
             v                             v
 map_wabit_transfers            map_eth_pair_activity
             |                             |
             +--------------+--------------+
                            |
                            v
                 map_eth_market_activity
                            |
                            v
              Canonical Ethereum feed

Module: map_wabit_transfers

Indexes Transfer events emitted by the original Ethereum WABIT contract.

Input:

sf.ethereum.type.v2.Block

Output:

proto:contract.v1.WabitTransfers

The block filter restricts processing to logs emitted by:

0x5857cf3fd35d1fb4ec56151b5dcff289e7be8000

Each transfer record contains:

event_type
burn

token
from
to
amount

block_number
transaction_hash
ordinal
event_id

Transfer Classification

Ordinary WABIT movement:

event_type = TRANSFER
burn       = false

Transfer to the configured burn address:

event_type = BURN
burn       = true

This classification is based on the emitted destination address.

The module therefore reports observed on-chain burns instead of deriving them from a hard-coded percentage.


Module: map_eth_pair_activity

Indexes activity from both Ethereum WABIT Uniswap V2 pairs.

Input:

sf.ethereum.type.v2.Block

Output:

proto:contract.v1.EthereumPairActivities

Tracked pairs:

WABIT/WETH
0xB5C6ee9949aB5323B266a8507DC2D80285e55774

WABIT/USDT
0x2E64071209C8a3642BE74fEbD001e09f727f8EEe

Indexed Uniswap V2 events:

Swap
Sync
Mint
Burn

SWAP

SWAP represents canonical AMM trading activity.

For swap records:

canonical_trade = true

Raw Uniswap V2 fields are retained:

amount0_in
amount1_in
amount0_out
amount1_out

The package also exposes normalized WABIT / quote fields:

token_amount_in
quote_amount_in

token_amount_out
quote_amount_out

This means downstream systems do not need to independently determine which side of the pair represents WABIT.

Example semantics:

token_* = WABIT
quote_* = WETH or USDT

depending on the market.


SYNC

SYNC exposes the current reserve values emitted by the Uniswap V2 pair.

Raw values:

reserve0
reserve1

Normalized values:

token_reserve
quote_reserve

For both currently indexed markets:

token_reserve = WABIT reserve
quote_reserve = WETH or USDT reserve

These reserve updates provide the underlying state required for market pricing, slippage calculations, and arbitrage analysis.


MINT

Represents liquidity being added to a WABIT pair.

Raw amounts:

amount0
amount1

Normalized amounts:

token_amount
quote_amount

where:

token_amount = WABIT
quote_amount = WETH or USDT

BURN

Within map_eth_pair_activity, BURN means a Uniswap V2 liquidity-removal event.

Raw amounts:

amount0
amount1

Normalized amounts:

token_amount
quote_amount

This is distinct from a WABIT token burn.


Burn Terminology

There are two different kinds of BURN activity represented by this package.

WABIT Token Burn

Source:

WABIT Transfer event

Classification:

activity_type = TOKEN
event_type    = BURN

Meaning:

WABIT was transferred to the configured burn address.

Uniswap V2 LP Burn

Source:

Uniswap V2 Pair Burn event

Classification:

activity_type = AMM
event_type    = BURN

Meaning:

Liquidity was removed from a WABIT liquidity pool.

Consumers should use activity_type to distinguish the two.


Pair Metadata

Every AMM record identifies:

market_symbol

pair
token
quote_token

token_decimals
quote_decimals

token0
token1
token_is_token0

Current markets:

MarketWABIT DecimalsQuote Decimals
WABIT/WETH1818
WABIT/USDT186

The package preserves the raw pair ordering while also supplying normalized WABIT-centric fields.

This makes the feed suitable for consumers that should not need to reproduce token-ordering logic.


Module: map_eth_market_activity

map_eth_market_activity is the canonical combined Ethereum activity feed.

Input:

sf.ethereum.type.v2.Block

Output:

proto:contract.v1.EthereumMarketActivities

It combines:

WABIT token transfers
WABIT token burns

WABIT/WETH swaps
WABIT/WETH reserve updates
WABIT/WETH liquidity additions
WABIT/WETH liquidity removals

WABIT/USDT swaps
WABIT/USDT reserve updates
WABIT/USDT liquidity additions
WABIT/USDT liquidity removals

Records are sorted by Ethereum event ordinal before being emitted.

This preserves event ordering within a block.


Canonical Ethereum Activity Envelope

Each combined-feed record contains:

activity_type
event_type
canonical_trade

market
pair
token
quote_token

block_number
transaction_hash
ordinal
event_id

It also embeds the original decoded record:

wabit_transfer

or:

pair_activity

depending on the activity type.


Activity Types

Token-layer activity:

activity_type = TOKEN

AMM-layer activity:

activity_type = AMM

Canonical Trades

Only Uniswap V2 Swap events are marked:

canonical_trade = true

Token transfers are not trades.

Reserve synchronization events are not trades.

Liquidity additions are not trades.

Liquidity removals are not trades.

This prevents downstream systems from accidentally counting non-trade activity as market volume.


Event IDs

Each decoded event receives a deterministic identifier based on:

transaction_hash + ordinal

Format:

<transaction_hash>:<ordinal>

This gives downstream consumers a stable event-level identifier for deduplication and indexing.


Arbitrage Infrastructure Role

The Ethereum Substream provides the L1 market-data side of the DaWabit cross-chain market infrastructure.

Current relevant market topology:

                 Ethereum Mainnet

             WABIT/WETH
                  |
                  |
                  +---------+
                            |
                            v
                      WABIT pricing
                            ^
                            |
                  +---------+
                  |
             WABIT/USDT


                Robinhood Chain

               WABIT/RHC-WETH
                      |
               Bonding Curve
                    or
               Graduated AMM

The Ethereum feed provides deterministic activity from both L1 markets.

The Robinhood Chain feed independently provides the RHC market lifecycle and trading activity.

Together, those data sources can support cross-market monitoring and arbitrage infrastructure without combining the chain-specific Substreams packages themselves.


Current Module Graph

map_wabit_transfers
    |
    | WABIT Transfer logs
    v
WabitTransfers


map_eth_pair_activity
    |
    | WABIT/WETH
    | WABIT/USDT
    |
    | Swap / Sync / Mint / Burn
    v
EthereumPairActivities


map_eth_market_activity
    |
    | TOKEN activity
    | AMM activity
    v
EthereumMarketActivities

Block Filtering

The package imports:

streamingfast/ethereum-common-v0.3.3

and uses:

ethcommon:index_events

to avoid processing irrelevant Ethereum blocks.

Token filter:

evt_addr:0x5857cf3fd35d1fb4ec56151b5dcff289e7be8000

Pair filters:

evt_addr:0xb5c6ee9949ab5323b266a8507dc2d80285e55774

and:

evt_addr:0x2e64071209c8a3642be74febd001e09f727f8eee

The combined module filters for all three addresses.


Initial Blocks

The v0.1.0 manifest uses verified per-module historical boundaries:

map_wabit_transfers:       18,430,484
map_eth_pair_activity:     20,054,765
map_eth_market_activity:   18,430,484

WABIT was deployed on Ethereum Mainnet at block 18,430,484. Historical RPC verification confirms that the contract had no runtime bytecode at block 18,430,483 and had deployed runtime bytecode at block 18,430,484.

The canonical WABIT/WETH Uniswap V2 market begins at block 20,054,765. The WABIT/USDT market follows at block 20,054,779.

map_wabit_transfers therefore begins at the WABIT deployment block.

map_eth_pair_activity begins at the earliest tracked AMM market block, avoiding unnecessary processing before either tracked pair is active.

map_eth_market_activity begins at the WABIT deployment block because the combined feed includes token-level WABIT activity as well as AMM activity.

Address-based block filters further restrict processing to WABIT and the two tracked Uniswap V2 pairs.


ABI Generation

The package uses substreams-ethereum ABI generation.

Current ABI sources:

abi/wabit.json
abi/uniswap_v2_pair.json

Generated Rust bindings:

src/abi/wabit.rs
src/abi/uniswap_v2_pair.rs

build.rs regenerates the bindings as required during compilation.


Protobuf Schema

Primary protobuf source:

proto/contract.proto

Generated Rust protobuf bindings:

src/pb/contract.v1.rs

Primary output messages:

WabitTransfer
WabitTransfers

EthereumPairActivity
EthereumPairActivities

EthereumMarketActivity
EthereumMarketActivities

Build

From the Ethereum package directory:

cd /workspace/dawabit_eth_substreams
substreams build

Expected package:

dawabit-eth-substreams-v0.1.0.spkg

Protobuf Generation

substreams protogen substreams.yaml

Package Information

substreams info substreams.yaml

or:

substreams info dawabit-eth-substreams-v0.1.0.spkg

Run on Ethereum Mainnet

StreamingFast Ethereum endpoint:

mainnet.eth.streamingfast.io:443

WABIT Transfers

substreams run \
  -e mainnet.eth.streamingfast.io:443 \
  substreams.yaml \
  map_wabit_transfers \
  --start-block <block> \
  -o json

Ethereum Pair Activity

substreams run \
  -e mainnet.eth.streamingfast.io:443 \
  substreams.yaml \
  map_eth_pair_activity \
  --start-block <block> \
  -o json

Canonical Combined Ethereum Feed

substreams run \
  -e mainnet.eth.streamingfast.io:443 \
  substreams.yaml \
  map_eth_market_activity \
  --start-block <block> \
  -o json

Single-Block Development Test

A one-block historical test can be performed with:

substreams run \
  -e mainnet.eth.streamingfast.io:443 \
  substreams.yaml \
  map_eth_market_activity \
  --start-block <block> \
  --stop-block +1 \
  -o json

This is useful for validating known historical transactions without replaying the entire WABIT history.


Authentication

A Substreams API token can be provided through:

.substreams.env

The local auth file is not intended for source control.


Generated and Local Files

The package should not commit local build artifacts or credentials such as:

.substreams.env
target/
sink-data/
*.spkg

Generated ABI bindings may be regenerated through the Rust build process.


Source Layout

dawabit_eth_substreams/
├── abi/
│   ├── uniswap_v2_pair.json
│   └── wabit.json
│
├── proto/
│   └── contract.proto
│
├── src/
│   ├── abi/
│   │   ├── mod.rs
│   │   ├── uniswap_v2_pair.rs
│   │   └── wabit.rs
│   │
│   ├── pb/
│   └── lib.rs
│
├── build.rs
├── Cargo.toml
├── Cargo.lock
├── substreams.yaml
└── README.md

Relationship to DaWabit RHC Substreams

The Ethereum package must not replace or modify the existing Robinhood Chain package.

RHC package:

dawabit_substreams

Current completed RHC package:

dawabit_substreams@v0.2.2

Canonical RHC module:

map_market_activity

Ethereum package:

dawabit_eth_substreams

Canonical Ethereum module:

map_eth_market_activity

This separation keeps network-specific logic, contract discovery, ABIs, and lifecycle assumptions isolated while allowing higher-level DaWabit infrastructure to consume both feeds.


Repository

https://github.com/bizznezz89/dawabit-substreams

Modules

Execution graph

5 modules
Show 2 dependencies
map

ethcommon:all_events

`all_events` gives you all the events in a block (from successful transactions), with basic block hash/number/timestamp and transaction hash

Output

sf.substreams.ethereum.v1.Events

blockIndex

ethcommon:index_events

`index_events` sets the following keys on the block: * Event signatures evt_sig:0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef (signature in hex, prefixed by 0x) * Event address evt_addr:0x0123456789abcdef0123456789abcdef01234567 (address in hex, prefixed by 0x)

Output

sf.substreams.index.v1.Keys