Amatsu Admin
Formerly known as ozone-a-app, Amatsu Admin is the central administrative application for managing cron jobs, database operations, and authentication services.
Overview
Section titled “Overview”Amatsu Admin provides:
- Cron job scheduling and management
- Database CRUD operations interface
- Authentication service endpoints
- Administrative dashboard and controls
- Custom Endpoints playground
Technical Details
Section titled “Technical Details”Architecture
Section titled “Architecture”- Type: Fullstack application
- Framework: Next JS
- Databases:
- Unity: supabase (postgres)
- Ozone: MySQL (Digital Ocean managed DB)
- Hosting: Vercel
/api/auth/login- User authentication endpoint/api/auth/validate- Token validation endpoint- API Docs: https://admin.cambria.cx/docs
Cron Jobs: {#cron-jobs}
Section titled “Cron Jobs: {#cron-jobs}”- Update Star Allocation Systems:
- path:
/api/cron/update-star-allocation-systems/[star]/[chain] - schedule: hourly
- job description: Currently implemented for Spark, the Star Allocation System is the abstract name for the allocation system of each star, in the case of Spark is called Spark Liquidity Layer (SLL), and this cron job updates all the ALM Proxy and PSM3 assets amounts of the SLL deployed by network, its prices for USD conversion, and the total debt.
- path:
- Update TVL:
- path:
/api/cron/update-tvl/[product] - schedule: hourly
- job description: Updates the Total Value Locked (TVL) of a specific product. For now only Sparklend is being calculated.
- path:
- Update Integration Boost Incentives:
- path:
/api/cron/update-integration-boost-incentives - schedule: hourly
- job description: This job fetches Sky’s integration boost incentives from our own incentives calculation service and updates values in Unity database.
- path:
- Update Integration Boost Incentives:
- path:
/api/cron/update-accessibility-rewards-incentives - schedule: hourly
- job description: This job fetches Sky’s accessibility rewards from the Forse dashboard through its [api][https://api.forse.io/api/sky_accessbility/getSkyAccessibilityRewardsIntegratorPayoutsOverview](auth api) and updates values in Unity database.
- path:
- Update Token Prices:
- path:
api/cron/update-token-prices/[database] - schedule: daily
- job description: there are two different price calculations, one for Ozone database and another for unity. At Amatsu, we only care about token prices in Unity database. The unity token prices are fetched from alchemy and saved in our
token_pricestable. Only tokens with flagtrack pricetrue are tracked. Ozone, on the other hand, uses coingecko’s free tier API as source of prices.
- path:
- Transactions Automation:
- path:
api/cron/transactions-automation/run-transactions-automation - schedule: daily
- job description: This an Ozone specific cron job, it fetches transactions of addresses and tokens that are selected to be tracked through the transaction automation ozone worker (requires auth)
- path:
Deployment
Section titled “Deployment”Environments
Section titled “Environments”- Production: https://admin.cambria.cx
- Staging: https://preview.admin.cambria.cx
- Development: Vercel PRs preview links
Hosting & Infrastructure
Section titled “Hosting & Infrastructure”- Provider: Vercel
- Domain: admin.cambria.cx
- SSL/TLS: yes (Vercel)
Release Process
Section titled “Release Process”- Release Management: Semantic-release using git branches
- Branch Strategy:
mainbranch → Production deployment (https://admin.cambria.cx)stagingbranch → Staging deployment (https://preview.admin.cambria.cx)- Feature branches → PR preview deployments
- Release Flow:
- Feature development on feature branches
- Merge to
stagingfor staging testing - Merge to
maintriggers semantic-release - Automatic version bumping and changelog generation
- Production deployment via Vercel
Dependencies
Section titled “Dependencies”External Services
Section titled “External Services”- Unity Database
- Authentication providers: Supabase
- Cron scheduling services: Vercel Cron Jobs
Monitoring & Maintenance
Section titled “Monitoring & Maintenance”Logs & Metrics
Section titled “Logs & Metrics”- Application logs location: Vercel
- Monitoring dashboard: Vercel
- Error tracking: Sentry
Access & Permissions
Section titled “Access & Permissions”User Roles
Section titled “User Roles”- Admin: Full access to all features
Authentication
Section titled “Authentication”- Login method: username and password
- Session management: supabase
- API authentication: Bearer JWT tokens
Runbooks
Section titled “Runbooks”Common Operations
Section titled “Common Operations”- CRUD database operations
- Cron Jobs automation and manual triggers
- Custom endpoint creation (formerly called saved views) to run custom SQL views
Emergency Procedures
Section titled “Emergency Procedures”- Contact Phin (0x_phiny)