# Exchange

ExcellentEconomy includes a built-in exchange system that allows players to swap one currency for another instantly.


# ⚙️ Setup Guide

To set up an exchange, you need to define the rates between two currencies.

Example Scenario: We want to set exchange rates for Gems and Coins, where 1 Gem = 5 Coins. In this case, the mathematical rates are:

  • Gems -> Coins: 5
  • Coins -> Gems: 1 / 5 = 0.2

You must add these rates to the Currency File for each currency involved.

gems.yml

Exchange:
  Allowed: true # Must be enabled to allow exchanges.
  Rates:
    coins: 5.0

coins.yml

Exchange:
  Allowed: true # Must be enabled to allow exchanges.
  Rates:
    gems: 0.2

Once configured, players can exchange Gems for Coins at a 1:5 rate, and Coins for Gems at a 5:1 (0.2) rate.