Macros: Streamline Requests: Decoder Requests - FlipsideCrypto/fsc-evm GitHub Wiki

The following macros are intended to be used to create and maintain various models. These macros can be accessed via version >=v1.0.0 of the fsc-evm package. Please see the fsc-evm installation instructions in the README for more details on how to access and utilize this macro effectively.

The Decoder Streamline Requests macros are used to request Decoded Event Logs and Traces data via custom AWS Lambda Decoder Functions.


streamline_decoded_logs_requests

Usage

This macro constructs a SQL query to retrieve decoded logs based on the specified model type. It uses a CTE to determine the block number lookback based on whether the model is real-time or historical. The query filters logs based on block numbers, timestamps, and checks for existing log_id to avoid duplicates. The results include log details and associated ABI data.

Note: In the case of the decoder history macros and subsequent history SQL files in each repo, the start and stop parameters must be listed first for the macro to function.

fsc_evm.streamline_decoded_logs_requests

Parameters

Note: Parameters with default values must be ordered after non-default parameters.

Parameter Type Default Description
start Integer - The starting block number for the query when using the history model. This is pulled from the file name. (Required when history is enabled)
stop Integer - The ending block number for the query when using the history model. This is pulled from the file name. (Required when history is enabled)
model_type String - Specifies the type of model being processed. Acceptable values are: 'realtime' or 'history'
query_limit Integer - Limits the number of results returned by the query.

Example:

{{ fsc_evm.streamline_decoded_logs_requests(
    start,
    stop,
    model_type='realtime',
    query_limit=1000
) }}

streamline_decoded_traces_requests

Usage

This macro constructs a SQL query to retrieve decoded traces based on the specified model type. It uses a CTE to determine the block number lookback for real-time processing. The query filters traces based on block numbers, timestamps, and checks for existing call_id to avoid duplicates. The results include trace details, function names, and associated ABI data.

Note: In the case of the decoder history macros and subsequent history SQL files in each repo, the start and stop parameters must be listed first for the macro to function.

fsc_evm.streamline_decoded_traces_requests

Parameters

Note: Parameters with default values must be ordered after non-default parameters.

Parameter Type Default Description
start Integer - The starting block number for the query when using the history model. This is pulled from the file name. (Required when history is enabled)
stop Integer - The ending block number for the query when using the history model. This is pulled from the file name. (Required when history is enabled)
model_type String - Specifies the type of model being processed. Acceptable values are: 'realtime' or 'history'
query_limit Integer - Limits the number of results returned by the query.

Example:

{{ fsc_evm.streamline_decoded_traces_requests(
    start,
    stop,
    model_type='history',
    query_limit=500
) }}