Skip to content

Commit

Permalink
aave-olas-fixes (#179)
Browse files Browse the repository at this point in the history
* fix aave

* remove tests

---------

Co-authored-by: drethereum <[email protected]>
  • Loading branch information
mattromano and drethereum authored Dec 19, 2024
1 parent 94e38da commit 33a7ad1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
17 changes: 12 additions & 5 deletions models/silver/defi/lending/aave/silver__aave_flashloans.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
tags = ['reorg','curated']
) }}

WITH
atoken_meta AS (
WITH atoken_meta AS (

SELECT
atoken_address,
aave_version_pool,
Expand All @@ -26,7 +26,6 @@ atoken_meta AS (
{{ ref('silver__aave_tokens') }}
),
flashloan AS (

SELECT
tx_hash,
block_number,
Expand All @@ -38,7 +37,10 @@ flashloan AS (
contract_address,
regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') AS segmented_data,
CONCAT('0x', SUBSTR(topics [1] :: STRING, 27, 40)) AS target_address,
origin_to_address AS initiator_address,
COALESCE(
origin_to_address,
CONCAT('0x', SUBSTR(segmented_data [0] :: STRING, 27, 40))
) AS initiator_address,
CONCAT('0x', SUBSTR(topics [2] :: STRING, 27, 40)) AS aave_market,
utils.udf_hex_to_int(
segmented_data [1] :: STRING
Expand Down Expand Up @@ -70,7 +72,12 @@ AND _inserted_timestamp >= (
)
AND _inserted_timestamp >= SYSDATE() - INTERVAL '7 day'
{% endif %}
AND contract_address IN (SELECT distinct(aave_version_pool) from atoken_meta)
AND contract_address IN (
SELECT
DISTINCT(aave_version_pool)
FROM
atoken_meta
)
AND tx_status = 'SUCCESS' --excludes failed txs
)
SELECT
Expand Down
6 changes: 0 additions & 6 deletions models/silver/protocols/olas/silver_olas__mech_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,3 @@ models:
- name: REQUEST_ID
tests:
- not_null
- name: DATA_PAYLOAD
tests:
- not_null
- name: PROMPT_LINK
tests:
- not_null

0 comments on commit 33a7ad1

Please sign in to comment.