> For the complete documentation index, see [llms.txt](https://docs.ohalee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ohalee.com/products/networkeconomy/features.md).

# Features

NetworkEconomy is designed to be **base infrastructure** for a multi-server network (BungeeCord / Velocity). Every server shares the same player balance in real time, so a player can hop between servers without a desynced balance — and without any way to duplicate currency by switching servers quickly.

## One Balance Across The Whole Network

A single MySQL / MariaDB database is the **authoritative** store for every balance. Servers never own a copy of a balance they can write back later; they read through to the database and keep only a short-lived local cache for display purposes.

That means:

* `/balance` on the lobby and `/balance` on survival always show the same number.
* `/pay` works between two players who are on **different servers**.
* `/baltop` ranks the entire network, not just the server you ran it on.
* A player who leaves one server and joins another instantly sees the same balance.

## Duplication-Proof By Design

The usual "load balance on join, save it on quit" approach is exactly what lets players duplicate money by rejoining on another server, and lets two servers overwrite each other's writes. NetworkEconomy never does read-modify-write: every money movement is a single atomic, relative SQL statement, and withdrawals check sufficiency *inside* the same statement that debits the account.

Two servers withdrawing at the same instant therefore cannot overdraw — the second one simply affects zero rows and reports `INSUFFICIENT_FUNDS`. See [architecture.md](/products/networkeconomy/architecture.md) for the full explanation.

## Real-Time Sync Over Redis

Redis pub/sub broadcasts every balance change to every node the moment it is committed, so local caches stay coherent in real time. Broadcasts carry a monotonic `version`, making them **idempotent and immune to out-of-order delivery**: a late message carrying an older version is dropped.

{% hint style="info" %}
Redis is optional. With it disabled the plugin still behaves correctly — the database remains authoritative — and caches are refreshed on a timer instead of instantly.
{% endhint %}

## Full Vault Compatibility

NetworkEconomy registers itself as the Vault `Economy` provider at the highest service priority, so **every existing Vault-based plugin works unchanged** — shops, jobs, crates, kits, anything. They automatically become network-wide economy plugins without a single change.

The bridge exposes the default currency, reports its symbol, name and fractional digits to Vault, and does not implement banks.

## Multi-Currency

Define as many currencies as you like (for example `coins` and `gems`), each with its own display name, symbol, symbol position, decimal precision, starting balance and whether players may `/pay` it. One currency is flagged as the default and is the one exposed to Vault; the rest are reachable through the commands and the API.

## Persistent Transaction Log

Every change is written to an append-only audit table: who, which currency, what type, how much, the resulting balance, the counterparty, a reason string, **which server it happened on**, and when. Nothing is ever overwritten, so the log doubles as a fraud and refund trail.

Players and staff browse it in-game through a paginated **transaction history GUI** (`/transactions`), where each entry is colour-coded by type — emerald for incoming, redstone for outgoing, paper for admin `set`, barrier for `reset`.

## Async API For Developers

A clean, fully asynchronous API (`CompletableFuture`-based) plus two Bukkit events — a cancellable `PreTransactionEvent` and an informational `BalanceUpdateEvent` that also fires for changes made on **other** servers. A no-I/O cached read is available for scoreboards and tab lists. See [for-developers.md](/products/networkeconomy/for-developers.md).

## Quality-Of-Life

* Amount suffixes: `/pay Notch 1.5k`, `10m`, `2b` all work, and commas are ignored.
* Tab completion for player names and currency ids everywhere, filtered to payable currencies on `/pay`.
* Optional `/pay` tax, minimum amount and self-payment block.
* Messages support both legacy `&` colour codes and modern MiniMessage tags.
* `/baltop` results are cached briefly to keep the query load off the database.
