solana-models/models/gold/defi/defi__fact_swaps.yml
tarikceric 8d19961ce6
Cleanup/decrease test time and docs update (#584)
* update docs

* update test range

* revert test
2024-06-17 10:46:30 -07:00

62 lines
2.6 KiB
YAML

version: 2
models:
- name: defi__fact_swaps
description: This table contains swaps performed on Jupiter, Orca, Raydium, Saber, Bonkswap, Dooar, Phoenix and Meteora swap programs. Intermediate swaps are aggregated over the DEX programs, so the values showcase the final mint/amount swap values. Ie. a swap on Jupiter that swaps SOL->USDC->mSOL->ETH would show the initial amount in and the final amount out of SOL->ETH. For Phoenix, we are not capturing swaps where there are separate transactions for placing the order and filling the order.
recent_date_filter: &recent_date_filter
config:
where: inserted_timestamp >= current_date - 7
columns:
- name: BLOCK_TIMESTAMP
description: "{{ doc('block_timestamp') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: BLOCK_ID
description: "{{ doc('block_id') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: TX_ID
description: "{{ doc('tx_id') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: SUCCEEDED
description: "{{ doc('tx_succeeded') }}"
tests:
- dbt_expectations.expect_column_to_exist
- name: SWAPPER
description: Address that initiated the swap
tests:
- dbt_expectations.expect_column_to_exist
- name: SWAP_FROM_AMOUNT
description: Total amount of the token sent in to initiate the swap
tests:
- dbt_expectations.expect_column_to_exist
- name: SWAP_FROM_MINT
description: Token being sent or swapped from
tests:
- dbt_expectations.expect_column_to_exist
- name: SWAP_TO_AMOUNT
description: Total amount of the token received in the swap
tests:
- dbt_expectations.expect_column_to_exist
- name: SWAP_TO_MINT
description: Token being received or swapped for
tests:
- dbt_expectations.expect_column_to_exist
- name: PROGRAM_ID
description: Token being received or swapped for
tests:
- dbt_expectations.expect_column_to_exist
- name: SWAP_PROGRAM
description: name of decentralized exchange used to perform the swap
tests:
- not_null: *recent_date_filter
- name: _LOG_ID
description: "Combination of TX_ID and event index"
tests:
- not_null: *recent_date_filter
- name: FACT_SWAPS_ID
description: '{{ doc("pk") }}'
- name: INSERTED_TIMESTAMP
description: '{{ doc("inserted_timestamp") }}'
- name: MODIFIED_TIMESTAMP
description: '{{ doc("modified_timestamp") }}'