Introduce CachedJson response wrapper with cache duration based on data mutability:
- CACHE_IMMUTABLE (1 day): historical data with explicit timestamps
- CACHE_BCMR (5 min): token metadata
- CACHE_AGGREGATE (60s): aggregate data that changes with blocks
- CACHE_NONE: real-time data (current price, active pools, latest txs)
Endpoints dynamically select cache duration based on whether time parameters
are explicitly provided (historical/immutable) or defaulted to now (live).
Return proper 4XX status codes for client errors to prevent load balancers
from misinterpreting input validation failures as server errors. Add
centralized ApiResult type and ApiErrorCode enum for consistent handling.
By using new field in the pool history entry table, we can improve the
query time for finding active cauldron pools.
This change also fixes a datatype issue in the table where TEXT was used
instead of INT.