From 42e67fbb23b9d30333eb9034b2864858c4467de8 Mon Sep 17 00:00:00 2001 From: Matt Romano <42412983+mattromano@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:53:52 -0700 Subject: [PATCH] update lending pool contract (#305) --- models/silver/defi/lending/aave/silver__aave_withdraws.sql | 5 ++++- .../defi/lending/granary/silver__granary_repayments.sql | 5 ++++- .../defi/lending/granary/silver__granary_withdraws.sql | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/models/silver/defi/lending/aave/silver__aave_withdraws.sql b/models/silver/defi/lending/aave/silver__aave_withdraws.sql index e87077ba..e3cac082 100644 --- a/models/silver/defi/lending/aave/silver__aave_withdraws.sql +++ b/models/silver/defi/lending/aave/silver__aave_withdraws.sql @@ -28,7 +28,10 @@ WITH withdraw AS( WHEN contract_address = LOWER('0x794a61358D6845594F94dc1DB02A252b5b4814aD') THEN 'Aave V3' ELSE 'ERROR' END AS aave_version, - origin_to_address AS lending_pool_contract, + COALESCE( + origin_to_address, + contract_address + ) AS lending_pool_contract, _inserted_timestamp, _log_id FROM diff --git a/models/silver/defi/lending/granary/silver__granary_repayments.sql b/models/silver/defi/lending/granary/silver__granary_repayments.sql index b3591479..bd666488 100644 --- a/models/silver/defi/lending/granary/silver__granary_repayments.sql +++ b/models/silver/defi/lending/granary/silver__granary_repayments.sql @@ -28,7 +28,10 @@ WITH repay AS( WHEN contract_address = LOWER('0x8FD4aF47E4E63d1D2D45582c3286b4BD9Bb95DfE') THEN 'Granary' ELSE 'ERROR' END AS granary_version, - origin_to_address AS lending_pool_contract, + COALESCE( + origin_to_address, + contract_address + ) AS lending_pool_contract, origin_from_address AS repayer_address, _log_id, _inserted_timestamp diff --git a/models/silver/defi/lending/granary/silver__granary_withdraws.sql b/models/silver/defi/lending/granary/silver__granary_withdraws.sql index 896e7180..9599909c 100644 --- a/models/silver/defi/lending/granary/silver__granary_withdraws.sql +++ b/models/silver/defi/lending/granary/silver__granary_withdraws.sql @@ -28,7 +28,10 @@ WITH withdraw AS( WHEN contract_address = LOWER('0x8FD4aF47E4E63d1D2D45582c3286b4BD9Bb95DfE') THEN 'Granary' ELSE 'ERROR' END AS granary_version, - origin_to_address AS lending_pool_contract, + COALESCE( + origin_to_address, + contract_address + ) AS lending_pool_contract, _inserted_timestamp, _log_id FROM