Skip to content

Commit

Permalink
AN-5202/aave-fork-lending-bug (#167)
Browse files Browse the repository at this point in the history
update lending pool column
  • Loading branch information
mattromano authored Sep 11, 2024
1 parent 8b49682 commit 4285cae
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
5 changes: 4 additions & 1 deletion models/silver/defi/lending/aave/silver__aave_withdraws.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ withdraw AS(
) :: INTEGER AS withdraw_amount,
tx_hash,
'Aave V3' 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ atoken_meta AS (
segmented_data [0] :: STRING
) :: INTEGER AS repayed_amount,
'Agave' AS agave_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
Expand Down
5 changes: 4 additions & 1 deletion models/silver/defi/lending/agave/silver__agave_withdraws.sql
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ withdraw AS(
) :: INTEGER AS withdraw_amount,
tx_hash,
'Agave' AS agave_version,
origin_to_address AS lending_pool_contract,
COALESCE(
origin_to_address,
contract_address
) AS lending_pool_contract,
_inserted_timestamp,
_log_id
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ repay AS(
segmented_data [0] :: STRING
) :: INTEGER AS repayed_amount,
'realT' AS realt_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
Expand Down
5 changes: 4 additions & 1 deletion models/silver/defi/lending/realt/silver__realt_withdraws.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ withdraw AS(
) :: INTEGER AS withdraw_amount,
tx_hash,
'realT' AS realt_version,
origin_to_address AS lending_pool_contract,
COALESCE(
origin_to_address,
contract_address
) AS lending_pool_contract,
_inserted_timestamp,
_log_id
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ repay AS(
_log_id,
_inserted_timestamp,
'Spark' AS spark_version,
origin_to_address AS lending_pool_contract,
COALESCE(
origin_to_address,
contract_address
) AS lending_pool_contract,
origin_from_address AS repayer_address,
CASE
WHEN reserve_1 = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' THEN '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
Expand Down
5 changes: 4 additions & 1 deletion models/silver/defi/lending/spark/silver__spark_withdraws.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ withdraw AS(
_log_id,
tx_hash,
'Spark' AS spark_version,
origin_to_address AS lending_pool_contract,
COALESCE(
origin_to_address,
contract_address
) AS lending_pool_contract,
CASE
WHEN reserve_1 = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' THEN '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
ELSE reserve_1
Expand Down

0 comments on commit 4285cae

Please sign in to comment.