version: 2
models:
  - name: silver__liquidity_pool_actions_saber
    tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - BLOCK_ID
            - TX_ID
            - ACTION_INDEX
          where: block_timestamp::date > current_date - 30
      - compare_model_subset:
          name: silver__liquidity_pool_actions_saber_business_logic_test
          compare_model: ref('testing__liquidity_pool_actions_saber')
          compare_columns: 
            - tx_id
            - action
            - liquidity_provider
            - liquidity_pool_address
            - amount
            - mint
          model_condition: "where tx_id in ('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')"
      - tx_excluded:
          name: silver__liquidity_pool_actions_saber_tx_excluded_test
          excluded_tx_ids:
            - 2S5L2ybzhSfEF51KLfcGyaTu1d5T69HUZK5wvZpHGFHGWPVpLd9ZxSVgE7UVZzQ2at1GJXQ3Sw5q4LRPTj8E664t
            - 4cAkGGDnshoyR9jxVi4gZFK6EXU48CjWLtrWHqHXDAdJiMXRdy1zdKtwJn3kqJ7mrAJAybyWerLgdy7PoDsX3UpX
    columns:
      - name: BLOCK_TIMESTAMP
        description: "{{ doc('block_timestamp') }}"
        tests:
          - not_null
          - dbt_expectations.expect_row_values_to_have_recent_data:
              datepart: day
              interval: 2
      - name: BLOCK_ID
        description: "{{ doc('block_id') }}"
        tests:
          - not_null
      - name: TX_ID
        description: "{{ doc('tx_id') }}"
        tests:
          - not_null
      - name: SUCCEEDED
        description: "{{ doc('tx_succeeded') }}"
        tests: 
          - not_null
      - name: PROGRAM_ID
        description: "{{ doc('program_id') }}"
        tests: 
          - not_null
      - name: ACTION
        description: "{{ doc('stake_pool_action') }}"
        tests: 
          - not_null 
      - name: LIQUIDITY_PROVIDER
        description: "Address withdrawing or depositing liquidity"
        tests: 
          - not_null
      - name: LIQUIDITY_POOL_ADDRESS
        description: "Address of Liquidity Pool"
        tests: 
          - not_null
      - name: AMOUNT
        description: "{{ doc('amount') }}"
        tests: 
          - not_null
      - name: MINT
        description: "{{ doc('mint') }}"
      - name: _INSERTED_TIMESTAMP
        description: "{{ doc('_inserted_timestamp') }}"
        tests: 
          - not_null
      - name: LIQUIDITY_POOL_ACTIONS_SABER_ID
        description: '{{ doc("pk") }}'   
        tests: 
          - unique
      - name: INSERTED_TIMESTAMP
        description: '{{ doc("inserted_timestamp") }}'   
        tests: 
          - not_null
      - name: MODIFIED_TIMESTAMP
        description: '{{ doc("modified_timestamp") }}' 
        tests: 
          - not_null