Revision as of 16:22, 25 December 2024 by Librae (talk | contribs) (first part)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Trade

From librae wiki

Intergalactic trade is the heart of the economy of Librae. The game implements an iterative market simulation algorithm which matches demand and supply in an optimal way.

Terms

  • EC: universal currency, issued by Void Church.
  • Good: Some commodity which can be bought for EC.
  • Economy agent: An entity possessing some goods and/or EC which wants to participate in the market. The agent has a specific location and a store of EC and goods.
  • Demand: information about a good being desired somewhere. A demand has:
    • Budget: how much EC it is willing to spend during the cycle.
    • Maximum quantity: how much goods total it is willing to buy.
    • Maximum price: how much it is ready to spend per item.
  • Supply: information about a good being provided somewhere
    • Maximum quantity': how much goods total it is willing to sell.
    • Minimum price: how cheap it is willing to sell the items.
    • Some of properties on Supply/Demand might be absent or infinite, there is also special information like demand issuing energy credits, not willing to bargain, or not considering shipping a part of price.
    • Shipping: goods being transferred from supply to demand cost EC to transport. The price depends on number of breaches between agents as well as other minor factors like gravity of agent's base. EC paid for shipping are destroyed along with matching amount of fuel in VC storage, and are considered to be spent on transport.

Trading process

Trading is done separately for every good.

First, all economy agents (planets, VC, fleets) are queried for the list of their Demands and Supplies.

Every combination of Demand and Supply is queried for its viability. If a deal is theoretically possible (the max and min prices are compatible, shipping is considered, etc), a maximum price for demander and minimum price for the supplier that is possible as part of the deal is calculated and deal is added to the list.