This guide explains how to build, test, and publish DEX packages to the Substreams.dev registry.
- Rust toolchain with
wasm32-unknown-unknowntargetrustup target add wasm32-unknown-unknown
- Substreams CLI v1.1.0 or higher
# macOS brew install streamingfast/tap/substreams # Linux/Other # Download from https://github.com/streamingfast/substreams/releases
Before publishing, you need to authenticate with the Substreams registry:
substreams authThis will open your browser for GitHub authentication. The token is stored locally for future use.
cd dexes/uniswap-v3-forks # or your specific DEX implementationEdit substreams.yaml to bump the version:
package:
name: coinranking_uniswap_v3_forks
version: v0.2.0 # Increment according to semverVersion Guidelines:
- Patch (v0.1.0 → v0.1.1): Bug fixes, documentation updates
- Minor (v0.1.0 → v0.2.0): New features, backwards-compatible changes
- Major (v0.1.0 → v1.0.0): Breaking changes to output format
cargo build --target wasm32-unknown-unknown --releaseThis creates the WASM binary at:
../../target/wasm32-unknown-unknown/release/coinranking_uniswap_v3_forks.wasm
# Use the test script (if available)
./test.sh
# Or test manually with a small block range
substreams run substreams.yaml map_v3_ticker_output \
--start-block 12369621 \
--stop-block +10Ensure the output matches the expected TickerOutput structure:
{
"tickers": [
{
"poolAddress": "0x...",
"blockVolumeToken0": "1000000",
"blockVolumeToken1": "2000000",
"swapCount": 5,
"closePrice": "1.234",
"blockNumber": 12369621,
"timestamp": 1620000000
}
]
}For universal packages like uniswap-v3-forks:
# Test on Polygon
ENDPOINT=polygon.streamingfast.io:443 ./test.sh -s 22757547 -e +10
# Test on Arbitrum
ENDPOINT=arb-one.streamingfast.io:443 ./test.sh -s 1107 -e +10substreams packThis creates a .spkg file containing:
- Compiled WASM module
- Protobuf definitions
- Substreams manifest
- All dependencies
The output file will be named:
coinranking-uniswap-v3-forks-v0.2.0.spkg
# Inspect package contents
substreams info coinranking-uniswap-v3-forks-v0.2.0.spkg
# Test the package locally
substreams run coinranking-uniswap-v3-forks-v0.2.0.spkg \
map_v3_ticker_output \
--start-block 12369621 \
--stop-block +10substreams publish coinranking-uniswap-v3-forks-v0.2.0.spkgOr publish directly without creating a .spkg file first:
substreams publish substreams.yamlYou can also publish from a GitHub release URL:
substreams publish https://github.com/coinranking/substreams/releases/download/v0.2.0/coinranking-uniswap-v3-forks-v0.2.0.spkgAfter publishing, verify your package on the registry:
- Visit https://substreams.dev
- Search for your package name
- Check that the version and metadata are correct
Create a git tag for the published version:
git tag dexes/uniswap-v3-forks/v0.2.0
git push origin dexes/uniswap-v3-forks/v0.2.0- Update README with the new version number
- Add release notes if significant changes were made
- Update any integration examples
- Create a GitHub release with notes
- Notify users of breaking changes (if any)
- ✅ Test thoroughly before publishing
- ✅ Use semantic versioning consistently
- ✅ Include clear descriptions in
substreams.yaml - ✅ Test on multiple networks (for universal packages)
- ✅ Keep the output format consistent with
TickerOutput - ✅ Document any limitations or requirements
- ❌ Publish untested changes
- ❌ Break the output format without a major version bump
- ❌ Forget to update the version number
- ❌ Publish packages with compilation warnings
- ❌ Include sensitive information in the package
# Re-authenticate if token expires
substreams auth
# Check current authentication status
substreams registry list # Should work if authenticated# Clean build
cargo clean
cargo build --target wasm32-unknown-unknown --release
# Check for missing dependencies
cargo checkIf your .spkg exceeds size limits:
- Ensure you're building in release mode
- Check for unnecessary dependencies
- Remove debug symbols if present
Complete workflow for publishing the uniswap-v3-forks package:
# 1. Navigate to package
cd dexes/uniswap-v3-forks
# 2. Update version in substreams.yaml
# Edit: version: v0.2.0
# 3. Build
cargo build --target wasm32-unknown-unknown --release
# 4. Test
./test.sh -s 12369621 -e +100 -f
# 5. Pack
substreams pack
# 6. Publish
substreams publish coinranking-uniswap-v3-forks-v0.2.0.spkg
# 7. Tag
git tag dexes/uniswap-v3-forks/v0.2.0
git push origin dexes/uniswap-v3-forks/v0.2.0- Packages are immutable once published - you cannot overwrite a version
- The registry is public - all published packages are visible to everyone
- Package names should follow the format:
coinranking_[dex_name] - Descriptions should clearly state supported networks and DEX types
For issues with:
- Building/Testing: Check the README in the specific DEX folder
- Publishing: See Substreams documentation
- Registry: Visit substreams.dev or open an issue