# Crypto Configuration

Configure the cryptocurrency economy for your server.

## Overview

VibesEZ-Laptop supports four distinct cryptocurrency economy modes. Choose the mode that best fits your server's roleplay and economy design.

## Economy Modes

### 1. Static Mode (Simplest)

Perfect for: Roleplay servers wanting crypto without market complexity

**Characteristics:**

* Fixed prices that never change
* Closed ledger system
* No supply mechanics
* Informational market data only
* Admin controls all currency creation

**Configuration:**

```lua
Config.Crypto.EconomyMode = 'static'
```

**Use Cases:**

* Stable private tokens
* Utility coins for quests
* Rewards currency
* Server-exclusive tokens

**Pros:** ✓ Simple to understand ✓ No market volatility ✓ Predictable value ✓ Lowest complexity

**Cons:** ✗ No investment gameplay ✗ Limited economy depth ✗ Boring for traders ✗ No natural value changes

***

### 2. Controlled Mode

Perfect for: Servers with supply discipline and limited resources

**Characteristics:**

* Hard supply limits enforced
* Burn rates remove currency
* Scarcity-based economy
* Admin-controlled minting

**Configuration:**

```lua
Config.Crypto.EconomyMode = 'controlled'

Config.Crypto.Currencies = {
    BTC = {
        name = 'Bitcoin',
        maxSupply = 1000000,  -- Hard cap
        burnRate = 0.01,      -- 1% destroyed per transfer
        basePrice = 50000     -- Static base value
    }
}
```

**Use Cases:**

* Mining servers (currency is scarce)
* Long-term inflation control
* Token lifecycle management
* Resource games

**Pros:** ✓ Controls inflation ✓ Creates scarcity ✓ Prevents infinite supply ✓ Rewards held currency

**Cons:** ✗ Complex to balance ✗ Can create hoarding ✗ Less trading activity ✗ Players understand burn mechanism

***

### 3. Simulated Mode

Perfect for: Servers wanting market gameplay without real-time trading

**Characteristics:**

* Daily price updates (simulated)
* Market trends and volatility
* Price history charts
* 24h statistics (high, low, volume)
* Server-driven price changes

**Configuration:**

```lua
Config.Crypto.EconomyMode = 'simulated'

Config.Crypto.Currencies = {
    BTC = {
        name = 'Bitcoin',
        basePrice = 50000,
        volatility = 5.0,     -- 5% max daily swing
        trend = 0            -- 0=neutral, positive=bullish, negative=bearish
    }
}
```

**Update Mechanism:**

* Prices update every game minute/hour
* Random walk based on volatility
* Optional admin manipulation
* Trends can shift gradually

**Use Cases:**

* Stock market roleplay
* Trading/investing gameplay
* Economic competition
* Market prediction games

**Pros:** ✓ Interesting gameplay ✓ Investment strategy ✓ Market simulation ✓ Good balance

**Cons:** ✗ Medium complexity ✗ Requires price updates ✗ Can be volatile ✗ Player education needed

***

### 4. Liquidity Mode (Most Complex)

Perfect for: Advanced servers with player-driven trading

**Characteristics:**

* AMM (Automated Market Maker) pools
* Real-time price discovery
* Player swaps affect prices
* Liquidity pool mechanics
* Decentralized exchange features

**Configuration:**

```lua
Config.Crypto.EconomyMode = 'liquidity'

Config.Crypto.Pools = {
    {
        pair = 'BTC/ETH',
        BTC_reserve = 100000,
        ETH_reserve = 1000000,
        fee = 0.3  -- 0.3% swap fee
    }
}
```

**How It Works:**

1. Players swap currencies at current pool prices
2. Swap affects pool reserves
3. New price = constant product formula adjustment
4. Active trading keeps prices dynamic
5. Liquidity providers earn fees

**Use Cases:**

* Dark market/hacker themes
* High-interaction economy
* DeFi-inspired gameplay
* Advanced trading servers

**Pros:** ✓ Player-driven prices ✓ High interactivity ✓ Realistic market behavior ✓ Engaging economy

**Cons:** ✗ Very complex setup ✗ Requires pool seeding ✗ Needs fee structure design ✗ Steep learning curve

***

## Configuring Your Economy

### Step 1: Choose a Mode

Decide which mode fits your server:

**Decision Tree:**

```
Do you want market simulation?
├─ No → Static Mode
└─ Yes →
    Do you want player trading?
    ├─ No → Simulated Mode
    └─ Yes → Liquidity Mode
```

### Step 2: Edit Configuration

Edit `config/crypto.lua`:

```lua
Config.Crypto = {
    Enabled = true,
    EconomyMode = 'simulated',  -- Change this
    DefaultCurrency = 'BTC',
    MaxWallets = 100,
    
    Currencies = {
        -- Your currencies here
    }
}
```

### Step 3: Define Currencies

Add desired currencies:

```lua
Config.Crypto.Currencies = {
    BTC = {
        name = 'Bitcoin',
        symbol = 'BTC',
        icon = '₿',
        description = 'Primary digital currency'
    },
    ETH = {
        name = 'Ethereum',
        symbol = 'ETH',
        icon = 'Ξ',
        description = 'Smart contract platform'
    },
    SERVER = {
        name = 'Server Coin',
        symbol = 'SERVER',
        icon = '$',
        description = 'Server-specific utility token'
    }
}
```

### Step 4: Set Economy Mode Variables

Add mode-specific configuration:

**For Static:**

```lua
Config.Crypto.Currencies.BTC = {
    name = 'Bitcoin',
    basePrice = 50000,
    -- No other mode-specific settings
}
```

**For Controlled:**

```lua
Config.Crypto.Currencies.BTC = {
    name = 'Bitcoin',
    maxSupply = 1000000,
    burnRate = 0.01,
    basePrice = 50000
}
```

**For Simulated:**

```lua
Config.Crypto.Currencies.BTC = {
    name = 'Bitcoin',
    basePrice = 50000,
    volatility = 5.0,
    trend = 0
}
```

**For Liquidity:**

```lua
Config.Crypto.Pools = {
    {
        pair = 'BTC/ETH',
        BTC_reserve = 100000,
        ETH_reserve = 1000000,
        fee = 0.3
    }
}
```

### Step 5: Test Configuration

1. Save configuration file
2. Restart VibesEZ-Laptop resource
3. Create test player account
4. Check no errors in console
5. Test wallet creation
6. Test transfers
7. Verify economy mode behavior

## Economy Balancing

### Static Mode

**No balancing needed** - Prices are fixed

### Controlled Mode

**Balance Supply Limits:**

* Max supply not too low (prevents play)
* Max supply not too high (defeats purpose)
* Burn rate recovers from over-supply gradually
* Solo test with high burn rates first

### Simulated Mode

**Balance Volatility:**

* Low volatility (1-3%) = Stable, boring
* Medium volatility (3-5%) = Interesting
* High volatility (5%+) = Risky, exciting
* Start conservative, adjust based on player feedback

**Manage Trends:**

* Gradually shift trend up/down
* Neutral trend = neutral prices
* Positive trend = bull market
* Negative trend = bear market

### Liquidity Mode

**Seed Pools Carefully:**

* Ratio determines exchange rate
* Control initial reserves
* Higher reserves = lower price impact
* Start with large pools to stabilize market

**Fee Structure:**

* 0.1% = Very competitive
* 0.3% = Standard (most use this)
* 0.5% = Higher cost
* 1.0% = Prohibitive

## Advanced Configuration

### Adding New Currencies Mid-Server

```lua
-- Can add currencies after launch
Config.Crypto.Currencies.NewToken = {
    name = 'New Token',
    symbol = 'NEW',
    basePrice = 100
}
```

**Warning:** Players must restart laptop to see new currencies

### Import/Export Functionality

Allow admins to:

* Export crypto data for analysis
* Import data for migrations
* Backup economy state
* Restore from backups

### Monitoring Economy Health

Key metrics to watch:

* Total supply (growing too fast?)
* Average transaction size (normal?)
* Failed transactions (too many?)
* Active wallets (engagement level?)
* Price stability (too volatile?)

## Best Practices

✓ Start simple (Static) and escalate to complexity

✓ Test thoroughly before launch

✓ Gather player feedback early

✓ Balance carefully to maintain engagement

✓ Document your economy design

✓ Regular backups of configuration

✓ Monitor economy health metrics

✓ Adjust based on gameplay

✓ Communicate changes to players

✓ Have plan for economy adjustments

## Troubleshooting Economics

### Inflation Too High

**In Controlled Mode:**

* Reduce maxSupply
* Increase burnRate
* Limit admin minting

**In Simulated Mode:**

* Add negative trend
* Reduce volatility
* Lower baseprices

### Prices Too Volatile

**In Simulated Mode:**

* Reduce volatility setting
* Smooth out trends
* Manual price stabilization

**In Liquidity Mode:**

* Increase pool reserves
* Lower individual swap limits
* Encourage hodling

### Players Not Trading

**Create incentives:**

* Profitable trading opportunities
* Market rewards
* Trading achievements
* Economy-dependent content

### Economy Crashed

**Recovery steps:**

1. Identify the cause
2. Roll back to known good state
3. Adjust economy parameters
4. Gradually re-launch
5. Monitor closely

***

Need more help? See [Troubleshooting](/vibesez/docs/laptop/for-administrators/troubleshooting.md) or [Initial Setup](https://github.com/VibesEZ/VibesEZ-Laptop/blob/main/docs/admin/initial-setup.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vibesez.gitbook.io/vibesez/docs/laptop/for-administrators/crypto-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
