Back to Directory Financial Ledger Spec

CrestBank Specifications

A transactional ledged system designed to run compound interest updates and player transaction logs without impacting the main Minecraft ticking loop. Developed and maintained by AdithyaDev.

Problem

Existing Minecraft economy systems record player data directly to local disk configurations or run synchronous queries during gameplay. When executing batch transactions or applying global server interest calculations across thousands of offline accounts, the main server thread locks, causing garbage collection spikes and TPS drops.

Architecture

CrestBank decouples standard player balances from volatile state. By executing interest routines and transaction records on asynchronous worker threads, the main tick loop remains entirely unaffected. Balance updates are buffered in-memory and synchronized to a PostgreSQL cluster using a dirty-write pool.

// Asynchronous Transaction Guard with Alert Thresholds and State Safety
public synchronized TransactionResult processTransfer(UUID sender, UUID receiver, double amount) {
    if (amount <= 0) return TransactionResult.INVALID_AMOUNT;
    if (isAccountFrozen(sender)) return TransactionResult.ACCOUNT_FROZEN;
    
    double senderBalance = getBalance(sender);
    if (senderBalance < amount) return TransactionResult.INSUFFICIENT_FUNDS;
    
    // Alert system for high-volume transactions
    if (amount >= Config.ALERT_THRESHOLD) {
        notifyAdminsAsynchronously(sender, receiver, amount);
    }
    
    decrementBalance(sender, amount);
    incrementBalance(receiver, amount);
    saveLedgerRecord(sender, receiver, amount, System.currentTimeMillis());
    return TransactionResult.SUCCESS;
}

Technical Highlights

  • Compound Interest Calculation: Asynchronously computes variable interest rates based on player activity metrics.
  • Freeze & Fine Modules: Built-in administrative tools allowing immediate transactional holds and structured fines for rule violations instead of relying on kick messages.
  • High-Volume Alerts: Sends real-time Webhook logs when transaction thresholds are breached to intercept wealth exploitation.

Results

  • 99.8% Asynchronous Execution: Database writes are completely decoupled from game thread triggers.
  • Reduced DB Overhead: Transaction batching aggregates multiple balance shifts into a single query.

Specifications

  • Platform: PaperMC (Java)
  • Interest Routine: Asynchronous
  • Freezing Logic: Volatile Cache
  • Db Cache: Redis / HikariCP

Technologies Used

JavaPostgreSQLRedisAdventure

Architect

Designed and built by AdithyaDev for CrestMC.

Developer Info