Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add category and rollup stats #576

Merged
merged 22 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1b30bbe
feat(db): add `category` and `rollup` to stats models
PJColombo Sep 5, 2024
8d9d340
fix(db): add missing `id` field to blob daily stats model
PJColombo Sep 5, 2024
4f73de5
chore: bump prisma deps to latest version
PJColombo Sep 11, 2024
77ef405
chore(db): enable `typedSql` on prisma
PJColombo Sep 11, 2024
1891002
feat(db): add blob max fee columns to transaction stats models
PJColombo Sep 11, 2024
af494f6
chore: add changeset
PJColombo Sep 11, 2024
f038f57
feat(db): treat category and rollup null values as distinct
PJColombo Sep 16, 2024
2aa5e2c
feat(db): add total blob gas price columns
PJColombo Sep 16, 2024
0e46f0e
feat(db): add address history model
PJColombo Sep 16, 2024
5f72bca
feat(dayjs): add date utily functions
PJColombo Sep 18, 2024
18bc55f
chore: add changeset
PJColombo Sep 18, 2024
15c422c
feat: add support for category and rollup aggregations
PJColombo Sep 19, 2024
3cdc592
chore: add changeset
PJColombo Sep 19, 2024
61eec3e
test(stats-aggregation-cli): update snapshots
PJColombo Sep 19, 2024
36381b4
fix(api): fix import issue
PJColombo Sep 19, 2024
d1a30e6
style: apply suggestions from code review
PJColombo Sep 25, 2024
13b24e9
Merge branch 'main' into feat/add-rollup-stats
PJColombo Oct 1, 2024
8a8032f
test(api): unskip tests
PJColombo Oct 1, 2024
ca9a029
refactor: rename `AddressHistory` model to `AddressCategoryInfo`
PJColombo Oct 1, 2024
b145878
feat: make `category` column optional on `AddressCategoryInfo` model
PJColombo Oct 2, 2024
24868b0
feat(api): upsert lowest overall address category info
PJColombo Oct 2, 2024
6955439
style(stats-aggregation-cli): add comment
PJColombo Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(db): add blob max fee columns to transaction stats models
  • Loading branch information
PJColombo committed Sep 11, 2024
commit 1891002c10c2c21d7ba584e9bdd32e0edec102bf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- AlterTable
ALTER TABLE "transaction_daily_stats" ADD COLUMN "avg_blob_as_calldata_max_fee" DOUBLE PRECISION NOT NULL DEFAULT 0,
ADD COLUMN "avg_blob_max_fee" DOUBLE PRECISION NOT NULL DEFAULT 0,
ADD COLUMN "total_blob_as_calldata_max_fees" DECIMAL(100,0) NOT NULL DEFAULT 0,
ADD COLUMN "total_blob_max_fees" DECIMAL(100,0) NOT NULL DEFAULT 0,
ADD COLUMN "total_blob_max_gas_fees" DECIMAL(100,0) NOT NULL DEFAULT 0;

-- AlterTable
ALTER TABLE "transaction_overall_stats" ADD COLUMN "avg_blob_as_calldata_max_fee" DOUBLE PRECISION NOT NULL DEFAULT 0,
ADD COLUMN "avg_blob_max_fee" DOUBLE PRECISION NOT NULL DEFAULT 0,
ADD COLUMN "total_blob_as_calldata_max_fees" DECIMAL(100,0) NOT NULL DEFAULT 0,
ADD COLUMN "total_blob_max_fees" DECIMAL(100,0) NOT NULL DEFAULT 0,
ADD COLUMN "total_blob_max_gas_fees" DECIMAL(100,0) NOT NULL DEFAULT 0;
15 changes: 12 additions & 3 deletions packages/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,17 @@ model TransactionOverallStats {
totalBlobGasUsed Decimal @default(0) @map("total_blob_gas_used") @db.Decimal(100, 0)
totalBlobAsCalldataGasUsed Decimal @default(0) @map("total_blob_as_calldata_gas_used") @db.Decimal(100, 0)
totalBlobFee Decimal @default(0) @map("total_blob_fee") @db.Decimal(100, 0)
totalBlobMaxFees Decimal @default(0) @map("total_blob_max_fees") @db.Decimal(100, 0)
totalBlobAsCalldataFee Decimal @default(0) @map("total_blob_as_calldata_fee") @db.Decimal(100, 0)
totalBlobAsCalldataMaxFees Decimal @default(0) @map("total_blob_as_calldata_max_fees") @db.Decimal(100, 0)
totalBlobMaxGasFees Decimal @default(0) @map("total_blob_max_gas_fees") @db.Decimal(100, 0)
avgBlobFee Float @default(0) @map("avg_blob_fee")
avgBlobMaxFee Float @default(0) @map("avg_blob_max_fee")
avgBlobAsCalldataFee Float @default(0) @map("avg_blob_as_calldata_fee")
avgBlobAsCalldataMaxFee Float @default(0) @map("avg_blob_as_calldata_max_fee")
avgBlobGasPrice Float @default(0) @map("avg_blob_gas_price")
avgMaxBlobGasFee Float @default(0) @map("avg_max_blob_gas_fee")

updatedAt DateTime @map("updated_at")
updatedAt DateTime @map("updated_at")

@@unique([category, rollup])
@@map("transaction_overall_stats")
Expand All @@ -274,14 +278,19 @@ model TransactionDailyStats {
category Category?
rollup Rollup?
totalTransactions Int @default(0) @map("total_transactions")
totalUniqueSenders Int @default(0) @map("total_unique_senders")
totalUniqueReceivers Int @default(0) @map("total_unique_receivers")
totalUniqueSenders Int @default(0) @map("total_unique_senders")
totalBlobGasUsed Decimal @default(0) @map("total_blob_gas_used") @db.Decimal(100, 0)
totalBlobAsCalldataGasUsed Decimal @default(0) @map("total_blob_as_calldata_gas_used") @db.Decimal(100, 0)
totalBlobFee Decimal @default(0) @map("total_blob_fee") @db.Decimal(100, 0)
totalBlobMaxFees Decimal @default(0) @map("total_blob_max_fees") @db.Decimal(100, 0)
totalBlobAsCalldataFee Decimal @default(0) @map("total_blob_as_calldata_fee") @db.Decimal(100, 0)
totalBlobAsCalldataMaxFees Decimal @default(0) @map("total_blob_as_calldata_max_fees") @db.Decimal(100, 0)
totalBlobMaxGasFees Decimal @default(0) @map("total_blob_max_gas_fees") @db.Decimal(100, 0)
avgBlobFee Float @default(0) @map("avg_blob_fee")
avgBlobMaxFee Float @default(0) @map("avg_blob_max_fee")
avgBlobAsCalldataFee Float @default(0) @map("avg_blob_as_calldata_fee")
avgBlobAsCalldataMaxFee Float @default(0) @map("avg_blob_as_calldata_max_fee")
avgBlobGasPrice Float @default(0) @map("avg_blob_gas_price")
avgMaxBlobGasFee Float @default(0) @map("avg_max_blob_gas_fee")

Expand Down