Skip to content

Commit

Permalink
upgrades (#227)
Browse files Browse the repository at this point in the history
* upgrades

* 1k
  • Loading branch information
austinFlipside authored Nov 20, 2024
1 parent 3f5a0aa commit 8b916f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 4 additions & 3 deletions models/bronze/api_udf/bronze_api__contract_abis.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ WITH base AS (
FROM
{{ ref('silver__relevant_contracts') }}
WHERE
total_interaction_count >= 100
total_interaction_count >= 1000

{% if is_incremental() %}
EXCEPT
Expand All @@ -23,8 +23,9 @@ FROM
WHERE
abi_data :data :result :: STRING <> 'Max rate limit reached'
{% endif %}
order by total_interaction_count desc
LIMIT
5
25
), all_contracts AS (
SELECT
contract_address
Expand All @@ -46,7 +47,7 @@ row_nos AS (
FROM
all_contracts
),
batched AS ({% for item in range(15) %}
batched AS ({% for item in range(30) %}
SELECT
rn.contract_address, live.udf_api('GET', CONCAT('https://api.basescan.org/api?module=contract&action=getabi&address=', rn.contract_address, '&apikey={key}'),{ 'User-Agent': 'FlipsideStreamline' },{}, 'Vault/prod/block_explorers/base_scan') AS abi_data, SYSDATE() AS _inserted_timestamp
FROM
Expand Down
6 changes: 1 addition & 5 deletions models/silver/core/silver__relevant_contracts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ GROUP BY
),
function_calls AS (
SELECT
IFF(
TYPE = 'DELEGATECALL',
from_address,
to_address
) AS contract_address,
to_address AS contract_address,
COUNT(*) AS function_call_count,
MAX(_inserted_timestamp) AS max_inserted_timestamp_traces,
MAX(block_number) AS latest_call_block
Expand Down

0 comments on commit 8b916f4

Please sign in to comment.