-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update model samples to new definition spec (#59)
* update model samples to use new definition spec * move /.spice/models -> /models
- Loading branch information
Showing
6 changed files
with
109 additions
and
67 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |