suilend silver models

This commit is contained in:
Eric Laurello 2025-09-05 14:17:06 -04:00
parent 2b219238ca
commit 04a84f7e15
9 changed files with 1327 additions and 3 deletions

112
CLAUDE.md
View File

@ -32,6 +32,21 @@ dbt test [-s] [dbt_model_name]
dbt run [-s] [dbt_model_name]
dbt run [-s] [path/to/dbt/models]
dbt run [-s] [tag:dbt_model_tag]
# Run models with specific profiles
dbt run --profile sui [-s] [model_name]
# Update Snowflake tags on models
dbt run --var '{"UPDATE_SNOWFLAKE_TAGS":True}' [-s] [model_name]
# Run with custom test threshold
dbt test --var '{"TEST_HOURS_THRESHOLD":48}' [-s] [model_name]
# Build dependencies (packages)
dbt deps
# Clean artifacts
dbt clean
```
## Data Modeling with dbt
@ -160,10 +175,23 @@ Every model must use this pattern:
materialized = "incremental",
unique_key = ["field1", "field2"],
merge_exclude_columns = ["inserted_timestamp"],
tags = ['gold','core']
tags = ['gold','core'],
cluster_by = ['block_timestamp::DATE'], -- for fact tables
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION ON EQUALITY(tx_hash, block_id);" -- for gold layer
) }}
```
### Standard Model Fields
Every model must include these fields:
```sql
SELECT
-- ... your fields ...
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
{{ dbt_utils.generate_surrogate_key(['field1', 'field2']) }} AS _id,
'{{ invocation_id }}' AS _invocation_id
```
### Incremental Processing Pattern
All models require proper incremental predicates:
```sql
@ -172,6 +200,8 @@ All models require proper incremental predicates:
SELECT MAX(modified_timestamp)
FROM {{ this }}
)
-- For bronze models, use dynamic range predicate
AND {{ incremental_predicate('_inserted_timestamp') }}
{% endif %}
```
@ -208,4 +238,82 @@ Follow Flipside's 4-section table documentation structure in `models/description
3. **Important Relationships**: Connections to other gold models
4. **Commonly-used Fields**: Key fields for analysis
Column documentation must include examples for Sui-specific concepts (objects, checkpoints, Move contracts).
Column documentation must include examples for Sui-specific concepts (objects, checkpoints, Move contracts).
## Key Macros and Utilities
### Streamline Integration
```sql
-- Query external streamline tables
{{ streamline_external_table_query(
model = "blocks_realtime",
partition_by = ["ROUND(checkpoint_timestamp, -1)"],
unique_key = "checkpoint",
order_by = ["checkpoint"]
) }}
```
### Common Utility Macros
- `create_sps()` - Creates stored procedures on run start
- `create_udfs()` - Creates user-defined functions on run start
- `add_database_or_schema_tags()` - Applies Snowflake tags
- `sequence_gaps()` - Detects gaps in sequential data (checkpoints)
- `dynamic_range_predicate()` - Optimizes incremental runs for bronze models
## Directory Structure
```
models/
├── bronze/ # Raw views from streamline external tables
│ ├── api/ # API response data
│ └── streamline/ # Real-time ingested data
├── silver/ # Parsed and transformed data
│ ├── core/ # Core blockchain data (blocks, transactions)
│ ├── defi/ # DeFi protocol data
│ └── nft/ # NFT-related data
├── gold/ # Analytics-ready tables
│ ├── core/ # fact_ and dim_ tables
│ ├── defi/ # DeFi analytics tables
│ ├── nft/ # NFT analytics tables
│ └── streamline/ # Complete/realtime views
├── descriptions/ # Documentation markdown files
│ ├── tables.md # Table descriptions with 4 standard sections
│ └── columns.md # Column-level documentation
└── tests/ # Custom test definitions
```
## Common Patterns
### Creating a New Model
1. Check upstream dependencies with `ref()` and `source()`
2. Apply standard configuration (incremental, unique_key, tags)
3. Include all required fields (timestamps, _id, _invocation_id)
4. Add incremental predicates for efficient processing
5. Create corresponding .yml file with tests and documentation
6. Write markdown documentation with 4 standard sections
### Working with External Tables
```sql
-- Bronze models typically query external tables
WITH base AS (
SELECT *
FROM {{ source('bronze_streamline', 'table_name') }}
{% if is_incremental() %}
WHERE _inserted_timestamp >= (
SELECT MAX(_inserted_timestamp) FROM {{ this }}
)
{% endif %}
)
```
### Model Dependencies Example
```sql
-- Silver model referencing bronze
SELECT * FROM {{ ref('bronze__streamline_checkpoints') }}
-- Gold model referencing silver
SELECT * FROM {{ ref('silver__transactions') }}
-- EZ view referencing fact table
SELECT * FROM {{ ref('core__fact_blocks') }}
```

View File

@ -74,6 +74,10 @@ Zero-based index ordering balance changes within a transaction. Tracks the seque
Fully qualified Move type identifier for coins/tokens. Format: {package}::{module}::{struct}. Example: '0x2::sui::SUI' for native SUI token. Essential for DeFi analytics, token classification, and cross-asset analysis.
{% enddocs %}
{% docs ctoken_amount %}
The amount of cTokens (certificate tokens) minted or burned in the transaction. These receipt tokens represent a share of the lending pool and accrue value as interest is earned. The amount is in raw units before decimal adjustment. Used for tracking pool shares and calculating redemption values. Example: 1000000 (1 cToken with 6 decimals).
{% enddocs %}
{% docs amount %}
Token quantity in the smallest unit (MIST for SUI). Integer value; 1 SUI = 1,000,000,000 MIST. Used for precise financial calculations, balance tracking, and token flow analysis. Example: 1000000000.
{% enddocs %}
@ -738,4 +742,252 @@ Boolean flag indicating whether the input token type was derived from transactio
{% docs token_out_from_txs %}
Boolean flag indicating whether the output token type was derived from transaction payload data rather than event data. True when the token type could not be determined from the event and was inferred from transaction type arguments. Important for data quality assessment and understanding token identification reliability. Example: true when event data was insufficient for token identification.
{% enddocs %}
{% enddocs %}
{% docs lending_market_id %}
The unique identifier of the lending market within SuiLend protocol. Each market represents a distinct lending pool with its own risk parameters, interest models, and collateral requirements. Used to track market-specific metrics, compare performance across markets, and analyze market segmentation. Example: '0xmarket123...'.
{% enddocs %}
{% docs liquidity_amount %}
The raw amount of liquidity borrowed from or deposited into the lending pool, expressed in the smallest unit of the asset (not decimal-adjusted). Represents the actual quantity of tokens moved in the transaction before applying decimal precision. Used for precise financial calculations and protocol accounting. Example: 1000000000 (for 1 token with 9 decimals).
{% enddocs %}
{% docs obligation_id %}
The unique identifier of a borrower's obligation/position in the SuiLend protocol. Represents the consolidated debt position that tracks all borrows, collateral, and health metrics for a specific user. Essential for position management, liquidation monitoring, and user portfolio analysis. Example: '0xobligation456...'.
{% enddocs %}
{% docs origination_fee_amount %}
The origination fee charged for initiating a new borrow, expressed in raw token units. Typically a percentage of the borrowed amount, serving as protocol revenue and risk compensation. Used for fee analysis, protocol revenue tracking, and cost assessment for borrowers. Example: 100000 (0.1% fee on 100M raw units).
{% enddocs %}
{% docs reserve_id %}
The unique identifier of the lending reserve in SuiLend. Each reserve manages a specific asset type, maintaining liquidity for lending/borrowing operations with defined interest rate models and risk parameters. Critical for reserve analytics, liquidity tracking, and rate model analysis. Example: '0xreserve789...'.
{% enddocs %}
{% docs suilend_borrows_id %}
Unique identifier for each borrow record in the SuiLend protocol, generated from transaction digest and event index. Ensures uniqueness and enables tracking of individual borrow events across the protocol's lifecycle. Example: 'hash123_index0'.
{% enddocs %}
{% docs lending_pool_address %}
The on-chain address of the SuiLend lending pool contract. Identifies the specific pool implementation handling deposits, borrows, and liquidations. Used for pool-level analytics, TVL calculations, and smart contract interaction tracking. Example: '0xpool123...'.
{% enddocs %}
{% docs depositor_address %}
The Sui address of the user making a deposit into the lending pool. Identifies the liquidity provider earning interest on their supplied assets. Used for depositor analytics, concentration analysis, and yield tracking. Example: '0xdepositor123...'.
{% enddocs %}
{% docs deposit_asset %}
The type identifier of the asset being deposited into the lending pool. Fully qualified Move type in format {package}::{module}::{struct}. Essential for multi-asset pool analysis and asset allocation tracking. Example: '0x2::sui::SUI'.
{% enddocs %}
{% docs deposit_amount_raw %}
The raw amount deposited into the lending pool, expressed in the smallest unit of the asset. Represents actual tokens supplied before decimal adjustment. Critical for TVL calculations and liquidity analysis. Example: 5000000000 (5 SUI).
{% enddocs %}
{% docs deposit_rate %}
The annual percentage yield (APY) or interest rate for deposits at the time of transaction. Represents the return depositors earn on their supplied liquidity. Used for yield analysis and rate comparison. Example: 0.0325 (3.25% APY).
{% enddocs %}
{% docs shares_minted_raw %}
The amount of receipt/share tokens minted to represent the deposit position. These tokens accrue value as interest is earned and can be redeemed for the underlying asset plus interest. Example: 1000000 shares.
{% enddocs %}
{% docs reserve_address %}
The address of the reserve managing this asset within the lending protocol. Controls interest rate models, collateral factors, and liquidation parameters. Used for reserve-level analytics and configuration tracking. Example: '0xreserve123...'.
{% enddocs %}
{% docs total_deposits_after %}
Total amount of the asset deposited in the pool after this transaction, in raw units. Represents the pool's total supplied liquidity available for borrowing. Critical for TVL tracking and utilization calculations. Example: 1000000000000.
{% enddocs %}
{% docs utilization_rate_after %}
The pool's utilization rate after this transaction, expressed as a decimal. Calculated as total borrows / total deposits. Drives interest rate models and indicates lending market efficiency. Example: 0.75 (75% utilized).
{% enddocs %}
{% docs on_behalf_of %}
The address on whose behalf the deposit is made, if different from the transaction sender. Enables delegated deposits and position management. Used for tracking beneficial ownership and proxy patterns. Example: '0xbeneficiary123...'.
{% enddocs %}
{% docs referral_code %}
Referral code used for tracking deposit/borrow origination sources. Enables affiliate programs and user acquisition analytics. Used for marketing attribution and incentive distribution. Example: 'REF123'.
{% enddocs %}
{% docs is_collateral %}
Boolean flag indicating whether the deposited asset is enabled as collateral for borrowing. Determines borrowing power and liquidation risk. Critical for risk analysis and collateral management. Example: true.
{% enddocs %}
{% docs suilend_deposits_id %}
Unique identifier for each deposit record in the SuiLend protocol, generated from transaction digest and event index. Ensures uniqueness and enables tracking of individual deposit events. Example: 'hash456_index1'.
{% enddocs %}
{% docs liquidator_address %}
The Sui address of the account performing the liquidation. Liquidators repay undercollateralized debt in exchange for collateral at a discount. Used for liquidator profitability analysis and MEV studies. Example: '0xliquidator123...'.
{% enddocs %}
{% docs borrower_address %}
The Sui address of the borrower whose position is being liquidated or who is taking out a loan. Identifies the account with debt obligations. Used for risk analysis and borrower behavior tracking. Example: '0xborrower123...'.
{% enddocs %}
{% docs debt_asset %}
The asset type being repaid during liquidation or regular repayment. Identifies which borrowed asset is being settled. Essential for debt composition analysis and repayment tracking. Example: '0x2::sui::SUI'.
{% enddocs %}
{% docs debt_amount_repaid_raw %}
The amount of debt repaid during liquidation, in raw token units. Represents the borrowed asset amount that the liquidator pays to acquire collateral. Used for liquidation volume analysis. Example: 1000000000.
{% enddocs %}
{% docs collateral_asset %}
The asset type seized as collateral during liquidation. Identifies which deposited asset is forfeited when a position becomes undercollateralized. Critical for collateral risk analysis. Example: '0xtoken::usdc::USDC'.
{% enddocs %}
{% docs collateral_amount_seized_raw %}
The amount of collateral seized during liquidation, in raw token units. Includes the liquidation bonus/discount received by the liquidator. Used for liquidation profitability calculations. Example: 1100000000.
{% enddocs %}
{% docs liquidation_bonus_raw %}
The bonus amount received by liquidators as incentive, in raw token units. Represents the discount on collateral that compensates liquidators for maintaining protocol solvency. Example: 100000000 (10% bonus).
{% enddocs %}
{% docs liquidator_bonus_amount %}
The bonus amount received by the liquidator as an incentive for performing the liquidation, in raw token units. This is the extra collateral amount beyond the debt repaid that compensates the liquidator. Example: 50000000 (5% bonus on a 1B unit liquidation).
{% enddocs %}
{% docs repay_amount %}
The amount of debt repaid during the liquidation, in raw token units. This is the borrowed asset amount that the liquidator pays to the protocol to acquire the collateral. Example: 1000000000 (1 token with 9 decimals).
{% enddocs %}
{% docs repay_coin_type %}
The coin/token type being repaid during the liquidation. Identifies which borrowed asset is being settled to clear the undercollateralized debt. Format: {package}::{module}::{struct}. Example: '0x2::sui::SUI'.
{% enddocs %}
{% docs repay_reserve_id %}
The reserve ID of the asset being repaid during liquidation. Links to the specific reserve managing this borrowed asset within the lending protocol. Example: '0xreserve123...'.
{% enddocs %}
{% docs withdraw_amount %}
The amount of collateral withdrawn/seized during liquidation, in raw token units. This is the collateral asset amount received by the liquidator, including any liquidation bonus. Example: 1050000000 (includes 5% bonus).
{% enddocs %}
{% docs withdraw_coin_type %}
The coin/token type being withdrawn as collateral during liquidation. Identifies which deposited asset is being seized from the liquidated position. Format: {package}::{module}::{struct}. Example: '0xtoken::usdc::USDC'.
{% enddocs %}
{% docs withdraw_reserve_id %}
The reserve ID of the collateral asset being withdrawn during liquidation. Links to the specific reserve managing this collateral asset. Example: '0xreserve456...'.
{% enddocs %}
{% docs protocol_fee_amount %}
The protocol fee charged on the liquidation, in raw token units. This fee goes to the protocol treasury or insurance fund as revenue for maintaining the lending system. Example: 10000000.
{% enddocs %}
{% docs health_factor_before %}
The borrower's health factor before liquidation or transaction. Values below 1.0 indicate undercollateralization and liquidation eligibility. Used for risk monitoring and liquidation analysis. Example: 0.95.
{% enddocs %}
{% docs health_factor_after %}
The borrower's health factor after liquidation or repayment. Shows position improvement post-transaction. Used for measuring liquidation effectiveness and position recovery. Example: 1.15.
{% enddocs %}
{% docs protocol_fee_raw %}
Protocol fee charged on liquidations or other operations, in raw token units. Represents revenue for the protocol treasury or insurance fund. Used for protocol revenue analysis. Example: 50000.
{% enddocs %}
{% docs receive_atoken %}
Boolean indicating whether the liquidator receives aTokens (receipt tokens) or the underlying asset. Affects liquidator's position and redemption requirements. Example: false.
{% enddocs %}
{% docs liquidation_type %}
The type of liquidation performed (e.g., partial, full, flash). Indicates liquidation strategy and scope. Used for liquidation pattern analysis and efficiency studies. Example: 'partial'.
{% enddocs %}
{% docs suilend_liquidations_id %}
Unique identifier for each liquidation record in the SuiLend protocol, generated from transaction digest and event index. Ensures uniqueness and enables tracking of individual liquidation events. Example: 'hash789_index2'.
{% enddocs %}
{% docs repayer_address %}
The Sui address making the repayment, which may differ from the borrower (e.g., third-party repayment). Enables debt settlement patterns and proxy repayment analysis. Example: '0xrepayer123...'.
{% enddocs %}
{% docs repay_asset %}
The asset type being repaid to settle outstanding debt. Identifies which borrowed asset is being returned to the pool. Essential for repayment flow analysis. Example: '0x2::sui::SUI'.
{% enddocs %}
{% docs repay_amount_raw %}
The total amount repaid including principal and interest, in raw token units. Represents the complete payment reducing the debt position. Used for repayment volume tracking. Example: 1050000000.
{% enddocs %}
{% docs principal_amount_raw %}
The principal portion of the repayment, in raw token units. Represents the original borrowed amount being repaid, excluding interest. Used for loan amortization analysis. Example: 1000000000.
{% enddocs %}
{% docs interest_amount_raw %}
The interest portion of the repayment, in raw token units. Represents accrued interest paid to liquidity providers. Critical for protocol revenue and APY calculations. Example: 50000000.
{% enddocs %}
{% docs remaining_debt_raw %}
The outstanding debt balance after repayment, in raw token units. Shows the remaining obligation requiring future settlement. Used for position tracking and risk assessment. Example: 500000000.
{% enddocs %}
{% docs borrow_rate %}
The interest rate charged on borrows at the time of transaction. Determines borrowing cost and protocol revenue generation. Used for rate analysis and cost calculations. Example: 0.0525 (5.25% APR).
{% enddocs %}
{% docs is_full_repayment %}
Boolean flag indicating whether the repayment fully settles the debt position. Distinguishes between partial and complete loan closures. Used for loan lifecycle analysis. Example: true.
{% enddocs %}
{% docs use_reserve_funds %}
Boolean indicating whether protocol reserve funds were used for the repayment. Relevant for protocol treasury operations and emergency procedures. Example: false.
{% enddocs %}
{% docs rate_mode %}
The interest rate type for the loan (e.g., stable, variable). Determines how interest accrues over the loan lifetime. Used for rate risk analysis and product usage tracking. Example: 'variable'.
{% enddocs %}
{% docs suilend_repayments_id %}
Unique identifier for each repayment record in the SuiLend protocol, generated from transaction digest and event index. Ensures uniqueness and enables tracking of individual repayment events. Example: 'hash012_index3'.
{% enddocs %}
{% docs withdrawer_address %}
The Sui address initiating the withdrawal from the lending pool. Identifies the user reclaiming their deposited liquidity plus earned interest. Used for liquidity flow analysis. Example: '0xwithdrawer123...'.
{% enddocs %}
{% docs recipient_address %}
The Sui address receiving the withdrawn funds, which may differ from the withdrawer. Enables withdrawal routing and beneficiary tracking. Used for fund flow analysis. Example: '0xrecipient123...'.
{% enddocs %}
{% docs withdraw_asset %}
The asset type being withdrawn from the lending pool. Identifies which deposited asset is being reclaimed. Essential for liquidity tracking and asset flow analysis. Example: '0x2::sui::SUI'.
{% enddocs %}
{% docs withdraw_amount_raw %}
The amount withdrawn from the pool, in raw token units. Represents deposited principal plus earned interest being reclaimed. Used for liquidity outflow tracking. Example: 1025000000.
{% enddocs %}
{% docs shares_burned_raw %}
The amount of receipt/share tokens burned to process the withdrawal. These tokens are exchanged for the underlying asset plus accrued interest. Example: 1000000 shares.
{% enddocs %}
{% docs interest_earned_raw %}
The interest earned on the deposit, in raw token units. Represents the yield generated during the deposit period. Used for return calculations and yield analysis. Example: 25000000.
{% enddocs %}
{% docs withdraw_rate %}
The exchange rate between shares and underlying assets at withdrawal time. Reflects accumulated interest and protocol performance. Used for yield calculations. Example: 1.025.
{% enddocs %}
{% docs user_balance_after_raw %}
The user's remaining balance in the pool after withdrawal, in raw token units. Shows continued exposure to the lending pool. Used for position tracking. Example: 100000000.
{% enddocs %}
{% docs is_max_withdraw %}
Boolean indicating whether this is a maximum withdrawal (all available funds). Distinguishes between partial and complete position closures. Used for user behavior analysis. Example: true.
{% enddocs %}
{% docs is_emergency_withdraw %}
Boolean flag for emergency withdrawals bypassing normal procedures. Indicates protocol stress conditions or user safety measures. Critical for risk monitoring. Example: false.
{% enddocs %}
{% docs suilend_withdraws_id %}
Unique identifier for each withdrawal record in the SuiLend protocol, generated from transaction digest and event index. Ensures uniqueness and enables tracking of individual withdrawal events. Example: 'hash345_index4'.
{% enddocs %}

View File

@ -43,6 +43,26 @@ Fact table decomposing every transaction on the Sui blockchain into its constitu
Enhanced fact table providing comprehensive cross-chain bridge analytics by consolidating bridge-related events from multiple protocols (Sui Bridge, Wormhole) into a unified dataset. Each row represents a single cross-chain asset movement event enriched with protocol metadata, token information, and USD pricing. Serves as the primary table for cross-chain DeFi analysis, bridge protocol comparison, and capital flow tracking by normalizing bridge events across different protocols into a consistent format. The table automatically applies decimal precision adjustments and USD conversions, enabling direct comparison of bridge volumes and user activity across different chains and token types. Includes complete transaction context, source/destination chain mapping, and protocol identification to support comprehensive cross-chain analytics, security monitoring, and risk assessment. Essential for DeFi dashboards, bridge protocol analysis, and multi-chain ecosystem studies that require unified cross-chain data and standardized bridge event tracking.
{% enddocs %}
{% docs silver_lending__suilend_borrows %}
Tracks borrowing events from the SuiLend lending protocol on Sui. Each row represents a single borrow transaction where users obtain liquidity from lending pools against their deposited collateral. Includes the borrowed asset type, liquidity amount, origination fees, and unique identifiers for the lending market, reserve, and borrower obligation. Essential for analyzing lending demand, utilization rates, and risk exposure across SuiLend markets. Enables tracking of individual borrower positions, protocol revenue from origination fees, and overall lending market dynamics.
{% enddocs %}
{% docs silver_lending__suilend_deposits %}
Tracks deposit/supply events into SuiLend lending pools. Each row captures when users provide liquidity to the protocol's reserves, earning interest through receipt tokens. Includes deposited asset details, raw amounts, share tokens minted, and utilization metrics post-deposit. Enables analysis of liquidity provision patterns, deposit concentration, yield optimization strategies, and protocol TVL growth. Supports tracking of individual depositor positions, collateral enablement, and the relationship between deposits and protocol utilization rates.
{% enddocs %}
{% docs silver_lending__suilend_liquidations %}
Tracks liquidation events in the SuiLend protocol when borrower positions become undercollateralized. Each record documents the liquidation process including the liquidator, borrower, debt repaid, collateral seized, and liquidation bonuses. Captures health factor transitions and protocol fees from liquidation events. Critical for risk management analysis, liquidator profitability assessment, and protocol stability monitoring. Enables tracking of liquidation cascades, market stress conditions, and the effectiveness of risk parameters.
{% enddocs %}
{% docs silver_lending__suilend_repayments %}
Tracks loan repayment events in the SuiLend protocol. Each row represents a borrower repaying their outstanding debt, capturing principal and interest components separately. Includes remaining debt balances, health factor improvements, and repayment types (partial vs full). Essential for analyzing borrower behavior, interest accrual patterns, and loan lifecycle dynamics. Supports protocol revenue analysis through interest payments and tracking of position health improvements post-repayment.
{% enddocs %}
{% docs silver_lending__suilend_withdraws %}
Tracks withdrawal/redemption events from SuiLend lending pools. Each record captures when depositors reclaim their supplied liquidity plus earned interest by burning receipt tokens. Includes withdrawn amounts, shares burned, interest earned, and post-withdrawal utilization metrics. Enables analysis of liquidity dynamics, depositor returns, and protocol stability under varying withdrawal patterns. Supports tracking of emergency withdrawals, maximum withdrawal events, and the impact of withdrawals on pool utilization and lending rates.
{% enddocs %}
{% docs defi__ez_dex_swaps %}
## Description
This table provides a comprehensive view of decentralized exchange (DEX) swap activity across the Sui blockchain ecosystem, enriched with token pricing, metadata, and user labels. It consolidates swap events from seven major DEX protocols (Cetus, Turbos, Bluefin, Aftermath AMM, FlowX, DeepBook, and Momentum) into a standardized format with USD valuations, token metadata, and enhanced labeling. The model transforms raw swap data by adding price information, decimal-adjusted amounts, USD volume calculations, and human-readable labels for platforms, pools, and traders. This enables cross-protocol DeFi analytics, volume comparisons, and comprehensive trading pattern analysis.

View File

@ -0,0 +1,623 @@
version: 2
models:
- name: silver_lending__suilend_borrows
description: "{{ doc('silver_lending__suilend_borrows') }}"
config:
contract:
enforced: true
columns:
- name: CHECKPOINT_NUMBER
data_type: NUMBER(18,0)
description: "{{ doc('checkpoint_number') }}"
tests:
- not_null
- name: BLOCK_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('block_timestamp') }}"
tests:
- not_null
- name: TX_DIGEST
data_type: VARCHAR
description: "{{ doc('tx_digest') }}"
tests:
- not_null
- name: TX_SENDER
data_type: VARCHAR
description: "{{ doc('tx_sender') }}"
tests:
- not_null
- name: EVENT_INDEX
data_type: NUMBER(18,0)
description: "{{ doc('event_index') }}"
tests:
- not_null
- name: TYPE
data_type: VARCHAR
description: "{{ doc('type') }}"
- name: EVENT_MODULE
data_type: VARCHAR
description: "{{ doc('event_module') }}"
tests:
- not_null
- name: EVENT_RESOURCE
data_type: VARCHAR
description: "{{ doc('event_resource') }}"
- name: PACKAGE_ID
data_type: VARCHAR
description: "{{ doc('package_id') }}"
tests:
- not_null
- name: TRANSACTION_MODULE
data_type: VARCHAR
description: "{{ doc('transaction_module') }}"
- name: COIN_TYPE
data_type: VARCHAR
description: "{{ doc('coin_type') }}"
tests:
- not_null
- name: LENDING_MARKET_ID
data_type: VARCHAR
description: "{{ doc('lending_market_id') }}"
tests:
- not_null
- name: LIQUIDITY_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('liquidity_amount') }}"
tests:
- not_null
- dbt_utils.expression_is_true:
expression: "> 0"
- name: OBLIGATION_ID
data_type: VARCHAR
description: "{{ doc('obligation_id') }}"
tests:
- not_null
- name: ORIGINATION_FEE_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('origination_fee_amount') }}"
tests:
- dbt_utils.expression_is_true:
expression: ">= 0"
- name: RESERVE_ID
data_type: VARCHAR
description: "{{ doc('reserve_id') }}"
tests:
- not_null
- name: SUILEND_BORROWS_ID
data_type: VARCHAR
description: "{{ doc('suilend_borrows_id') }}"
tests:
- not_null
- unique
- name: INSERTED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('inserted_timestamp') }}"
- name: MODIFIED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('modified_timestamp') }}"
- name: _INVOCATION_ID
data_type: TEXT
description: "{{ doc('_invocation_id') }}"
tests:
- dbt_utils.recency:
datepart: hour
interval: 12
field: block_timestamp
- name: silver_lending__suilend_deposits
description: "{{ doc('silver_lending__suilend_deposits') }}"
config:
contract:
enforced: true
columns:
- name: CHECKPOINT_NUMBER
data_type: NUMBER(18,0)
description: "{{ doc('checkpoint_number') }}"
tests:
- not_null
- name: BLOCK_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('block_timestamp') }}"
tests:
- not_null
- name: TX_DIGEST
data_type: VARCHAR
description: "{{ doc('tx_digest') }}"
tests:
- not_null
- name: TX_SENDER
data_type: VARCHAR
description: "{{ doc('tx_sender') }}"
tests:
- not_null
- name: EVENT_INDEX
data_type: NUMBER(18,0)
description: "{{ doc('event_index') }}"
tests:
- not_null
- name: TYPE
data_type: VARCHAR
description: "{{ doc('type') }}"
- name: EVENT_MODULE
data_type: VARCHAR
description: "{{ doc('event_module') }}"
tests:
- not_null
- name: EVENT_RESOURCE
data_type: VARCHAR
description: "{{ doc('event_resource') }}"
- name: PACKAGE_ID
data_type: VARCHAR
description: "{{ doc('package_id') }}"
tests:
- not_null
- name: TRANSACTION_MODULE
data_type: VARCHAR
description: "{{ doc('transaction_module') }}"
- name: COIN_TYPE
data_type: VARCHAR
description: "{{ doc('coin_type') }}"
tests:
- not_null
- name: CTOKEN_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('ctoken_amount') }}"
tests:
- not_null
- dbt_utils.expression_is_true:
expression: "> 0"
- name: LENDING_MARKET_ID
data_type: VARCHAR
description: "{{ doc('lending_market_id') }}"
tests:
- not_null
- name: OBLIGATION_ID
data_type: VARCHAR
description: "{{ doc('obligation_id') }}"
tests:
- not_null
- name: RESERVE_ID
data_type: VARCHAR
description: "{{ doc('reserve_id') }}"
tests:
- not_null
- name: SUILEND_DEPOSITS_ID
data_type: VARCHAR
description: "{{ doc('suilend_deposits_id') }}"
tests:
- not_null
- unique
- name: INSERTED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('inserted_timestamp') }}"
- name: MODIFIED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('modified_timestamp') }}"
- name: _INVOCATION_ID
data_type: TEXT
description: "{{ doc('_invocation_id') }}"
tests:
- dbt_utils.recency:
datepart: hour
interval: 12
field: block_timestamp
- name: silver_lending__suilend_liquidations
description: "{{ doc('silver_lending__suilend_liquidations') }}"
config:
contract:
enforced: true
columns:
- name: CHECKPOINT_NUMBER
data_type: NUMBER(18,0)
description: "{{ doc('checkpoint_number') }}"
tests:
- not_null
- name: BLOCK_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('block_timestamp') }}"
tests:
- not_null
- name: TX_DIGEST
data_type: VARCHAR
description: "{{ doc('tx_digest') }}"
tests:
- not_null
- name: TX_SENDER
data_type: VARCHAR
description: "{{ doc('tx_sender') }}"
tests:
- not_null
- name: EVENT_INDEX
data_type: NUMBER(18,0)
description: "{{ doc('event_index') }}"
tests:
- not_null
- name: TYPE
data_type: VARCHAR
description: "{{ doc('type') }}"
- name: EVENT_MODULE
data_type: VARCHAR
description: "{{ doc('event_module') }}"
tests:
- not_null
- name: EVENT_RESOURCE
data_type: VARCHAR
description: "{{ doc('event_resource') }}"
- name: PACKAGE_ID
data_type: VARCHAR
description: "{{ doc('package_id') }}"
tests:
- not_null
- name: TRANSACTION_MODULE
data_type: VARCHAR
description: "{{ doc('transaction_module') }}"
- name: LENDING_MARKET_ID
data_type: VARCHAR
description: "{{ doc('lending_market_id') }}"
tests:
- not_null
- name: LIQUIDATOR_BONUS_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('liquidator_bonus_amount') }}"
tests:
- dbt_utils.expression_is_true:
expression: ">= 0"
- name: OBLIGATION_ID
data_type: VARCHAR
description: "{{ doc('obligation_id') }}"
tests:
- not_null
- name: PROTOCOL_FEE_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('protocol_fee_amount') }}"
tests:
- dbt_utils.expression_is_true:
expression: ">= 0"
- name: REPAY_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('repay_amount') }}"
tests:
- not_null
- dbt_utils.expression_is_true:
expression: "> 0"
- name: REPAY_COIN_TYPE
data_type: VARCHAR
description: "{{ doc('repay_coin_type') }}"
tests:
- not_null
- name: REPAY_RESERVE_ID
data_type: VARCHAR
description: "{{ doc('repay_reserve_id') }}"
tests:
- not_null
- name: WITHDRAW_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('withdraw_amount') }}"
tests:
- not_null
- dbt_utils.expression_is_true:
expression: "> 0"
- name: WITHDRAW_COIN_TYPE
data_type: VARCHAR
description: "{{ doc('withdraw_coin_type') }}"
tests:
- not_null
- name: WITHDRAW_RESERVE_ID
data_type: VARCHAR
description: "{{ doc('withdraw_reserve_id') }}"
tests:
- not_null
- name: SUILEND_LIQUIDATIONS_ID
data_type: VARCHAR
description: "{{ doc('suilend_liquidations_id') }}"
tests:
- not_null
- unique
- name: INSERTED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('inserted_timestamp') }}"
- name: MODIFIED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('modified_timestamp') }}"
- name: _INVOCATION_ID
data_type: TEXT
description: "{{ doc('_invocation_id') }}"
tests:
- dbt_utils.recency:
datepart: hour
interval: 12
field: block_timestamp
- name: silver_lending__suilend_repayments
description: "{{ doc('silver_lending__suilend_repayments') }}"
config:
contract:
enforced: true
columns:
- name: CHECKPOINT_NUMBER
data_type: NUMBER(18,0)
description: "{{ doc('checkpoint_number') }}"
tests:
- not_null
- name: BLOCK_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('block_timestamp') }}"
tests:
- not_null
- name: TX_DIGEST
data_type: VARCHAR
description: "{{ doc('tx_digest') }}"
tests:
- not_null
- name: TX_SENDER
data_type: VARCHAR
description: "{{ doc('tx_sender') }}"
tests:
- not_null
- name: EVENT_INDEX
data_type: NUMBER(18,0)
description: "{{ doc('event_index') }}"
tests:
- not_null
- name: TYPE
data_type: VARCHAR
description: "{{ doc('type') }}"
- name: EVENT_MODULE
data_type: VARCHAR
description: "{{ doc('event_module') }}"
tests:
- not_null
- name: EVENT_RESOURCE
data_type: VARCHAR
description: "{{ doc('event_resource') }}"
- name: PACKAGE_ID
data_type: VARCHAR
description: "{{ doc('package_id') }}"
tests:
- not_null
- name: TRANSACTION_MODULE
data_type: VARCHAR
description: "{{ doc('transaction_module') }}"
- name: COIN_TYPE
data_type: VARCHAR
description: "{{ doc('coin_type') }}"
tests:
- not_null
- name: LENDING_MARKET_ID
data_type: VARCHAR
description: "{{ doc('lending_market_id') }}"
tests:
- not_null
- name: LIQUIDITY_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('liquidity_amount') }}"
tests:
- not_null
- dbt_utils.expression_is_true:
expression: "> 0"
- name: OBLIGATION_ID
data_type: VARCHAR
description: "{{ doc('obligation_id') }}"
tests:
- not_null
- name: RESERVE_ID
data_type: VARCHAR
description: "{{ doc('reserve_id') }}"
tests:
- not_null
- name: SUILEND_REPAYMENTS_ID
data_type: VARCHAR
description: "{{ doc('suilend_repayments_id') }}"
tests:
- not_null
- unique
- name: INSERTED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('inserted_timestamp') }}"
- name: MODIFIED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('modified_timestamp') }}"
- name: _INVOCATION_ID
data_type: TEXT
description: "{{ doc('_invocation_id') }}"
tests:
- dbt_utils.recency:
datepart: hour
interval: 12
field: block_timestamp
- name: silver_lending__suilend_withdraws
description: "{{ doc('silver_lending__suilend_withdraws') }}"
config:
contract:
enforced: true
columns:
- name: CHECKPOINT_NUMBER
data_type: NUMBER(18,0)
description: "{{ doc('checkpoint_number') }}"
tests:
- not_null
- name: BLOCK_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('block_timestamp') }}"
tests:
- not_null
- name: TX_DIGEST
data_type: VARCHAR
description: "{{ doc('tx_digest') }}"
tests:
- not_null
- name: TX_SENDER
data_type: VARCHAR
description: "{{ doc('tx_sender') }}"
tests:
- not_null
- name: EVENT_INDEX
data_type: NUMBER(18,0)
description: "{{ doc('event_index') }}"
tests:
- not_null
- name: TYPE
data_type: VARCHAR
description: "{{ doc('type') }}"
- name: EVENT_MODULE
data_type: VARCHAR
description: "{{ doc('event_module') }}"
tests:
- not_null
- name: EVENT_RESOURCE
data_type: VARCHAR
description: "{{ doc('event_resource') }}"
- name: PACKAGE_ID
data_type: VARCHAR
description: "{{ doc('package_id') }}"
tests:
- not_null
- name: TRANSACTION_MODULE
data_type: VARCHAR
description: "{{ doc('transaction_module') }}"
- name: COIN_TYPE
data_type: VARCHAR
description: "{{ doc('coin_type') }}"
tests:
- not_null
- name: CTOKEN_AMOUNT
data_type: NUMBER(38,0)
description: "{{ doc('ctoken_amount') }}"
tests:
- not_null
- dbt_utils.expression_is_true:
expression: "> 0"
- name: LENDING_MARKET_ID
data_type: VARCHAR
description: "{{ doc('lending_market_id') }}"
tests:
- not_null
- name: OBLIGATION_ID
data_type: VARCHAR
description: "{{ doc('obligation_id') }}"
tests:
- not_null
- name: RESERVE_ID
data_type: VARCHAR
description: "{{ doc('reserve_id') }}"
tests:
- not_null
- name: SUILEND_WITHDRAWS_ID
data_type: VARCHAR
description: "{{ doc('suilend_withdraws_id') }}"
tests:
- not_null
- unique
- name: INSERTED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('inserted_timestamp') }}"
- name: MODIFIED_TIMESTAMP
data_type: TIMESTAMP_NTZ
description: "{{ doc('modified_timestamp') }}"
- name: _INVOCATION_ID
data_type: TEXT
description: "{{ doc('_invocation_id') }}"
tests:
- dbt_utils.recency:
datepart: hour
interval: 12
field: block_timestamp

View File

@ -0,0 +1,64 @@
-- depends_on: {{ ref('core__fact_events') }}
{{ config (
materialized = "incremental",
unique_key = "suilend_borrows_id",
cluster_by = ['modified_timestamp::DATE'],
incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"],
merge_exclude_columns = ["inserted_timestamp"],
tags = ['silver','defi','lending','non_core']
) }}
WITH suilend_events AS (
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_address,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json,
modified_timestamp
FROM
{{ ref('core__fact_events') }}
WHERE
tx_succeeded
AND event_resource = 'BorrowEvent'
AND event_address = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf'
{% if is_incremental() %}
AND modified_timestamp >= (
SELECT
COALESCE(MAX(modified_timestamp), '1900-01-01' :: TIMESTAMP) AS modified_timestamp
FROM
{{ this }})
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json :coin_type :name :: STRING AS coin_type,
parsed_json :lending_market_id :: STRING AS lending_market_id,
parsed_json :liquidity_amount :: bigint AS liquidity_amount,
parsed_json :obligation_id :: STRING AS obligation_id,
parsed_json :origination_fee_amount :: INT AS origination_fee_amount,
parsed_json :reserve_id :: STRING AS reserve_id,
{{ dbt_utils.generate_surrogate_key(['tx_digest', 'event_index']) }} AS suilend_borrows_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
suilend_events

View File

@ -0,0 +1,63 @@
-- depends_on: {{ ref('core__fact_events') }}
{{ config (
materialized = "incremental",
unique_key = "suilend_deposits_id",
cluster_by = ['modified_timestamp::DATE'],
incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"],
merge_exclude_columns = ["inserted_timestamp"],
tags = ['silver','defi','lending','non_core']
) }}
WITH suilend_events AS (
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_address,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json,
modified_timestamp
FROM
{{ ref('core__fact_events') }}
WHERE
tx_succeeded
AND event_resource = 'DepositEvent'
AND event_address = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf'
{% if is_incremental() %}
AND modified_timestamp >= (
SELECT
COALESCE(MAX(modified_timestamp), '1900-01-01' :: TIMESTAMP) AS modified_timestamp
FROM
{{ this }})
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json :coin_type :name :: STRING AS coin_type,
parsed_json :ctoken_amount :: bigint AS ctoken_amount,
parsed_json :lending_market_id :: STRING AS lending_market_id,
parsed_json :obligation_id :: STRING AS obligation_id,
parsed_json :reserve_id :: STRING AS reserve_id,
{{ dbt_utils.generate_surrogate_key(['tx_digest', 'event_index']) }} AS suilend_deposits_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
suilend_events

View File

@ -0,0 +1,68 @@
-- depends_on: {{ ref('core__fact_events') }}
{{ config (
materialized = "incremental",
unique_key = "suilend_liquidations_id",
cluster_by = ['modified_timestamp::DATE'],
incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"],
merge_exclude_columns = ["inserted_timestamp"],
tags = ['silver','defi','lending','non_core']
) }}
WITH suilend_events AS (
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_address,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json,
modified_timestamp
FROM
{{ ref('core__fact_events') }}
WHERE
tx_succeeded
AND event_resource = 'LiquidateEvent'
AND event_address = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf'
{% if is_incremental() %}
AND modified_timestamp >= (
SELECT
COALESCE(MAX(modified_timestamp), '1900-01-01' :: TIMESTAMP) AS modified_timestamp
FROM
{{ this }})
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json :lending_market_id :: STRING AS lending_market_id,
parsed_json :liquidator_bonus_amount :: bigint AS liquidator_bonus_amount,
parsed_json :obligation_id :: STRING AS obligation_id,
parsed_json :protocol_fee_amount :: bigint AS protocol_fee_amount,
parsed_json :repay_amount :: bigint AS repay_amount,
parsed_json :repay_coin_type :name :: STRING AS repay_coin_type,
parsed_json :repay_reserve_id :: STRING AS repay_reserve_id,
parsed_json :withdraw_amount :: bigint AS withdraw_amount,
parsed_json :withdraw_coin_type :name :: STRING AS withdraw_coin_type,
parsed_json :withdraw_reserve_id :: STRING AS withdraw_reserve_id,
{{ dbt_utils.generate_surrogate_key(['tx_digest', 'event_index']) }} AS suilend_liquidations_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
suilend_events

View File

@ -0,0 +1,63 @@
-- depends_on: {{ ref('core__fact_events') }}
{{ config (
materialized = "incremental",
unique_key = "suilend_repayments_id",
cluster_by = ['modified_timestamp::DATE'],
incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"],
merge_exclude_columns = ["inserted_timestamp"],
tags = ['silver','defi','lending','non_core']
) }}
WITH suilend_events AS (
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_address,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json,
modified_timestamp
FROM
{{ ref('core__fact_events') }}
WHERE
tx_succeeded
AND event_resource = 'RepayEvent'
AND event_address = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf'
{% if is_incremental() %}
AND modified_timestamp >= (
SELECT
COALESCE(MAX(modified_timestamp), '1900-01-01' :: TIMESTAMP) AS modified_timestamp
FROM
{{ this }})
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json :coin_type :name :: STRING AS coin_type,
parsed_json :lending_market_id :: STRING AS lending_market_id,
parsed_json :liquidity_amount :: bigint AS liquidity_amount,
parsed_json :obligation_id :: STRING AS obligation_id,
parsed_json :reserve_id :: STRING AS reserve_id,
{{ dbt_utils.generate_surrogate_key(['tx_digest', 'event_index']) }} AS suilend_repayments_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
suilend_events

View File

@ -0,0 +1,63 @@
-- depends_on: {{ ref('core__fact_events') }}
{{ config (
materialized = "incremental",
unique_key = "suilend_withdraws_id",
cluster_by = ['modified_timestamp::DATE','block_timestamp::DATE'],
incremental_predicates = ["dynamic_range_predicate", "block_timestamp::date"],
merge_exclude_columns = ["inserted_timestamp"],
tags = ['silver','defi','lending','non_core']
) }}
WITH suilend_events AS (
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_address,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json,
modified_timestamp
FROM
{{ ref('core__fact_events') }}
WHERE
tx_succeeded
AND event_resource = 'WithdrawEvent'
AND event_address = '0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf'
{% if is_incremental() %}
AND modified_timestamp >= (
SELECT
COALESCE(MAX(modified_timestamp), '1900-01-01' :: TIMESTAMP) AS modified_timestamp
FROM
{{ this }})
{% endif %}
)
SELECT
checkpoint_number,
block_timestamp,
tx_digest,
tx_sender,
event_index,
TYPE,
event_module,
event_resource,
package_id,
transaction_module,
parsed_json :coin_type :name :: STRING AS coin_type,
parsed_json :ctoken_amount :: bigint AS ctoken_amount,
parsed_json :lending_market_id :: STRING AS lending_market_id,
parsed_json :obligation_id :: STRING AS obligation_id,
parsed_json :reserve_id :: STRING AS reserve_id,
{{ dbt_utils.generate_surrogate_key(['tx_digest', 'event_index']) }} AS suilend_withdraws_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
FROM
suilend_events