Complete economics service implementation with: - Price Oracle with TWAP (Time-Weighted Average Price) - Multi-source price aggregation - Configurable staleness thresholds - Exponential, SMA, and standard TWAP strategies - Metering Service for L2 usage tracking - Storage: GB-months, retrieval bandwidth - Hosting: bandwidth, custom domains - Database: queries, vector searches - Compute: CPU core-hours, GPU hours, memory - Network: bandwidth, requests - Billing Engine - Invoice generation with line items - Payment processing (crypto/fiat) - Credit management with expiration - Auto-pay from prepaid balance - Pricing Tiers: Free, Standard, Premium, Enterprise - 0%, 10%, 20%, 30% usage discounts - SLA guarantees: 95%, 99%, 99.9%, 99.99% - Cost Calculator & Estimator - Usage projections - Tier comparison recommendations - ROI analysis - Docker deployment with PostgreSQL schema All 61 tests passing.
58 lines
1.2 KiB
TOML
58 lines
1.2 KiB
TOML
[package]
|
|
name = "synor-economics"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Economics, pricing, metering, and billing for Synor L2 services"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/synor/blockchain"
|
|
|
|
[dependencies]
|
|
# Internal crates
|
|
synor-types = { path = "../synor-types" }
|
|
|
|
# Async runtime
|
|
tokio = { version = "1.40", features = ["full"] }
|
|
futures = "0.3"
|
|
async-trait = "0.1"
|
|
|
|
# Serialization
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
|
|
# Time handling
|
|
chrono = { version = "0.4", features = ["serde"] }
|
|
|
|
# Decimal math for financial precision
|
|
rust_decimal = { version = "1.33", features = ["serde"] }
|
|
rust_decimal_macros = "1.33"
|
|
|
|
# Cryptographic hashing
|
|
sha2 = "0.10"
|
|
blake3 = "1.5"
|
|
|
|
# Error handling
|
|
thiserror = "1.0"
|
|
anyhow = "1.0"
|
|
|
|
# Logging
|
|
tracing = "0.1"
|
|
|
|
# Database/storage
|
|
rocksdb = { version = "0.22", optional = true }
|
|
|
|
# HTTP client for external price feeds
|
|
reqwest = { version = "0.11", features = ["json"], optional = true }
|
|
|
|
# Event streaming
|
|
async-channel = "2.1"
|
|
|
|
[dev-dependencies]
|
|
tokio-test = "0.4"
|
|
criterion = "0.5"
|
|
tempfile = "3.10"
|
|
|
|
[features]
|
|
default = ["http-feeds"]
|
|
http-feeds = ["reqwest"]
|
|
persistent = ["rocksdb"]
|
|
|