Skip to content

Latest commit

 

History

History

SecondaryPool

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Substreams Secondary Module

This is a Rust module designed for Substreams that focuses on handling secondary issue pools and related data.

Table of Contents

Introduction

The Substreams Secondary Module is a Rust module developed to detect pools, subscriptions events. This module is a crucial part of the Substreams project, which aims to provide high-performance blockchain indexing technology.

Installation

Before using the Substreams Secondary Module, ensure that you have Rust and substreams installed. Follow the official Rust installation guide: Rust Installation. Also, refer to the official Substreams installation guide: Substreams Installation.

After setting up Rust and Substreams, you can build and run this module.

Usage

To use the Substreams Primary Module, follow these steps:

  1. Generate Rust Code: Navigate to the module folder and execute the following command to generate Rust code for connecting to protobuf:
    substreams protogen substreams.yaml --exclude-paths="sf/substreams,google"
    
  2. Build the Rust Code: Run the following command within the module folder to build the Rust code:
    cargo build --target wasm32-unknown-unknown --release3.
    
  3. Execute the Module: To execute the module, run the following command in the module folder:
    substreams run -e <Protocol-Proto model> substreams.yaml <FUNCTION_NAME> --start-block 9561663 --stop-block +20
    

Replace with the desired protocol model. Supported protocol-Proto models are listed in the Verified Substreams README.

Functions

map_pools

Description: This function detects poolcreated event from blockchain and returns information about them.

map_trades

Description: This function detects Trades events under the address of poolcreated event at a perticular block and maps them to the appropriate data structures.

kv_out

Description: This function generates key-value operations based on the provided subscription data for the client interface.

Modules used

  1. abi: Contains Rust code for working with ABI.
  2. pb: Contains Rust code for protocol buffers.

License

BUSL-1.1.