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.
- By default, the
blockchains
parameter in the fsc-evm price macros references the blockchain directly by pointing to thetarget.database
text string in the dbt profile (removes_dev
). E.g.blockchains
=ethereum
. However, this default may be overwritten by updating thePRICES_BLOCKCHAINS
variable indbt_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.
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
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 |
{{ fsc_evm.bronze_complete_native_asset_metadata() }}
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
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 |
{{ fsc_evm.bronze_complete_native_prices() }}
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
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 |
{{ fsc_evm.bronze_complete_provider_asset_metadata() }}
This macro creates a table that retrieves provider prices from crosschain.silver.complete_provider_prices
.
fsc_evm.bronze_complete_provider_prices
This macro does not have any parameters.
{{ fsc_evm.bronze_complete_provider_prices() }}
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
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 |
{{ fsc_evm.bronze_complete_token_asset_metadata() }}
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
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 |
{{ fsc_evm.bronze_complete_token_prices() }}
This macro creates a table that retrieves Native asset metadata from <DATABASE>.bronze.complete_native_asset_metadata
.
fsc_evm.silver_complete_native_asset_metadata
This macro does not have any parameters.
{{ fsc_evm.silver_complete_native_asset_metadata() }}
This macro creates a table that retrieves Native asset prices from <DATABASE>.bronze.complete_native_prices
.
fsc_evm.silver_complete_native_prices
This macro does not have any parameters.
{{ fsc_evm.silver_complete_native_prices() }}
This macro creates a table that retrieves provider asset metadata from <DATABASE>.bronze.complete_provider_asset_metadata
.
fsc_evm.silver_complete_provider_asset_metadata
This macro does not have any parameters.
{{ fsc_evm.silver_complete_provider_asset_metadata() }}
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
This macro does not have any parameters.
{{ fsc_evm.silver_complete_provider_prices() }}
This macro creates a table that retrieves token asset metadata from <DATABASE>.bronze.complete_token_asset_metadata
.
fsc_evm.silver_complete_token_asset_metadata
This macro does not have any parameters.
{{ fsc_evm.silver_complete_token_asset_metadata() }}
This macro creates a table that retrieves token prices from <DATABASE>.bronze.complete_token_prices
.
fsc_evm.silver_complete_token_prices
This macro does not have any parameters.
{{ fsc_evm.silver_complete_token_prices() }}
This macro creates a table that retrieves asset metadata from <DATABASE>.silver.complete_provider_asset_metadata
.
fsc_evm.price_dim_asset_metadata
This macro does not have any parameters.
{{ fsc_evm.price_dim_asset_metadata() }}
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
This macro does not have any parameters.
{{ fsc_evm.price_ez_asset_metadata() }}
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
This macro does not have any parameters.
{{ fsc_evm.price_fact_prices_ohlc_hourly() }}
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
This macro does not have any parameters.
{{ fsc_evm.price_ez_prices_hourly() }}