Macros: Prices Tables: Prices - FlipsideCrypto/fsc-evm GitHub Wiki

The following macros are intended to be used to create and maintain the silver and gold traces models. These macros can be accessed via version >= of the fsc-evm package. Macro variables are set and managed in the respective repo's dbt_project.yml file. Please see the fsc-evm installation instructions in the README for more details on how to access and utilize this macro effectively.

The Prices macros are used to create tables for the Prices pipeline, which references the pipeline established in the Crosschain repo.

Best Practices, Tips & Tricks

  • By default, the blockchains parameter in the fsc-evm price macros references the blockchain directly by pointing to the target.database text string in the dbt profile (removes _dev). E.g. blockchains = ethereum. However, this default may be overwritten by updating the PRICES_BLOCKCHAINS variable in dbt_project.yml, which accepts either a string ('ethereum') or an array (['ethereum','ethereum-other']), dependent on whether prices from multiple blockchains are required in one model.

bronze_complete_native_asset_metadata

Usage

This macro creates a table that retrieves metadata for Native assets based on the specified symbols and blockchains from crosschain.silver.complete_native_asset_metadata.

fsc_evm.bronze_complete_native_asset_metadata

Parameters

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

Parameter Type Default Description Variable
symbols String or Array - The symbols to filter the asset metadata. PRICES_SYMBOLS
blockchains String or Array Defaults to the lowercased target database name with _dev removed. The blockchains to filter the asset metadata. PRICES_BLOCKCHAINS

Example

{{ fsc_evm.bronze_complete_native_asset_metadata() }}

bronze_complete_native_prices

Usage

This macro creates a table that retrieves price data for Native assets based on the specified symbols and blockchains from crosschain.silver.complete_native_prices.

fsc_evm.bronze_complete_native_prices

Parameters

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

Parameter Type Default Description Variable
symbols String or Array - The symbols to filter the native prices. PRICES_SYMBOLS
blockchains String or Array Defaults to the lowercased target database name with _dev removed. The blockchains to filter the native prices. PRICES_BLOCKCHAINS

Example

{{ fsc_evm.bronze_complete_native_prices() }}

bronze_complete_provider_asset_metadata

Usage

This macro creates a table that retrieves raw, provider asset metadata filtered by specified platforms from crosschain.silver.complete_provider_asset_metadata.

fsc_evm.bronze_complete_provider_asset_metadata

Parameters

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

Parameter Type Default Description Variable
platforms String or Array - The platforms specific to the target blockchain for which the asset metadata is being retrieved. PRICES_PLATFORMS

Example

{{ fsc_evm.bronze_complete_provider_asset_metadata() }}

bronze_complete_provider_prices

Usage

This macro creates a table that retrieves provider prices from crosschain.silver.complete_provider_prices.

fsc_evm.bronze_complete_provider_prices

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.bronze_complete_provider_prices() }}

bronze_complete_token_asset_metadata

Usage

This macro creates a table that retrieves token asset metadata for specified token addresses and blockchains from crosschain.silver.complete_token_asset_metadata.

fsc_evm.bronze_complete_token_asset_metadata

Parameters

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

Parameter Type Default Description Variable
token_addresses String or Array - The addresses of the tokens for which metadata is being retrieved. PRICES_TOKEN_ADDRESSES
blockchains String or Array Defaults to the lowercased target database name with _dev removed. The blockchains to filter the token metadata by. PRICES_BLOCKCHAINS

Example

{{ fsc_evm.bronze_complete_token_asset_metadata() }}

bronze_complete_token_prices

Usage

This macro creates a table that retrieves token prices for specified token addresses and blockchains from crosschain.silver.complete_token_prices.

fsc_evm.bronze_complete_token_prices

Parameters

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

Parameter Type Default Description Variable
token_addresses String or Array - The addresses of the tokens for which prices are being retrieved. PRICES_TOKEN_ADDRESSES
blockchains String or Array Defaults to the lowercased target database name with _dev removed. The blockchains to filter the token prices by. PRICES_BLOCKCHAINS

Example

{{ fsc_evm.bronze_complete_token_prices() }}

silver_complete_native_asset_metadata

Usage

This macro creates a table that retrieves Native asset metadata from <DATABASE>.bronze.complete_native_asset_metadata.

fsc_evm.silver_complete_native_asset_metadata

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.silver_complete_native_asset_metadata() }}

silver_complete_native_prices

Usage

This macro creates a table that retrieves Native asset prices from <DATABASE>.bronze.complete_native_prices.

fsc_evm.silver_complete_native_prices

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.silver_complete_native_prices() }}

silver_complete_provider_asset_metadata

Usage

This macro creates a table that retrieves provider asset metadata from <DATABASE>.bronze.complete_provider_asset_metadata.

fsc_evm.silver_complete_provider_asset_metadata

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.silver_complete_provider_asset_metadata() }}

silver_complete_provider_prices

Usage

This macro creates a table that retrieves provider prices from <DATABASE>.bronze.complete_provider_prices by joining asset metadata.

fsc_evm.silver_complete_provider_prices

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.silver_complete_provider_prices() }}

silver_complete_token_asset_metadata

Usage

This macro creates a table that retrieves token asset metadata from <DATABASE>.bronze.complete_token_asset_metadata.

fsc_evm.silver_complete_token_asset_metadata

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.silver_complete_token_asset_metadata() }}

silver_complete_token_prices

Usage

This macro creates a table that retrieves token prices from <DATABASE>.bronze.complete_token_prices.

fsc_evm.silver_complete_token_prices

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.silver_complete_token_prices() }}

price_dim_asset_metadata

Usage

This macro creates a table that retrieves asset metadata from <DATABASE>.silver.complete_provider_asset_metadata.

fsc_evm.price_dim_asset_metadata

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.price_dim_asset_metadata() }}

price_ez_asset_metadata

Usage

This macro creates a table that retrieves both token and native asset metadata from <DATABASE>.silver.complete_token_asset_metadata and <DATABASE>.silver.complete_native_asset_metadata.

fsc_evm.price_ez_asset_metadata

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.price_ez_asset_metadata() }}

price_fact_prices_ohlc_hourly

Usage

This macro creates a table that retrieves hourly OHLC (Open, High, Low, Close) price data from <DATABASE>.silver.complete_provider_prices.

fsc_evm.price_fact_prices_ohlc_hourly

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.price_fact_prices_ohlc_hourly() }}

price_ez_prices_hourly

Usage

This macro creates a table that retrieves token prices for specified token addresses and blockchains from <DATABASE>.silver.complete_token_prices and <DATABASE>.silver.complete_native_prices.

fsc_evm.price_ez_prices_hourly

Parameters

This macro does not have any parameters.

Example

{{ fsc_evm.price_ez_prices_hourly() }}
⚠️ **GitHub.com Fallback** ⚠️