Skip to content

Releases: djuliovelasquez/VDMarket

Introducing Liquidity Providers

Choose a tag to compare

@djuliovelasquez djuliovelasquez released this 05 Apr 23:51
882ea26

VDMarket — Changelog

v1.1.0 — Liquidity Provider System

Overview

v1.1.0 is a complete economic overhaul. The core problem in v1.0.0 was that profitable trades created VDiamonds from nothing — violating the 1:1 backing invariant. v1.1.0 introduces an LP (Liquidity Provider) system and a Settlement Reserve (SR) that ensures every VDiamond in the market is always backed by a real diamond.


New: Settlement Reserve (SR)

The SR is the honest counterparty for all trades. No VDiamond is ever created from nothing.

Event What happens
LP deposits VD moves to SR. Player receives Vault Shares.
Trade opens Margin moves from player → SR
Trade closes (profit) SR pays margin + profit to player
Trade closes (loss) SR keeps loss, returns margin minus loss
Liquidation Full margin stays in SR, then split applied
Fee Applied on top, then split applied

Existing market_positions and market_burn_log tables unchanged — full backward compatibility.


Build Order

mvn install   (DiamondEconomy-1.1.4)
mvn install   (VDiamondEconomy-1.0.2)
mvn clean package  (VDMarket-1.1.0)

Server load order: DiamondEconomy → Vault → VDiamondEconomy → VDMarket

VD Market - Release

Choose a tag to compare

@djuliovelasquez djuliovelasquez released this 05 Apr 13:27
882ea26

💎 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:
$$Index = (int) (multiplier \times 1000)$$

Weighted Averaging (Double Down)

Adding margin to an existing position recalculates the entry point to reflect the current market price:
$$NewEntry = \frac{(OldEntry \times OldMargin) + (CurrentIndex \times AddedMargin)}{TotalMargin}$$

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:

  1. Player clicks the action (Long/Short/Margin).
  2. GUI closes and prompts the player in chat: "Enter the number of diamonds (or 'cancel')".
  3. Balance is validated against the VDiamond vault.
  4. 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

  1. Ensure you have the following dependencies installed:
  2. Drop VDMarket.jar into your /plugins folder.
  3. Configure your config.yml (Fee %, Broadcast intervals).
  4. 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.