diff --git a/.spice/models/gas_fees/model.yml b/.spice/models/gas_fees/model.yml deleted file mode 100644 index 46aa034..0000000 --- a/.spice/models/gas_fees/model.yml +++ /dev/null @@ -1,10 +0,0 @@ -family: gas_fees -name: v0.1 -model_type: xgb_gasfees -training_query: 'WITH counts AS ( SELECT block_number, count(1) as "count" FROM eth.transactions GROUP BY block_number ) SELECT number as "ts", CAST(b.base_fee_per_gas / 1000000000.0 AS DOUBLE) as "y", CAST(c."count" AS DOUBLE) as "covariate" FROM eth.blocks b INNER JOIN counts c ON b.number = c.block_number WHERE b.base_fee_per_gas IS NOT NULL ORDER BY block_number DESC LIMIT 500' -inference_query: 'SELECT number as "ts", CAST(base_fee_per_gas / 1000000000.0 AS DOUBLE) as "y", CAST(transaction_count AS DOUBLE) as "y2" from eth.recent_blocks WHERE base_fee_per_gas IS NOT NULL ORDER BY ts DESC LIMIT 35' -lookback_size: 30 -forecast_size: 1 -metadata: - firecache: false - covariate: true \ No newline at end of file diff --git a/.spice/models/uniswap_v3_eth_usdt/model.yml b/.spice/models/uniswap_v3_eth_usdt/model.yml deleted file mode 100644 index 6a8e66c..0000000 --- a/.spice/models/uniswap_v3_eth_usdt/model.yml +++ /dev/null @@ -1,28 +0,0 @@ -family: tf_uniswapv3_eth_usdt -name: v0.0.1 -model_type: tf_uniswapv3_eth_usdt_aggregated -training_query: | - SELECT - block_timestamp as ts, - CASE - WHEN cast(amount1 as double) = 0 THEN NULL - ELSE abs(cast(amount1 as double)/ POWER(10, 6) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 18)), 0)) - END as y - FROM eth.uniswap_v3.event_swaps - WHERE address = '0x11b815efb8f581194ae79006d24e0d814b7697f6' - ORDER BY block_number desc - LIMIT 1000 -inference_query: | - SELECT - block_timestamp as ts, - CASE - WHEN cast(amount1 as double) = 0 THEN NULL - ELSE abs(cast(amount1 as double)/ POWER(10, 6) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 18)), 0)) - END as y - FROM eth.uniswap_v3.recent_event_swaps - WHERE address = '0x11b815efb8f581194ae79006d24e0d814b7697f6' - ORDER BY block_number desc -lookback_size: 50 -forecast_size: 1 -metadata: - aggregate: true diff --git a/.spice/models/uniswap_v3_wbtc_eth/model.yml b/.spice/models/uniswap_v3_wbtc_eth/model.yml deleted file mode 100644 index 35c7de2..0000000 --- a/.spice/models/uniswap_v3_wbtc_eth/model.yml +++ /dev/null @@ -1,29 +0,0 @@ -family: tf_uniswapv3_wbtc_eth -name: v0.0.1 -model_type: tf_uniswapv3_wbtc_eth_aggregated -training_query: | - SELECT - block_timestamp as ts, - CASE - WHEN abs(cast(amount0 as double) * POWER(10, 8)) = 0 THEN NULL - ELSE abs(cast(amount1 as double)/ POWER(10, 18) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 8)), 0)) - END as y - FROM eth.uniswap_v3.event_swaps - WHERE address = '0x4585fe77225b41b697c938b018e2ac67ac5a20c0' - ORDER BY block_number desc - LIMIT 1000 -inference_query: | - SELECT - block_timestamp as ts, - CASE - WHEN abs(cast(amount0 as double) * POWER(10, 8)) = 0 THEN NULL - ELSE abs(cast(amount1 as double)/ POWER(10, 18) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 8)), 0)) - END as y - FROM eth.uniswap_v3.event_swaps - WHERE address = '0x4585fe77225b41b697c938b018e2ac67ac5a20c0' - ORDER BY block_number desc - LIMIT 100 -lookback_size: 50 -forecast_size: 1 -metadata: - aggregate: true diff --git a/models/gas_fees/model.yml b/models/gas_fees/model.yml new file mode 100644 index 0000000..ad0199c --- /dev/null +++ b/models/gas_fees/model.yml @@ -0,0 +1,38 @@ +family: gas_fees +name: v2 +type: xgb_gasfees + +epochs: 10 + +training: + sql: | + WITH counts AS ( + SELECT block_number, count(1) as "count" FROM eth.transactions GROUP BY block_number + ) + SELECT + number as "ts", + CAST(b.base_fee_per_gas / 1000000000.0 AS DOUBLE) as "y", + CAST(c."count" AS DOUBLE) as "covariate" + FROM eth.blocks b + INNER JOIN counts c ON b.number = c.block_number + WHERE b.base_fee_per_gas IS NOT NULL + ORDER BY block_number DESC + LIMIT 500 + +inferencing: + sql: | + SELECT + number as "ts", + CAST(base_fee_per_gas / 1000000000.0 AS DOUBLE) as "y", + CAST(transaction_count AS DOUBLE) as "y2" + FROM eth.recent_blocks + WHERE base_fee_per_gas IS NOT NULL + ORDER BY ts DESC + LIMIT 35 + + lookback_size: 30 + forecast_size: 1 + +metadata: + firecache: true + covariate: true \ No newline at end of file diff --git a/models/uniswap_v3_eth_usdt/model.yml b/models/uniswap_v3_eth_usdt/model.yml new file mode 100644 index 0000000..98f737b --- /dev/null +++ b/models/uniswap_v3_eth_usdt/model.yml @@ -0,0 +1,35 @@ +family: tf_uniswapv3_eth_usdt +name: v0.0.1 +type: tf_uniswapv3_eth_usdt_aggregated + +epochs: 10 + +training: + sql: | + SELECT + block_timestamp as ts, + CASE + WHEN cast(amount1 as double) = 0 THEN NULL + ELSE abs(cast(amount1 as double)/ POWER(10, 6) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 18)), 0)) + END as y + FROM eth.uniswap_v3.event_swaps + WHERE address = '0x11b815efb8f581194ae79006d24e0d814b7697f6' + ORDER BY block_number desc + LIMIT 1000 + +inferencing: + sql: | + SELECT + block_timestamp as ts, + CASE + WHEN cast(amount1 as double) = 0 THEN NULL + ELSE abs(cast(amount1 as double)/ POWER(10, 6) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 18)), 0)) + END as y + FROM eth.uniswap_v3.recent_event_swaps + WHERE address = '0x11b815efb8f581194ae79006d24e0d814b7697f6' + ORDER BY block_number desc + lookback_size: 50 + forecast_size: 1 + +metadata: + aggregate: true diff --git a/models/uniswap_v3_wbtc_eth/model.yml b/models/uniswap_v3_wbtc_eth/model.yml new file mode 100644 index 0000000..4c3e114 --- /dev/null +++ b/models/uniswap_v3_wbtc_eth/model.yml @@ -0,0 +1,36 @@ +family: tf_uniswapv3_wbtc_eth +name: v0.0.1 +type: tf_uniswapv3_wbtc_eth_aggregated + +epochs: 10 + +training: + sql: | + SELECT + block_timestamp as ts, + CASE + WHEN abs(cast(amount0 as double) * POWER(10, 8)) = 0 THEN NULL + ELSE abs(cast(amount1 as double)/ POWER(10, 18) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 8)), 0)) + END as y + FROM eth.uniswap_v3.event_swaps + WHERE address = '0x4585fe77225b41b697c938b018e2ac67ac5a20c0' + ORDER BY block_number desc + LIMIT 1000 + +inferencing: + sql: | + SELECT + block_timestamp as ts, + CASE + WHEN abs(cast(amount0 as double) * POWER(10, 8)) = 0 THEN NULL + ELSE abs(cast(amount1 as double)/ POWER(10, 18) / NULLIF(abs(cast(amount0 as double)/ POWER(10, 8)), 0)) + END as y + FROM eth.uniswap_v3.event_swaps + WHERE address = '0x4585fe77225b41b697c938b018e2ac67ac5a20c0' + ORDER BY block_number desc + LIMIT 100 + lookback_size: 50 + forecast_size: 1 + +metadata: + aggregate: true