VD Market - Release
💎 VD Market
A high-frequency, deflationary trading add-on for VDiamond and DiamondEconomy.
VD Market allows players to speculate on the server's economy using a real-time "Diamond Index" derived from total supply. Built with integer-rigidity and anti-arbitrage logic, it ensures a fair, high-stakes trading environment where every fee contributes to the server's deflationary goals.
📈 Core Mathematical Engine
The market operates on a strict Zero-Decimal policy. All financial values—including Profit/Loss, Entry Prices, Margins, and Wallet Balances—are handled as Integers to prevent rounding exploits and maintain economic stability.
The Diamond Index
The index is calculated in real-time based on the server's core multiplier:
Weighted Averaging (Double Down)
Adding margin to an existing position recalculates the entry point to reflect the current market price:
The Mandatory Burn
Every closed trade triggers a configurable transaction fee (default: 2%). These diamonds are permanently deleted from the netSupply, causing a natural rise in the Index over time.
🖥️ GUI Layout (54-Slot)
The interface is designed for high-speed information delivery. The Index Ticker and Position Stats refresh every 10 ticks to ensure the player is always seeing live data.
| Slot | Item | Function | Lore / Tooltip |
|---|---|---|---|
| 10 | 🟡 | Add Margin | Add more diamonds to your current trade to reduce liquidation risk. |
| 16 | 📖 | Wallet | Your total available diamonds in the VDiamond vault. |
| 22 | 💎 | Index Ticker | The current market value based on server supply. |
| 37 | 🔴 | Open SHORT | Bet that diamond value will drop. Close later to profit. |
| 40 | 📜 | Position Stats | View your entry, margin, and live profit/loss. |
| 43 | 🟢 | Open LONG | Bet that diamond value will rise. Close later to profit. |
| 49 | 🚫 | Close Position | End your trade, pay the fee, and collect your diamonds. |
Note: All empty slots are automatically filled with Light Gray Stained Glass Panes.
🛠️ Features
⚡ Unified Input Mode
To ensure precision, opening a position or adding margin triggers a seamless workflow:
- Player clicks the action (Long/Short/Margin).
- GUI closes and prompts the player in chat:
"Enter the number of diamonds (or 'cancel')". - Balance is validated against the VDiamond vault.
- On success, the GUI re-opens automatically with updated stats.
🛡️ Defensive Logic
- Anti-Arbitrage: When closing a position, the plugin pulls a fresh multiplier from the Core at the exact millisecond of the click to prevent payout exploits.
- Mutual Exclusivity: Players cannot hedge. Opening a Long position automatically prevents opening a Short, and vice versa.
-
Offline Liquidation: Trades remain live while players are offline. If the Index reaches the liquidation point (
$Loss = Margin$ ), the position is force-closed and the diamonds are burned.
📢 Configurable Announcements
- Market Burn Summary: Periodic broadcast of total diamonds destroyed by transaction fees.
- Liquidation Alert: Real-time broadcast of player liquidations and total diamonds burned.
📦 Installation & Dependencies
- Ensure you have the following dependencies installed:
- VDiamond (Vault provider)
- DiamondEconomy (Supply Core)
- Drop
VDMarket.jarinto your/pluginsfolder. - Configure your
config.yml(Fee %, Broadcast intervals). - Restart the server.
💾 Data Persistence
All active trades are stored via SQL to ensure data survives server restarts.
- Table Schema:
uuid, type, entry_index, margin, timestamp
© 2026 VD Market | Built for VDiamond Ecosystem.