There are two kind of people when it comes to buying and selling on the trading post. He who spends and he who waits. This post is about he who waits.
I want to talk about the anonymous bidding wars the occur over items on the trading post, which happen nearly exclusively when buying. We’ve all done it. We want an item but aren’t willing to pay 2.50g when we can wait an short unknown duration to get it for 2g. What we do is match the highest buying price and add 1 copper. This leads to this kind of history in the Current Buyers table:
1 Ordered 1g 20s 34c
1 Ordered 1g 20s 33c
1 Ordered 1g 20s 32c
1 Ordered 1g 20s 31c
1 Ordered 1g 20s 30c
The idea behind this is not about the money but the person who keeps checking more frequently, and therefore wants the item more, is the most likely person to be sold that item when one comes available. This is fair when it comes to buying but is completely different when selling. When selling, you must pay a listing fee which makes re-listing your items not financially viable.
This led me to think about the algorithms used when determining who’s items are sold when a buyer, willing to pay the higher price, becomes available.
The trading post uses a FCFS (first-come first-served) algorithm when it comes to this. It seems very fair and is remarkably easy to program. It is, however, notoriously inefficient. Suppose you want to sell 100 of item x and you see in the Current Sellers table:
100 Available 1g 00s 12c
100 Available 1g 00s 13c
100 Available 1g 00s 14c
You are inclined to sell your 100 items at 1g 00s 11c, as you are going to sell your items sooner than listing them at 1g 00s 12c. This is because the FCFS algorithm will sell the previous 100 items before yours.
This starts a downward spiral when the cost of them item decreases over time if the supply is greater than the demand. There is no problem with this, as prices should change based on said supply and demand. The problem is the previous sellers will never sell their items and will lose their 5% listing fee. There is starvation.
I would like to propose a couple of other trading post universes and would like to know if you would prefer any of them to the current FCFS method.
1 – Stack rather than Queue
In this universe, we use a LCFS (last-come first-served, aka FIFO) algorithm. This is where the most recent post for buying or selling and item is the post that receives it first. This sounds incredibly unfair but makes remarkable sense. Rather than the nasty Current Buyers table that we have now, we can have a much nicer table:
3 Ordered 1g 50s 00c
2 Ordered 1g 25s 00c
6 Ordered 1g 00s 00c
This is because the price differences are actual genuine different offers and not just a fixing of the table to try and sell your item faster for a negligible setback of 1 copper. If I wanted to buy this item, putting in an offer of 1g 50s 01c would make no sense, as putting in an offer of 1g 50s 00c would achieve the same thing.
“Won’t the price never go up then?” you may ask. The price will go up if nobody will sell the item at that price because it is worth more. The buyer will be forced to offer more or never get the item.
When selling, this algorithm is grossly unfair and does not combat starvation.
2 – Round Robin
The relevance of round robin is apparent when looking at items which are selling for their minimum price. The idea is to use the same method as FCFS but to only sell up to a certain quantity per seller at a time.
Suppose you have an item with an minimum price of 20c, as selling it to a vendor would net more money than selling it for 19c. For this item, we are likely to see an empty Current Buyers table and a Current Sellers table:
90,000 Available 20c
4,000 Available 21c
3,000 Available 22c
Someone selling this item must post it at 20c and wait 6 months to see their listing fee again or sell it to a vendor. This reduces the versatility of the trading post.
Round Robin solves this. Suppose the 90,000 items are sold by 9 different sellers numbered 1-9, each selling 10,000 of the item. If an order for 9 of the item comes in then 1 will be sold from each of the sellers rather than 9 from the most recent seller. They are sold in the order than the sellers posted, so if an order for 5 items came in then sellers 1-5 will have their item sold and seller 6 would be next in line to sell their item.
3 – A combination
An actual better way of implementing the trading post can be seen by merging these two methods together. By using LCFS and Round Robin when selling items we can attempt to eliminate the unfair practice of undercutting other sellers to the extent that their items don’t sell and they lose their listing fee.
Suppose we have a Current Sellers table of:
1000 Available 1g 50s 00c
where there is only 1 person selling this item. A new seller for 100 of the item would be given the incentive of using a LCFS algorithm to post their item at the price of 1g 50s 00c rather than 1g 49s 99c, as their item will be sold before the previous seller. Posting it at either price achieves the same thing, so will post it for the higher price. However, the use of round robin would help to reduce starvation by selling items from both sellers when a new buyer is found.