Created
October 26, 2018 05:04
-
-
Save halink0803/b4e9f51a0d7bb6fa361d1e058b227e6a to your computer and use it in GitHub Desktop.
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
CREATE CONTINUOUS QUERY "wallet_fee" ON "trade_logs" | |
RESAMPLE EVERY 1h FOR 1d | |
BEGIN | |
SELECT SUM("amount") as "sum_amount" | |
INTO "hourly_wallet_fees" | |
FROM "wallet_fees" | |
GROUP BY "reserve_addr", "wallet_addr", time(1h) | |
END | |
CREATE CONTINUOUS QUERY "wallet_fee_1d" ON "trade_logs" | |
RESAMPLE EVERY 1d FOR 3d | |
BEGIN | |
SELECT SUM("amount") as "sum_amount" | |
INTO "daily_wallet_fees" | |
FROM "wallet_fees" | |
GROUP BY "reserve_addr", "wallet_addr", time(1d) | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment