Sunday, December 17, 2017

The Math of Path of Exile: Profit Via Knowledge and Probability

Following the success of the previous post (Path of Exile Economy: Currency Trading), in this article I'll explore several additional methods and frameworks for making a profit by using probability, market imperfections and asymmetric information.
I assume the reader has some amount of experience both playing and trading in POE - and/or you read the previous post that covers some of the basics of POE economy and trading process.

Note that all prices are from the time of writing and will be different in the future - my goal in this article is to describe the process and logic behind such profit engines - the examples I showcase are just that: examples, and they might not be profitable next month - who knows?

One of my biggest sources of joy and entertainment in POE is (unexpectedly) not part of the gameplay at all. I like reverse engineering the math behind the economy. I try to understand what makes it tick - because that's the way to find profit-generating loopholes. POE provides a great sandbox for research and experimentation - since, you know, it's just a game and all the money is virtual - but it's complex enough for the tools and models from real world economics to apply.

In the following sections we will see not only how to make profit within the POE P2P (player to player) trading ecosystem - but also that these loopholes exemplify real world processes and economic forces, because humans are humans - whether in game or in real life.

(Just to make sure we're speaking the same language - c=chaos orb, ex=exalted orb, F=orb of fusing, J=jeweler's orb etc.)

Table of Content:
 - Deterministic Profit - Earning Currency Without Luck
    - Piece by Piece 
    - Fate 2 Win
 - Market Conditions and Information Asymmetry
    - Water Into Wine, Jewelers Into Fusings
    - The Best Tabula is a Vendored Tabula
    - Dirt Cheap? Flipping Wisdom and Portal Scrolls
    - Price of Guardian Maps vs Price of Fragments
 - Profitable Probability
    - Corruption Pays
    - Profit is Divine

Deterministic Profit - Earning Currency Without Luck

Piece by Piece
There are quite a few divination cards in POE that produce currency items, from wisdom scrolls all the way to mirror of kalandra. For the ones that can be exchanged for expensive items the pricing is very straightforward - 
House of Mirrors is 16-17ex, which makes sense as the mirror is ~150ex. The ones that require many cards to get average results (like Rain of Chaos or The Catalyst) are usually too cheap to trade for or bother with.
But there is a middle ground. Cards like Vinia's Token and Lucky Connections hold around 2c value each - but not exactly. For example - each Vinia's should be valued at about 2.4c (5 cards give 10 regret orbs, and the price of buying regrets is about 1.2c at the moment). Some players price it at 2 regrets - which is obviously most accurate - but some want c, so the price has to be rounded somewhere, usually 2c. More often than not it's a player who just found one, has no intention of farming a full set, and just wants to get some value from the card.
Earlier today (at the time of writing) I bought a set (via 3 transactions) of Vinia's Token for 10c, netting 10 regret which I can sell for 12-12.5c. That's about 0.6c profit per transaction - not amazing but unlike currency trading this can be done via your initiative - no need to wait for anyone to offer trades to you. As an added bonus, there's no price fixing since none of the scammers care enough about this small market.

A couple of months ago a Lucky Connections dropped for me at a Port map - so I did the same process but had to wait for cards to show up with a 1c price (back then c was more expensive so it made sense to round a ~1.4c value down to 1c) - but a 7c -> 20F trade was a good deal even when fusings were about 0.5c (again about 0.5c profit per trade).

Another straightforward example is Chayula's splinters (costs 2c) while Chayula's breachstone is ~210-215c. So you can earn a 10-15c "commission" for going through the trouble of collecting all these splinters (which should net somewhere between 0.7-1c profit per exchange - not bad!).

The last example is The Vinktar Square. This unique map can be created by vendoring 4 unique staffs (Agnerod North, South, East and West). The map prices vary somewhat but at the moment you would be able to sell it for ~67-70c easily. Each rod can be picked up for about 14-15c, then vendored, then the map sold - producing 1.5-2c profit per trade (which is actually crazy good).

Once I saw the math above I went on to actually do that:

Ordered by their cardinal directions. Yes, they all look the same so you'll just have to trust me.

Got each of the rods for 14c, but it did take on average about 6-7 tries to get one that wasn't sold and the player not AFK. I almost sold the map for 69c but decided to run it myself - forfeiting 13c of profit! The market failure here is that players keep paying too much for complete maps, instead of buying the pieces - probably due to lack of knowledge about this vendor recipe.

Fate 2 Win
Fated uniques are (better) versions of ordinary uniques that can only be obtained by fulfilling a prophecy while the basic unique item is equipped. Each fated unique has it's own specific prophecy that must be first obtained (either by asking Navali and being lucky or by buying a sealed prophecy from another player) and then fulfilled to get the upgraded item.
Fated uniques are often much (much) more valuable than the basic versions. The two most expensive upgrades are:

 - Doomfletch - that you can get practically free (1alc) or several chaos for an almost perfect roll - get's upgraded into Doomfletch's Prism - which is valued at 40-50c for random rolls and in the 1-2ex range for very high rolls. The prophecy (Ancient Doom) costs about 45c.

 - Death's Harp - again almost free for random rolls or several c for high rolls - becomes Death's Opus which is easily 25-30c. The prophecy (The Bowstring's Music) is about 20c. Accidentally, this is the bow I use on my tornado shot character this (Harbinger) league - which I got by buying perfectly rolled Death's Harps and fulfilling the prophecies until I got lucky (this is the maximal damage possible):

I'm not sure if there is some deep reason why bows get special treatment (the third most expensive fated unique is The Signal Fire quiver - also for bow characters) but it doesn't really matter for our purpose. The basic idea is we can buy the "ingredients" - the base unique and the prophecy - and get something that can be more valuable, thus making profit in exchange for our effort (a couple of trades and killing the relevant boss). Note that the quality of the rolls has a strong effect on the price of the fated versions (as in any high value unique), and most fated items add at least 1 randomly rolled property when they become the fated version. Although on average it seems to be profitable, I promised profit with no luck involved.

Enter Doomfletch's Prism. It only changes a property - doesn't add new ones - so all the rolls are determined purely by the base unique. If we look on for the basic Doomfletches, filtering out anything below 80 physical DPS and below 37% increased crit chance (leaving us only with well rolled bows), ignoring the price fixers and taking the cheapest 10 results - we see a price range of about 20-30c (although I just bought one for 15c - so take any price ranges with a grain of salt). If we do the same for Doomfletcher's Prism we see roughly 100-150c. 

According to this math, even if we buy a good base unique for 30c, pay 50c for the prophecy, and sell the fated version for the low price of 100c - we still make 20c profit.

As always - we should be careful when using prices directly when there is a small sample size of traders for the specific item (the top 10 results for these well rolled Doomflether's Prisms span the range from 1ex to 7ex), so you never know what you'll actually be able to sell before you try.

So I tried.

Got the bow for 15c:

Bought the prophecy for 43c. Killed the overseer (took almost 5 minutes because the pyramid has a horrible layout). Blessed it up to max increased elemental damage. Got this:

And sold for 0.9ex - 25c profit!

Market Conditions and Information Asymmetry

Water Into Wine, Jewelers Into Fusings
As some of you know, starting at level 6 Vorici offers a discounted currency trade of jewelers into fusings: 
64J -> 20F
It can be done only once per day (the shop resets after completing or failing his daily mission) and as a rule of thumb it's a very good deal. How good? Let's check currency trade rates:
~7.2J -> 1c
~1.75F -> 1c
So we transform 8.9c in jewelers into 11.4c in fusings. Free 2.5c everyday is pretty nice - so don't forget to do it!
If you're a reasonably experienced player perhaps this doesn't surprise you. But there's something even better. If you try looking for jewelers -> fusings deals on you get the following results:

You go Yeena! Best deal in town.

Note that the relative prices on the P2P market is 7.2/1.75 ~ 4.1... In principal, that means that no rational trader should ever sell jewelers at the current prices - they should exchange them into fusings at vendor price (!!!) and sell the fusings. The extra few percent of value is perhaps not worth the clicking (and if too many players will start actually doing that jewelers will become rarer and the price will rise - nullifying this gap), but as a note for the future - vendor deals can sometimes create alternate trading options - providing an edge on the market.

The Best Tabula is a Vendored Tabula
Since we've already mentioned vendor recipes, let me share an experiment I did a few weeks ago. As some of you know (but apparently some players don't), vendoring any 6-linked item gets you a divine orb. If we check the price of divines at the moment we get:
16c -> 1D
Now, in a perfectly rational, complete knowledge marketplace (like the one classical economists usually talk about), that would mean that there is a lower bound on the value of any 6-linked item - regardless of its properties - as it can be vendored for a divine at any time which we could then sell for some c (~16 at moment). As the owner of the 6-linked item the vendor recipe creates an additional route to approach the market that players are free to use if they wish.

But, just like in the real world, player based markets are not perfectly rational or based on complete information. If you run a search on for any 6-linked item, you will find many below the price of 1 divine, most of them Tabulas. I spent an evening buying any item listed for 1-2c below the price of divines to prove that the concept works - and it does (random screenshot mid process):

Not only does it work, but some more determined people (who are willing to go into the grey area of the GGG user agreement and use scrapers and bots) seem to be exploiting this pattern consistently. "Catching" players at the exact moment they list an underpriced item was somewhat of a headache - mostly because most often than not I was too late. 
I was able to get the Tabulas underpriced by 1-2c but not the ones cheaper (yes there were some listed even cheaper). My guess would be that some people saw the same loophole and now employ private stash scanners and/or trade bots to get the most profitable deals. After a while I gave up and limited my filter to see only the slightly underpriced 6-links - so I stopped wasting time without getting any response - but I was still able to generate ~1c/trade returns on average. All due to information asymmetry.

Dirt Cheap? Flipping Wisdom and Portal Scrolls
In my previous post about currency flipping I've talked about the price margins and trade volumes needed to maintain an average profit above a certain level, and in principal scrolls are no different. As the cheapest and most common currencies in the game, you might guess that the trade volumes must be large (otherwise it's not worth the time) but other than that it's just another currency to flip. Turns out there is a more interesting effect in place.

I get trades regarding wisdom scrolls maybe once every couple of days (don't forget - I intentionally do not offer the cheapest prices on the market) but when I do, the price margins are huge. I usually sell wisdoms at ~100/1c and buy at ~300/1c. No other currency has a 3X difference between buy and sell prices. What's going on here?

One aspect is simply the fact that there are relatively few currency trades dealing with scrolls - probably it's (wrongly) perceived as too low value to even bother, thus making the market less competitive. But I believe there is an additional effect.

Who buys scrolls in the first place? I mean - the drop rates are very high, so who needs more scrolls? Usually these are the more experienced and advanced players on the higher level characters. Since they are probably 
efficiently farming high level content most of the time, a wisdom scroll is literally not worth the nuisance of clicking on it and the time to walk to it - so they don't. For them paying 7c or 10c (as an example) for 1000 wisdoms is practically the same - 3c is pocket change at that level and 1000 wisdoms will last quite some time. So we can charge relatively high prices.

Who are selling these scrolls to me in the first place? Usually newer player - or at least newer characters, trying to get enough c to buy some piece of equipment, so they are selling what they do have to anyone who wants it. They still pick up scroll loot - so they feel first hand how common their drop rate is - and they probably have thousands in the stash. Their value is perceived to be low - almost negligible, so much higher prices seem to make sense for them.
If that is the case, then the price gap stems mostly from the difference of perception between various categories of players.

In the future it's valuable to look for these types of differences in value. White leather belts being another example: practically worthless for most players, but the ones who try to chance Headhunter need them in large quantities - creating demand and subsequently monetary value (it was common to get 5:1c deals on the leather belts back in Legacy league).

Price of Guardian Maps vs Price of Fragments
Back in Legacy League, the price of the guardian maps was almost always the price of the shaper fragment that will be dropped by the map boss + a small additional cost - representing the possible loot and exp from the rest of the map and the chance to get a guardian unique that's worth something.
As of this moment, a somewhat strange situation is in effect in Harbinger League: the fragments cost more than the maps (using the approximate average of the 10 lowest prices on at the moment of writing - while ignoring low price fixing):

Each of the 4 maps is 
~4-4.2c (10 chisel)

Chimera fragment
Phoenix fragment ~6c
Minotaur, Hydra fragment ~5c (and climbing)
Full set ~26c (yes, it is more than the sum of its parts - people pay for convenience. Buying pieces and selling sets would give an average 3/5c profit per trade - not bad)

So assuming you are able to complete the maps and get the fragments - you are
guaranteed a profit of 1-3c per run - before including any loot from mobs along the way. The guardian maps are mostly fairly linear and have good topology, then what can explain this weird price price gap?

One possible explanation may be that the guardians are long, difficult and sometimes very dangerous fights (depending on the map mods). At the very least it takes a long time to complete for the vast majority of characters - while the returns from the boss itself (except for the fragment) are often negligible, so the battles are perhaps not worth the time.

That being said, many players still perceive the Shaper fight, despite being very very long, to be cost efficient - so there is constant demand for the fragments, creating a market force incentivising some of the players to beat guardians despite the difficulty.
So if you are not afraid of the challenge, guardian maps are guaranteed profit at the moment. 

In the future, be on the lookout for similar situations - where there is a guaranteed (or almost guaranteed) return on investment that covers the costs of said investment and then some.

Profitable Probability


When the time comes to get a build into its final form, many of the purchases include corrupted versions of items - mostly gems and uniques.

When vaaling gems the goal is usually to get it to level 21 or to 23% quality. I'm currently playing a Tornado Shot deadeye and I use
Siege Ballista for mob distraction and culling strike. Naturally a 21/20 skill gem would be the best, so I got a few 1/20 gems, and now leveling them to 20 and vaaling. So far my results aren't the best:

2 tries are apparently not enough, but how many is?
The Vaal Orb wiki says that vaaling a gem can have 4 possible outcomes:
 - No effect (other than adding the corrupted property).
 - Add or subtract one level. Max level gems can exceed their normal maximum this way. 
 - Add or subtract 1-10 quality. Gems can have up to 23% quality this way.
 - Change the gem to its corresponding Vaal Gem (if there is no Vaal version, this is identical to the first option).

Let's do some math:

First, we need to figure out the relative probability of each of these outcomes. I was unable to find a completely definitive answer (though I spent hours googling and reading posts) but items follow 25% for each type of outcome - so a reasonable assumption would be that gems work the same. Note that this may be not exactly accurate - only GGG know for sure.
Second, once the type of outcome is chosen, there is still the specific roll to be determined. In the case of level change it can be either +1 or -1 so (again assuming the roll is fair) you should get +1 level about 1/8 of the times. This is consistent with the common wisdom that you should level 7 gems of your main skill (1 in use and 6 in the off hand equipment) to then vaal them all at 20/20 and hopefully get the coveted +1. 
In the case of quality, any roll of +3 and above is rounded down to 23%, so a gem has a chance of:
0.25 (quality change) * 0.5 (increase quality) * 0.8 (roll +3 or higher) = 0.1
to end up 23% quality (again, assuming all rolls are equally likely).
Siege Ballista is a very niche skill so I have to do it myself, but armed with this math we can consider making a profit by vaaling highly popular gems.

Let's take the brand new
Maim Support as an example. Prices of all possible gem configurations (taking a rough average of the cheapest 5-10 results):

Non-corrupted 20/20 : 
~30cNon-corrupted 19/20 : ~20c
Non-corrupted (1-18)/20 : ~15c
Corrupted 21/20 : ~1.5ex (~140c)
Corrupted 20/23 : ~50-60c (small sample size)
Corrupted 20/20 : ~25c 
Corrupted 19/20 : ~20c
Corrupted 20/(10-19) : ~12c
Corrupted 20/(21-22) : ~35c (very small sample size)

A couple of interesting points to note (assuming the prices are roughly accurate):
 - The value of effort in leveling a gem from level 19 to 20 is priced at 10c for uncorrupted gems, but at 5c for corrupted ones.
 - It takes ~240 million exp to get Maim from level 19 to 20, but only ~100 million to get it from 1 to 19. Meaning, if you buy 1/20 gems and sell 19/20 - you're making more profit per exp than upgrading 19/20 -> 20/20, especially since you can often pick up ~15/20 gems for the same price as 1/20.

Now we're getting to the main question: suppose we have a 20/20 Maim gem, should we vaal it or not?

Let's calculate the expected value we'll have after vaaling and compare it to the value we had before (which is simply ~30c for the gem + ~1c for the vaal orb):

(Nothing happens:) 0.5 * 25c +
(Level increases:) 0.125 * 140c +
(Level decreases:) 0.125 * 20c +
(quality decreases:) 0.125 * 12c +
(quality increases by 1-2:) 0.025 * 35c +
(quality increases by 3-10:) 0.1 * 50c =

Which is much more than the ~31c we started out with - so the answer is yes.
As always, price checking on is a little problematic - you can usually get cheaper items if you wait and seize opportunities - but that's true for all parts of the equation so it shouldn't affect our conclusion.
The most sensitive point in the calculation is the ability to actually sell corrupted 20/20 gems for 25c which I'm slightly skeptical of, but even if the price goes as low as 20c we are still well in the profit margins.

Corrupting uniques is a similar process and a similar calculation - the main difference is the higher volatility. When corrupting a unique item it might "brick" - becoming a rare of the same type - often rendering it worthless, an outcome we didn't have with gems. The relative probability for the various corruption qualities can be calculated from the datamined information
here, so once the prices for each outcome are checked - you can make the same calculation for your favorite unique to determine the profitability of corruption.

Profit is Divine
As we mentioned in previous sections, the price of high end equipment depends greatly on the exact mod rolls it has. Mirror-level rare equipment crafting and rolling is an art in itself (which, to be honest, I am yet to master) so I'll talk only about uniques - thought the basic math works for any POE item.

The best rolled unique items routinely have 4-5 times more value than random mediocre rolls. The fated bows mentioned before are an example, not to mention high end uniques like Atziri's Disfavor and
Starforge - but not Bisco's Collar: an almost perfect amulet costs only ~50% more than low rolls. What's going on here?

Enter Divine orbs (D for short). Since you can reroll explicit stats for your equipment, we can imagine the value of a unique item to be made up from 2 parts: which item is it + how high are its stat rolls. For the price of 1D, you can maintain the type of the item (which can be changed by ancient orbs for example) but buy another shot at better rolls. The easier it is to get high rolls, the less price discrepancy there will be between the mediocre rolled items and the high rolled ones. 
But what do we mean by "easy" to get high rolls? Well the question is what rolls do we want. Let's do 2 examples that will exemplify the difference (note that there are many cases when the math is actually more complicated - for example when the minimum and maximum added damage are separate stats - and should probably done on a spreadsheet or via script, not the "napkin-back" math I'm doing here).

Starforge - currently considered the best 2H sword for physical builds - is not cheap. The cheapest one currently listed in Standard is 3ex. The one with the highest DPS is 15ex. Should we buy the cheap one and Divine it up or should we just buy the better version?
The sword has 3 rollable properties:

101 possibilities for the damage increase, 4 possibilities for the attack speed and 11 for the extra life. The 15ex sword is 496, 8, 99. How many Divines, on average, would it take to get the rolls at least as high?
The relative part of all possible Starforge variants that are at least as good is:
5/101 * 1/4 * 2/11 = 0.00225
Assuming all values are equally probable (which is widely believed to be true but has not been proven), we see that it'll take, on average 1/0.00225 ~444 tries to get such a good roll. Considering the Standard conversion rate is approximately 1ex : 5-6D, the 12ex price difference gets us only ~70D, so if we really want to get such a near perfect roll we are much (much) better of just buying the high rolled sword (in that sense, it's actually underpriced).
Scrolling down a screen or two, we can see a Starforge with 497, 7, 94 for 10ex - translating into:
4/101 * 2/4 * 7/11 = 0.0126 => ~79D
Which is still cheaper to buy outright but now the difference is smaller. So we see that even though the price difference between low roll and high roll is X5 - it's still much better than trying to get it yourself via Divines - since there are 3 stats, all of them desirable and important which together make a high roll very improbable (especially the very wide range of the increased damage).

If we think about Bisco's in the same way, there is actually only 1 stat that really matters: (50-100)% increased Quantity of Items Dropped by Slain Normal Enemies.
If we want a very good 95%+ version, we have 6/51 = 0.118 => 8.5D - so there is an upper limit to the price difference between low rolled and high rolled Bisco's uniques. So if the difference is more than 8.5D you are better off buying a low roll and upgrading yourself. Even better - if high rolled amulets seem to be selling successfully with a higher price margin - consider buying, upgrading and reselling systematically for a possible substantial profit.

This has been quite a longer piece than I've originally intended (and was written in chunks over several weeks). POE is a deep game that rewards players for intricate knowledge - from in game mechanics, vendor recipes and bonus stacking to data mining drop probabilities. When it comes to P2P trading, seeing loopholes sometimes means knowing the game much better than most players - otherwise everyone would be doing that and the market would rebalance itself. That is why finding these "less traveled" economic routes is satisfying for me: it's not the c, it's the mastery.

Until next time, may you see the holes others do not.


{If you find my ideas or analysis interesting - consider subscribing (box on the right). You'll never miss a post and I'll know I'm not talking only to myself :) }

Sunday, August 27, 2017

Path of Exile Economy: Currency Trading

Path of Exile (POE) is quietly becoming a world-wide phenomena for the past several years. The action-RPG (think Diablo) is created by an indie game studio based in New Zealand - Grinding Gear Games - which was established in 2006 specifically to create POE - "the only game we ever wanted to make". Today the game has millions of active players and consistently rises in popularity from one expansion to another, not to mention being quite profitable (despite being technically free-to-play).

POE is considered to be geared towards a more hardcore-gamer audience - with it's famously intimidating passive skill tree, highly customizable and optimizable skills and abilities - and most importantly for this article, an incredibly rich player-based economy.

A good indication of the size and dedication of the POE audience is the wealth of independently developed tools and calculators for the game (which is also a proof of the complexity of the game - as some of these tools are practically a must for efficient gameplay).

My personal experience with POE started about 3 years ago. A friend recommended, and it's free to play, so I thought "why not?". It took me almost a week to complete the game on normal difficulty (for comparison, it takes me ~6-8 hours today), while fighting through the many complexities of the character progression and skill mechanics - and making a million mistakes along the way. I quit then, but after a while the infinite possibilities for customization of skills and character builds tempted me back. I've been playing on and off ever since. 

Any good game that has depth and complexity lets players discover more and more levels of gameplay - that naturally come with both character and player progression. Being part of the POE economy - namely trading items with other players - is an additional level of gameplay that is not directly related to the game itself, but is surprisingly rich and requires above average understanding of game mechanics to participate fully. 

I've traded more and more in the past several months and recently (at the end of patch 2.6) started "flipping" game currency. Being part of the economy transformed the way I experience the game as a whole - this article summarizes some of my observations and calculations on the subject.

POE Currency

One of the most interesting decisions Grinding Gear Games (GGG) made when designing the core mechanics of POE was removing the gold. It is almost universally accepted and expected that any RPG has some form of basic currency that everything can be traded for - the proverbial "gold coins". The characteristic that defines "gold" is that it's the fundamental trading currency, but also that it has no intrinsic functionality - thus its value is defined solely by the other valuable resources/items a player can buy with it. 
Any game where monsters occasionally drop loot and/or gold when defeated has an inherent inflation mechanism: the amount of total gold in the world is constantly increasing simply through players playing the game. Hence, the value of each gold coin diminishes - unless there are "money sinks" built in the game world economy that naturally remove some of the influx of gold from monster loot (equipment occasionally requiring costly repairs by an NPC is a popular example of such a sink - though perhaps not the best game design).
Once gold loses its value, players often turn to other currency that they use for P2P trading (like the classic Stone of Jordan in Diablo II).

GGG solved most of these problems by canceling gold all together. POE has no currency that is used only for trading - every single item in the game has some intrinsic functionality and value. Thus, there are many items that are considered "currency items" in POE - each does something different when consumed (providing a natural money sink mechanism):
My currency item storage tab (end of patch 2.6 "Legacy League"). And even more types of currency were introduced in patch 3.0.
Despite the multitude of currency items, historically one POE currency always rose as the "gold standard" - completely through natural evolution. This is a fascinating free market model that has many similarities to real world barter based economies that evolved in situations where money was meaningless - for example due to inflation or banking collapse. Today the dominant currency is "chaos orbs", with a few other types used for smaller trades, but there were times when for example "gemcutter's prisms" were the "gold standard" - so the market shifts as the game evolves.
"That's interesting, but how does it effect the player experience?" you might ask...

Trading in POE and the "Price of Exchange"

Let's say I find a good item while progressing in the game, but I don't need it at the moment (perhaps it doesn't fit my current character or maybe I already have a better one). Often I would try to "sell" it - list it publicly hoping to trade it to another player in return for some currency. The idea is that, like in any true free market, the item might not hold value for me - but does hold value for someone else, so we can make both of us better off via an exchange (assuming he gives something of value for me in return).
In principal I could try trading it for a different piece of equipment that I do need (instead of some currency items) but, just like in the real world, this type of barter has numerous disadvantages and is almost never used.

As in most RPGs, in order to trade the two players must be in the same game zone. This seemingly trivial requirement actually creates a natural friction in the trading process. Usually while I'm in the game I'm, well, playing the game - so when a potential buyer sends me a message that he is interested in something I have for sale, I must stop what I'm doing and go meet the buyer at some location (one of the towns or player "hideouts"). The process usually takes less than a minute if both players are used to trading in POE, but it's somewhat annoying and partially breaks the game flow.

So a few months back I've decided to stop selling equipment for cheaper than a certain price (1 "chaos orb"), figuring that smaller profit isn't worth my time - I'd rather keep playing the game itself. If the equipment doesn't sell for at least 1 "chaos" after some time, I'd just get rid of it to free up space in my "shop" storage.
Basically I've defined that an exchange must net at least 1 "chaos" of profit or shouldn't happen at all - that is my "price of exchange" (which varies between players of course).
In a sense this effect can be compared to the transaction cost in a real world stock market - where the exchange itself takes a small percentage of every deal as a brokerage fee, creating friction.

Currency Flipping

Currency trading in general refers to the act of trading one type of currency items for a different type - currency<->currency instead of equipment<->currency trading.
The first question someone who has never played POE might ask is "why would you trade currency in the first place? Isn't it like trading gold for silver or vise verse in a normal RPG?". Since POE currency items are consumables which have an effect in their own right - sometimes a player wants the functionality of the currency but doesn't have it (or not enough of it). That player can either keep playing/grinding for this specific currency type, but a more practical and much faster method would be to buy it.
In that sense, players who make currency<->currency trades are like money changers in the real world. You could in principle earn some Euro directly before you go on your vacation - but no one actually does that. Everyone prefers convenience - even if it means paying someone a little extra.

Currency "flipping" is the act of trading the same 2 currencies back and forth, repeatedly, between different players. Let's say we're talking about alchemy orbs (which upgrade a normal item into a random rare one - alc's for short) and chaos orbs (which transform a rare item into a different rare item randomly - often denominated simply as c). 2 weeks before patch 3.0 the rates of trade I was offering were:
1C -> 3.125alc
1alc -> 0.23C

So a player could buy 3.125alc for each C he gave me, or buy 0.23C for 1alc.

The first thing you might notice is the fact that the rates aren't equal - the transaction is not reversible (you couldn't buy back 1C with the 3.125alc you would get by selling that 1C). This is similar to the gap between the buying and selling price of real world currency at money changers: they provide value in the form of convenience so they monetize some of it by giving slightly "unfair" exchange rates.
And just like real world changes, I prefer to buy and sell the same amount of each currency - on average, otherwise I'll run out of alc's (in this example) or stockpile too much of them. More on that later.

The second thing you've perhaps noticed is that the prices are not round numbers, and it is impossible to split currency items into parts - so what does "0.23C" mean?
The trick is simple - most trades involve volumes larger than 1 of a currency item. In reality the rates are:
8C -> 25alc
70alc -> 16C

The C->alc side is clear - 8 is the lowest number you can multiply both sides by and get round numbers, but the other direction could be written as 35alc -> 8C to get the same result - so why? This is where the "price of exchange" plays a role.

I have 2 goals while trading currency in the long run:
 - Maintain an approximately even rate of inflow and outflow for each currency.
 - Make sure I earn at least 1C of profit per trade (on average) - otherwise the trade doesn't overcome the friction of exchange.

And I have 4 "dials" to fulfill them:
 - Exchange rate for C -> alc trades.
 - Exchange volume for C -> alc trades.
 - Exchange rate for alc -> C trades.
 - Exchange volume for alc -> C trades.

Note that the second goal is not trivial. If I sell 25alc's and receive 8C in return - I did not make an 8C profit. Unlike the case of selling equipment - where the gear itself held 0 value for me in practical terms (it was just laying around in my stash), so getting paid 1C meant 1C clean profit - when trading currency I'm giving away something that does hold value for me. I use alc's all the time as part of normal gameplay - and the only reason I'm able to trade them away is because I don't need more than ~20 each day, so if I have 100alc's - 80 of them can be treated as "just laying" at the moment, but might become useful tomorrow. So how can we calculate profit per trade?

Assuming the first requirement (balanced trade per currency) is fulfilled (if it's not then this business model is not sustainable anyway), we can look at a single cycle of a chunk of currency I receive:
 - Pay 16C to get 70alc's. That takes 1 transaction (our balance is now C: -16, alc: +70, transactions: 1)
 - Pay 25alc to get 8C (C: -8, alc: +45, T: 2).
 - Pay 25alc to get 8C (C: 0, alc: +20, T: 3).
 - Pay 25alc to get 8C (C: +8, alc: -5, T: 4).
Since we are looking at long term averages we can simply say it takes 2.8 alc-selling transactions to "get rid" of the chunk of alc's from 1 alc-buying transaction, and nets a profit of 6.4C per cycle:
Profit per Exchange = Profit from Cycle / Number of Transactions = 
6.4 / 3.8 = 1.68C

If we do the same calculation for an exchange volume of 35alc -> 8C, we'll get Profit per Exchange = 1.33C - despite the identical rates of exchange - because it would require 1 additional transaction to complete the same currency cycle. 
Alternatively we could ramp up the transaction volumes to get more profit per trade. So why don't we?

Free Market Forces

When a player wants to buy currency, usually he would go to the most prominent POE trading website (appropriately called and run the relevant search:

Which is ordered from best deal to worst deal by exchange rate. Obviously he would then try to buy the chaos orbs for the cheapest price - basically going from the top to the bottom (and there are much much more results than what you see here) messaging each seller until 1 responds and the transaction takes place.
Note that both of the cheapest price offers require very large trade volumes. If the buying player only needs 5C, or simply doesn't have so many alc's, these trades are irrelevant for him - so he would go on and message all the 1:3 sellers.

In order to get business, a currency trader must first offer a competitive price - preferably be in the first page of search results (just like a real product on Amazon would) - but also offer small enough trade volumes to be comfortable for most players.
So you can't increase the profit per transaction by setting a huge exchange volume - even if you were rich enough to be able to make the trades - because the vast majority of players don't want/have such large sums. 
On the flip side, the sellers that offer the lowest prices can only do that by insisting on large trade volumes to maintain the desired profit-per-transaction value - as we calculated.

Personally, I usually set a competitive exchange price for both directions of the currency flip, then tweak (usually increase) the exchange volume until I reach the 1C profit per transaction benchmark. 
Then I wait and see how many trade offers I get in each direction. Remember that the balance of currency "import" and "export" must be maintained, so I try to increase the exchange volume of the direction that's going "too well" - the larger the minimum trade amount is - the less players take it. Sometimes the exchange rates must be updated - either because I couldn't achieve balance just by volume manipulation or because the market price is shifting. 

"But Michael", you might ask, "how are the exchange prices determined to begin with? Why does 1C cost 3 alc's and not 10? or 0.5?"

Exchange Rates

Let's imagine a grossly oversimplified situation: there are only 2 POE players in the world and only 2 types of currency (chaos and alcs for example). Also let's assume both players play on similar levels of content - and have the same drop rate of currency: 1C and 4 alc's per hour.
In principal, if the 2 players wanted to trade - a reasonably fair trade might be at an 1C:4alc exchange rate - since that represents the same amount of "labor" invested in collecting this currency. A more realistic capitalist/free market approach would be to understand that the price is actually determined by the relative abundance of resources - and not by the amount of effort invested in collecting them. In our case the second approach gives us the same result - since both players have the same "earning" rate so the abundance of currency items is also 1:4. Or is it?

During higher character level gameplay, alcs are often constantly used - which means they are consumed and no longer exist in the POE economy. If, for example, the 2 players consume a quarter of the alc's they find (and approximately none of the C), the relative abundance in this POE economy would be 1:3. Which brings us back to the real case. 
The visible prices are set by players - and every single player chooses the price mostly by conforming with the average market prices (like we discussed before - when I'm choosing my exchange rates I'm only looking at what other players are offering - not trying to calculate relative abundance etc.). But, in the long run, prices seem to be closely correlated to the availability of each single resource on the market - just as they do in real life free markets (basically, if a resource is rare then the number of people willing to sell it cheaply quickly runs out). For any 2 currencies this translates approximately to:

(Price of A) /   ~   (Drop rate A - Consumption rate A) /
(Price of B)            (Drop rate B - Consumption rate B)

What are the "true" drop rates from Path of Exile monsters? That's not something GGG talk about publicly... But the trading prices are a good place to start. 

This simple calculation can also tell us certain things about the changes in player behavior patterns. For example, if the price of a certain currency suddenly raises substantially (assuming no major changes were made to the drop rates), that means they are being consumed more frequently. What might be the reason? Perhaps a portion of the players figured out a use for it in a certain situation that was not known before? 
On the flip side, if the price seems to be surprisingly low - perhaps a portion of the players figured out a method to farm that currency more efficiently than before?

Money usually tells a story.

Currency Trading Tool

I've made a spreadsheet tool to help me do the currency trading calculations we've discussed. I hope you find it useful if you want to become a currency trader yourself. It looks like this (and contains all currency types that existed in Path of Exile patch 2.6 - feel free to add the new ones of course):

The only thing that you need to update for your own case are the numbers in the white cells - the rest is calculated. In case you're wondering, these prices are from a couple of weeks before the end of Legacy league.


There are many more fascinating economic effects that I haven't touched on at all - like the cyclical dynamics of the fresh league economies (from creation all the way to integration back into Standard), the difference in valuations of items between Standard gameplay and Hardcore mode (in which characters die permanently), the visible shifts in pricing following announcements by prominent streamers or Youtubers (the so called "Mathil effect" - named after a popular streamer - that was analyzed in this video for example), "price fixing" done by rich and knowledgeable players to manipulate the market - and many others.

Path of Exile's naturally emerging P2P economy is an amazing case study for a "virtual economist" like me. It's a living, breathing free market - where every player can participate - as a buyer, a seller, a flipper, an investor, and of course value producer (finding equipment and currency by playing the game). Unlike POE, in the real world there are high barriers of entry to any of these roles (initial capital and legal approval are often needed) - but in the virtual world anyone can be anything: a true free market.
This ability to both gather data for macro calculations and simultaneously "feel the market" by being an active participant and stakeholder allows for a first hand experience of economic theories - quite a valuable lesson for a game I play to relax at night :)

Until next time, may you know the value of your time.


{If you find my ideas or analysis interesting - consider subscribing (box on the right). You'll never miss a post and I'll know I'm not talking only to myself :) }

Friday, November 11, 2016

"The Boy Who Cried Wolf" and Bayesian Probability

One of the most famous and well known fables in the world is "The Boy Who Cried Wolf". It was written by Aesop (6th century BCE) as a cautionary tale against false alarms:

"The tale concerns a shepherd boy who repeatedly tricks nearby villagers into thinking wolves are attacking his flock. When one actually does appear and the boy again calls for help, the villagers believe that it is another false alarm and the sheep are eaten by the wolf. In later English-language poetic versions of the fable, the wolf also eats the boy" (from Wikipedia)

It's a simple message, really. If you lie and get caught - people stop believing you. 

Think of your own surroundings. Do you know any "false-alarm boys"?
Maybe it's the co-worker who keeps committing to deadlines but never completes the task in time. Maybe it's the boss who summons you to a 1-on-1 meeting but postpones it time and time again. Maybe it's that friend who has an existential life crisis - twice a week, every week...

What should we do? At which point should we stop trusting them and start assuming every alarm is a false alarm? Or maybe we should be flexible and give them a second (or third) chance?
Bayesian probability might hold the answers.

As humans we must make decisions all the time. When should I leave to get to work in time? Should I go to that meetup? What career should I choose? These decisions force us to (partially) predict the future - based on our beliefs about the world. In order to decide when should you leave for work, you must have some idea of how long is the drive to the office - some knowledge about the surrounding world (often from past experience) that allows you to make a prediction: "the drive usually takes me 30 minutes so I should leave at 8:30". 
Unfortunately, we are unable to predict the future exactly. A more accurate saying would be "on average, the drive takes 30 minutes, but it depends on traffic. Most often it's between 25 and 35 minutes". So there is some probability distribution of drive length - with a mean of 30 and most of it is concentrated between 25 and 35. If we leave at 8:30 we'll often be late due to this uncertainty. Perhaps then we should leave for work at 8:25 so we have a buffer against the common fluctuations?

Let's rephrase these considerations in Bayesian notation. Our goal is to get to work in time - to minimize the chance of being late. We could leave 3 hours ahead of time - thus practically ensuring that we're at the office at 9:00, but that's somewhat extreme and inefficient. Let's say being late once a month is an acceptable rate, so we need to make the probability of being late on each day about 5%, written as: P [ late ] = 5%.
The knowledge about the world that we've accumulated so far - in our example it's our past experience of driving to work many times before - is called the prior probability distribution - or just prior. Let's say that according to our experience the drive takes longer than 35 only 5% of the days, so leaving at 8:25 will satisfy our goal.

Now imagine there's a politician visiting town. Some of the roads are blocked for security purposes, there are many people attending her rally etc. The visit is creating traffic jams around the city - making the drive to the office about 45 to 55 minutes. If we use our normal strategy and leave at 8:25 we actually have a very large probability to be late - the distribution changed because the world changed. This is written as:
P [ late | politician, leave at 8:25] > 5%
Everything after the dividing line is information about the world - in addition to our prior beliefs - which change our predictions about the future. In our case - we should probably leave for work at 8:05 on politician days to preserve the regular probability for being late ( P [ late | politician, leave at 8:05] = P [ late | no politician, leave at 8:25] ).

But what if we don't know whether there's a politician in town or is it a normal day? A political visit is a rare event so on any given day it's reasonable to assume there isn't one. Imagine you leave the house at 8:25, as always, but the met with huge traffic jams - making the drive 50 minute long. You'd probably say "what happened? It never takes so long. Is there a politician in town or something?" - because under your baseline assumptions about the world ("no politician") a 50 minute drive to work is extremely unlikely. You thus deduce that your hypothesis about the state of the world might be wrong. 

Congratulations! You now know the basic ideas behind Bayesian probability: you try to figure out what's more and less likely to happen, according to your existing beliefs about the world - both these probabilities and your beliefs change as new information is discovered. 
Now let's apply these ideas, in a slightly more formal way, to Aesop's fable.

Imagine the villagers whose herd of sheep is guarded by "false-alarm boy". When they hear him "cry wolf", should they believe him? How likely is it that there actually is a wolf?
It depends on what they think about the boy - do they trust him? Is he a trustworthy person? And how should their opinion about him change as new information becomes available?

Humans often think of people as belonging to one of several categories. Let's assume for simplicity 3 archetypical types: "completely honest and trustworthy" (with a small percentage of "no-wolf" because he might make an innocent mistake), "not trustworthy" (his word basically has no meaning - there might be a wolf and might not be, they'll believe it when they see it) and "malicious" (he's probably bullshitting us again - but it might be the one time he's telling the truth).
The villagers are good and honest people so they naturally assume other people are probably honest as well. So before they know anything about the boy they assume there's a 90% probability he's "completely honest", 5% he's "not trustworthy" and 5% he's "malicious".

Probability that the wolf actually existsProbability that there is no wolf
"Completely Honest"99%1%
"Not Trustworthy"50%50%

Under these beliefs about the boy, what are the odds there's actually a wolf when the boy raises the alarm?

P [wolf] = P [wolf | boy is honest] * P [boy is honest] +  
                                        P [wolf | boy is untrustworthy] * P [boy is untrustworthy] +  
                              P [wolf | boy is malicious] * P [boy is malicious] = 92% 

So it is highly probable there actually is a wolf - and the villagers should run to check it out.
But there is no wolf. This is new information - an alarm was raised and turned out to be false. Now it seems less likely that the boy is "honest", since a false alarm is a very rare event if he's "honest". How much less likely? 
Bayesian math gives us the answer:  

P [boy is honest | there was no wolf] = 
P [there was no wolf | boy is honest] * P [boy is honest] /
 P [there was no wolf]

I won't go into the math behind it - you can find it here - but the idea is simple: the new probability that the boy is honest (now that we know there was no wolf) is the base probability that the boy is honest (what we used to believe) multiplied by the relation between how likely the new evidence is according to the hypothesis that the boy is honest vs. its general likelihood. So, if some belief about the world predicted an occurrence to be more likely than other beliefs - and that occurrence turned out to be what actually happened - we should now have more faith in that belief about the world.

Using the numbers from above we get:
P [boy is honest | there was no wolf] = 11.4%
Wow. The villagers' trust in the boy is shattered after only a single false alarm. It is now more likely he is malicious or at least untrustworthy:

P [boy is untrustworthy | there was no wolf] = 31.6%
P [boy is malicious | there was no wolf] = 57%

Under these new views about the boy, when he now raises the alarm a second time - how likely is it to be true?
P [wolf] = 33%
Already it's more likely that there is no wolf. But maybe the damage that an undefeated wolf can cause (X) is greater than the pain of dropping everything and running to the fields (Y) - let's say 5 times greater (X = 5Y). The rational thing would still be to go check it out, for the 1/3 chance that the wolf is actually there:

Damage [responding to alarm] < Damage [ignoring alarm]
Y < P [wolf] * X + P [no wolf] * 0
Y < 0.33*5Y

Let's say the villagers indeed follow this logic and believe the alarm for the second time - and it turns out to be false again. The new opinions about the boy are:

P [boy is honest | twice there was no wolf] = 0.17%
P [boy is untrustworthy | twice there was no wolf] = 23.6%
P [boy is malicious | twice there was no wolf] = 76.6%

After 2 false alarms the villagers should be pretty much convinced that the boy is maliciously lying to them. If he raises the alarm a third time, the probability that there really is a wolf would be: P [wolf | twice there was no wolf] = 19.6%.
Even the threat of a rampaging wolf is not enough to convince the villagers to respond, since Damage [responding to alarm] > Damage [ignoring alarm].

Note that true alarms would gradually restore the trust in the boy - but, unfortunately, trust is rebuilt much slower than it is destroyed. Let's say the 3rd alarm - which the villagers probably already ignored - was true. The new opinions about the boy's personality would be:

P [boy is honest | 2 false alarms, 1 true] = 0.86%
P [boy is untrustworthy | 2 false alarms, 1 true] = 60.2%
P [boy is malicious | 2 false alarms, 1 true] = 39%

The boy looks less malicious and more simply untrustworthy - but still highly unlikely to be honest.
Once broken, real trust is hard to rebuild. It's not enough to do the right thing more often than the wrong thing. Every mistake has a substantially higher price than what's gained through honest actions. 
This is something we've all felt ourselves, the "1/2 strikes you're out" approach, and the math seems to support it...

Or does it?

Imagine the boy was actually a different kind of person, from a 4th category that wasn't even in the villagers' minds - we'll call it "good intentioned yet fallible human" - or "human" in short.

Probability that the wolf actually existsProbability that there is no wolf

Unfortunately, the villagers don't have a mental model for such a person. How would their belief change with each "wolf" cry? Using the same calculations as above we can extrapolate the villagers attitude to the "human" boy:

New Evidence"Completely Honest""Not Trustworthy""Malicious"P [False Alarm]
Initial Belief90.00%5.00%5.00%7.90%

Note how the villagers (should) gradually be convinced of the boy's honesty with successive true alarms, but their faith in him drops by 20-25% every time he makes a mistake: 

Thankfully, with every instance of correct behaviour the villagers gradually "forgive" the boy and after 6-7 true alarms he regains their full trust.

This is what the math suggests you should think about the boy in our story - as a rational person. 
Well, do you? 
Can you forgive someone who did the wrong thing once or twice - but made up for it by doing the right thing 10 times? What about 100 times? 

Until next time, may you be cautious enough to be safe from "malicious" friends, but generous enough not to lose the "human" ones.


{If you find my ideas or analysis interesting - consider subscribing (box on the right). You'll never miss a post and I'll know I'm not talking only to myself :) }