-
Notifications
You must be signed in to change notification settings - Fork 1
Technical Specifications
Items that can be carried, such as a block of dirt or a diamond sword, are considered as "goods".
Trading in EconomyCraft imitates trading in real life with a hybrid between market trading and stock trading. The system in use is an exchange organised market where all participants are effectively dealers. Trading is order-driven, and a trade occurs (matches) when there exists a union between the price and quantity of the offer and bid.
The medium of exchange is the currency provided by the plugin. The plugin also provides a central payment system, in which the Central Bank facilitates the transfer of funds between entities (players, institutions, NPCs). Currently, each entity will have two 'storage' of money: their wallet (as cash), and in their bank account (accessible via banks). The methods of payments available are: cash payment, and EFT (money transfer between bank accounts). Usages and applications of the payment system will therefore have to consider the appropriate cases and 'storage' to use.
The plugin directly manages the database of bank accounts, and delegates management of wallets to another plugin (Vault). See the API section on how to access these 'storage'.
-
Market Trading - imitates real-time purchases of goods and services.
-
This involves immediate transfer of money and goods in a specific market. Since offer price is fixed in the market, market trading mean bid price is flexible.
-
Bid price cannot be set by the player (although the player may set a ceiling), and shall be derived from the market price.
-
Transfer of money and goods shall happen immediately. 1. Market trading accepts only cash. 2. Goods are delivered into:
- The player's inventory, unless it is full, which then it is delivered into:
- The player's portfolio in that particular market.
-
Exchange (Stock) Trading - imitates stock exchanges where orders are queue-able.
-
This is portfolio trading which queues bids and offers in the economy queues. Transfer of money and goods may not be immediate, and may happen during any circumstances e.g. when the player is not in a market, when the player is offline, etc.
-
Thus, goods shall not be delivered into the player's inventory; they are delivered into the portfolio.
-
The transfer of money happens between bank accounts over the EFT payment system.
-
The plugin may provide different commands for market and portfolio trading.
-
Selling (Offering)
-
There is no guarantee for immediacy therefore offering is always considered "exchange trading".
-
Players can offer goods from their inventory or their portfolio at the corresponding market. To ensure goods availability, goods are taken from the player and stored by the market until it is sold, or the player cancels the offer.
-
Portfolio
-
Each market shall maintain a portfolio of each player. Goods obtained through portfolio trading are kept here. Goods queued for offers are NOT to be kept here.
-
The market shall ensure players do not abuse their portfolio as some kind of a safe deposit. The plugin shall provide only withdrawing abilities to the player, although players should be able to sell goods from their portfolio.
-
Market owners are responsible for all of the market's portfolios and queues for a limited period of time. In the case that an owner wants to close down their market, either: 1. Sellers with goods in portfolios or queues shall be notified to reclaim all their goods in a specific amount of time (exact duration is up to server policy). The market may not be closed until either there are no more remaining goods, or that time has passed, after which all remaining goods are transferred to the Commerce Authority :), or 2. The owner agrees to reimburse the sellers' with all their remaining goods and closes the market immediately.
- The value of reimbursement is a percentage (server policy, e.g. 120%) of the market value of all those goods.
-
Matching Algorithm
-
The matcher identifies same goods by what is considered in game as the same item. The plugin currently uses ItemStack as identifiers. 1. Metadatas (e.g. enchantments) will have to be identify and used for comparison as well!!!
-
The economy shall provide intra (same-market) and inter (export) market trading, based on what is allowed by the owner of each market.
-
The economy shall charge a transportation fee, and optionally, a tariff, for inter-market trading. 1. The transportation fee shall be based on the difficulty of getting from the source to the destination market, and the fuel price.
- The types of fuel and their efficiencies are server policies. 2. The plugin shall provide an entity to represent the central Transportation Authority.
- The Transportation Authority should aim not to go bankrupt (and aim to profit), but must not exploit the fact that it is a monopoly.
- It does not magically gain transportation abilities; it must pay for fuel.
- The Transportation Authority shall have the necessary fuel pre-stocked, before permitting deliveries of goods.
- The Transportation Authority shall publish transportation prices between all the markets in the economy, and shall accept the price of an ongoing transaction (given it is based on a price that was valid) even if the price has changed.
- Financing for roads and other infrastructure projects (AI phase) should be primarily funded, if not entirely, by the Transportation Authority.
- The non-exploitation policy (5.3.2.1) implies that the Transportation Authority cannot be human.
-
The government or the owner of the market may tax sales. 1. Tariff and government sales tax revenue goes to the specified government account. 2. Taxation and other price-interfering mechanisms shall be fully transparent to players i.e. they are included in the final price that players will choose to agree to pay.
-
Matching Algorithm (Technical)
-
The plugin shall provide a fast and efficient matching algorithm. This means that matching may be done concurrently. 1. All data and data structures used by the matching algorithm shall allow concurrency.
- If a call is blocking, it shall not cause the entire pool to block.
-
The plugin shall be accountable for all transactions. 1. In the case that transactions cannot be recorded, the plugin shall fall-back to lower accounting methods (e.g. logging to a file or console), but still allow the transfer of money and goods.
-
Non-fatal errors shall cause the algorithm to fail gracefully. 1. This means that on error, anything deducted or awarded to players shall roll-back to the previous state. 2. Should goods go into limbo, the most extreme level of logging (e.g. email to server administrators and operators) shall be used, and they shall restore peace, order, and accountability.
Banks accepts deposits of money and goods, and are also financial institutions (Financial Phase) that creates credit and issues financial assets.
- Goods Deposit
- Money Deposit