Trade: Difference between revisions

From librae wiki
(first part)
 
No edit summary
Line 22: Line 22:
First, all economy agents (planets, VC, fleets) are queried for the list of their Demands and Supplies.
First, all economy agents (planets, VC, fleets) are queried for the list of their Demands and Supplies.


'''Trading tables''' are created. These are maps ordered by price that are created for every supply or demand, and look like this:
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.

{|class=wikitable
|+ Demands
|-
! Maximum price
! Demands
|-
|rowspan="2"| 0.556
| Planet 1
|-
| Planet 2
|-
| 0.345
| Fleet 1
|}

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 proper table.

Revision as of 16:34, 25 December 2024

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.

Trading tables are created. These are maps ordered by price that are created for every supply or demand, and look like this:

Demands
Maximum price Demands
0.556 Planet 1
Planet 2
0.345 Fleet 1

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 proper table.