version: 2
models:
  - name: defi__ez_dex_swaps
    description: "{{ doc('ez_dex_swaps') }}"
    recent_modified_date_filter: &recent_modified_date_filter
      config:
        where: modified_timestamp >= current_date - 7
    tests:
      - reference_tx_count_comparison:
          reference_table: 'defi__fact_swaps'
          id_column: 'tx_id'
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        data_tests:
          - not_null: *recent_modified_date_filter
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 2
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
      - name: SWAPPER
        description: "{{ doc('swaps_swapper') }}"
      - name: SWAP_FROM_AMOUNT
        description: "{{ doc('swaps_from_amt') }}"
      - name: SWAP_FROM_AMOUNT_USD
        description: "{{ doc('swap_from_amount_usd') }}"
      - name: SWAP_FROM_MINT
        description: "{{ doc('swaps_from_mint') }}"
      - name: SWAP_FROM_IS_VERIFIED
        description: "{{ doc('prices_is_verified') }}"
      - name: SWAP_FROM_SYMBOL
        description: "{{ doc('swap_from_symbol') }}"
      - name: SWAP_TO_AMOUNT
        description: "{{ doc('swaps_to_amt') }}"
      - name: SWAP_TO_AMOUNT_USD
        description: "{{ doc('swap_to_amount_usd') }}"
      - name: SWAP_TO_MINT
        description: "{{ doc('swaps_to_mint') }}"
      - name: SWAP_TO_IS_VERIFIED
        description: "{{ doc('prices_is_verified') }}"
      - name: SWAP_TO_SYMBOL
        description: "{{ doc('swap_to_symbol') }}"
      - name: PROGRAM_ID
        description: "{{ doc('program_id') }}" 
      - name: SWAP_PROGRAM
        description: "{{ doc('swap_program') }}"
      - name: _LOG_ID
        description: "{{ doc('log_id') }}"
      - name: EZ_SWAPS_ID
        description: "{{ doc('pk') }}"
        data_tests:
          - not_null: *recent_modified_date_filter
          - unique: *recent_modified_date_filter  
      - name: INSERTED_TIMESTAMP
        description: "{{ doc('inserted_timestamp') }}"   
      - name: MODIFIED_TIMESTAMP
        description: "{{ doc('modified_timestamp') }}" 