Complete reference for all key patterns stored in ElastiCache (Valkey). Covers price cache, API key cache, cluster stats, usage log indexes, adaptive governor, rate limiting, KCC dashboard, and deduplication keys.
| Property | Value |
|---|---|
| Endpoint | master.trinity-beast-cache.ptsbmm.use2.cache.amazonaws.com:6379 |
| Node Type | cache.r7g.2xlarge (8 vCPU, 52.8 GB) |
| Engine | Valkey 7.2 |
| TLS | Enabled |
| Client Library | go-redis UniversalClient (works with both cluster and standalone mode) |
| Connection Pool | 300 per container (1,200 total across 4 ECS containers) |
Cached cryptocurrency prices written by the Kraken prewarm batch and REST fallback path. Read on every LPO price request when the Tier 2 (in-memory) cache misses.
| Field | Type | Description |
|---|---|---|
asset | string | Cryptocurrency ticker (BTC, ETH, SOL, etc.) |
price | float | Current price in USD |
timestamp | string (ISO 8601) | When the price was fetched |
readable_timestamp | string | Human-readable timestamp |
source | string | Price source (coinbase-ws, gemini-ws, kraken-ws, gateio-ws, bybit-ws, okx-ws, kraken-prewarm) |
latency_ms | integer | Source fetch latency in milliseconds |
cached | boolean | Always false when written; set to true when served from cache |
Full API key records cached as hashes. Populated by the sync job on a regular cycle and on cache miss by the API key store. Every inbound API request reads this key for authentication and rate limit enforcement.
| Field | Type | Description |
|---|---|---|
id | string (uuid) | API key record ID |
user_id | string (uuid) | Owner user ID |
name | string | Subscriber name |
tier | string | Subscription tier |
query_limit | integer | Monthly query limit |
current_usage | integer | Current month's query count |
rate_limit_qps | integer | Queries per second limit |
burst_limit | integer | Token bucket burst capacity |
burst_tokens | float | Current token balance |
api_key | string | The API key string |
minimum_wait_seconds | float | Min time between throttled requests |
revoked | boolean | Whether the key is disabled |
lrs_enabled | boolean | Whether unlimited LRS reports are enabled |
last_used | string (ISO 8601) | Last API call timestamp |
created_at | string (ISO 8601) | Key creation date |
last_success | string (ISO 8601) | Last successful API call |
/admin/invalidate-key endpoint
All runtime application parameters from the Aurora application_parameters table, cached as a single hash. No TTL — persists until explicitly overwritten. Read on every config poll cycle by all containers.
Contains all 56+ application parameters from Aurora. Example fields include:
| Example Field | Description |
|---|---|
adaptive_max_concurrent | Max concurrent requests before adaptive throttling |
cache_pool_size | ElastiCache connection pool size per container |
coinbase_prewarm_assets | Comma-separated list of assets to prewarm from Coinbase |
gemini_prewarm_assets | Comma-separated list of assets to prewarm from Gemini |
kraken_prewarm_assets | Comma-separated list of assets to prewarm from Kraken |
log_level | Application log level (debug, info, warn, error) |
cache_ttl_seconds | Default cache TTL for price entries |
/admin/reload-params, /admin/system-modeLoadApplicationParameters on every config poll cycle
Sorted sets that index usage log entries by timestamp. The global index plus per-API-key and per-asset indexes enable fast range queries for LRS reports without scanning the full dataset.
Score: Unix timestamp | Members: Usage log UUIDs
Score: Unix timestamp | Members: Usage log UUIDs
Score: Unix timestamp | Members: Usage log UUIDs
Individual usage log entries stored as hashes. Each entry is a complete snapshot of a single LPO API request. Written by the sync job from Aurora and retained for 93 days.
| Field | Type | Description |
|---|---|---|
api_key_id | string | API key that made the request |
asset | string | Cryptocurrency asset queried |
price | float | Price returned |
source | string | Price source |
cached | boolean | Whether served from cache |
latency_ms | integer | Source fetch latency |
duration_ms | integer | Total request processing time |
ip_address | string | Client IP address |
timestamp | string (ISO 8601) | When the request occurred |
readable_timestamp | string | Human-readable timestamp |
cache_age_seconds | float | Age of cached price at time of request |
cluster_node | string | ECS container that handled the request |
region | string | AWS region |
monthly_usage | integer | Subscriber's usage count at time of request |
monthly_limit | integer | Subscriber's limit at time of request |
Indexes and data for LRS report request logs. Mirrors the Aurora report_usage_logs table in ElastiCache for fast report-on-report queries.
Score: Unix timestamp | Members: Report usage log UUIDs
Score: Unix timestamp | Members: Report usage log UUIDs
| Field | Type | Description |
|---|---|---|
api_key_id | string | API key that requested the report |
report_type | string | Report type (usage/summary/report-usage/report-summary) |
format | string | Output format (json/csv/tsv/text) |
filters | string (JSON) | Query filters applied |
row_count | integer | Number of rows returned |
duration_ms | integer | Processing time |
ip_address | string | Client IP address |
timestamp | string (ISO 8601) | When the report was requested |
readable_timestamp | string | Human-readable timestamp |
cluster_node | string | ECS container that handled the request |
region | string | AWS region |
protocol | string | TCP or UDP |
status_code | integer | HTTP status returned |
Each ECS container publishes a JSON snapshot of its runtime metrics to ElastiCache every 3 seconds. Read by /admin/cluster-stats and /public/status for cluster-wide aggregation.
Node names: BeastMain, BeastMirror, BeastLRS, BeastWebhook
| Field | Type | Description |
|---|---|---|
uptime_seconds | float | Container uptime in seconds |
tcp_requests | integer | Total TCP requests handled |
udp_requests | integer | Total UDP requests handled |
lrs_requests | integer | Total LRS report requests |
total_rps | float | Requests per second (all protocols) |
syncmap_hits | integer | Tier 1 (local sync.Map) cache hits |
elasticache_hits | integer | Tier 2 (ElastiCache) cache hits |
cache_misses | integer | Full cache misses (REST fallback) |
errors_5xx | integer | Server error count |
errors_4xx | integer | Client error count |
rate_limit_hits | integer | Rate limit rejections |
bg_work_dropped | integer | Background tasks dropped (pool full) |
/admin/cluster-stats, /public/status, KCC daily dashboard
Distributed counters and flags used by the adaptive governor to coordinate throttling decisions across all three ECS containers. Uses a hash tag {adaptive:lpo} to ensure all keys land on the same shard for atomic operations.
successes to calculate the success rate.
true, all containers reduce outbound requests to protect upstream price sources. Evaluated on every inbound request.
Per-API-key rate limit state stored in ElastiCache for cluster-wide enforcement. The token bucket algorithm tracks remaining tokens and last refill time. Read and updated on every API request.
| Field | Type | Description |
|---|---|---|
tokens | float | Current token balance in the bucket |
last_refill | float (unix) | Timestamp of last token refill |
Stores the collected daily infrastructure metrics as a single JSON blob. Written by bash scripts/kcc.sh daily-collect and read by the CLI daily command and the KCC Live Dashboard.
Contains a comprehensive snapshot of all infrastructure metrics: service health, ECS cluster stats, Valkey metrics, Lambda status, nightly sync results, SQS queue depth, and 7-day website analytics.
daily-collect command (via /admin/valkey endpoint)daily command, KCC Live Dashboard (docs/dashboard.html)
Prevents double-processing of Stripe checkout session completion events. The receipt Lambda writes the full response after processing and checks for existence before re-processing.
Contains: Full Lambda response JSON from the receipt processing
Prevents duplicate processing of Stripe webhook events. Stripe may deliver the same event multiple times; this key ensures idempotent handling.
Tracks the last-synced timestamp for incremental data synchronization from Aurora to ElastiCache. The sync job reads these marks to determine which new records need to be copied.
usage_logs timestamp. The sync job queries Aurora for all usage_logs with timestamp > this value.
report_usage_logs timestamp. The sync job queries Aurora for all report_usage_logs with timestamp > this value.