math behind dope wars drug trading for profit

disclaimer: this is not a complex analysis on the statistics of trading and risk in a game like dope wars.  it's mostly an uncovering of how simple the trading actually is, and is my attempt to offer some suggestions on how to make it a little more challenging to generate profit quickly in a game like this.

after looking at the python source code for dope wars, i realized there are no complex algorithms for trading drugs.  but as i'm building drug wars, i'm looking for a way to limit the profit potential to a new player to keep it interesting (too much profit makes a game too easy to win).

it turns out that's easy to do even using simple math.  an actual example using the drugs from that version of dope wars:

table of drugs + price range (minimum..maximum)

Acid    1000..4400
Cocaine    15000..29000
Hashish    480..1280
Heroin    5500..13000
Ludes    11..60
MDA    1500..4400
Opium    540..1250
PCP    1000..2500
Peyote    220..700
Shrooms    630..1300
Speed    90..250
Weed    315..890

from each of these drugs, we can see the minimum and maximum amount each will sell for.  as an example, on a very good day i can buy lots of cocaine for $15,000, then i can turn around and sell it on another very good day for $29,000.  that's a profit of $14,000 per unit of drug sold.  nice!

we can calculate the differences between the max and minimum drug price:

Acid    3400
Cocaine    14000
Hashish    800
Heroin    7500
Ludes    49
MDA    2900
Opium    710
PCP    1500
Peyote    480
Shrooms    670
Speed    160
Weed    575

i think there are a few ways of looking at the profit margins.  under a single trade it might be ((max-min)/(highest_max_of_all_drugs))*100.  in dope wars, it's sometimes possible to assume you can purchase the max of any drug--so would you always want to purchase cocaine?  the amount of return by the following (assuming no limit to buying a given drug):

((total money / min price) * max price) / total_money

to give a simple example, if you have $10,000 and you buy ludes, you can generate 5.4x return under the best scenario.  this allows you to generate (max-min) a number of (total_money/min) times.

Acid    4.4x
Cocaine    1.9x
Hashish    2.5x
Heroin    2.3x
Ludes    5.4x <- the cheapest drug, also the most profitable
MDA    2.9x
Opium    2.3x
PCP    2.5x
Peyote    3.1x
Shrooms    2.0x
Speed    2.8x
Weed    2.8x

if you want to make a game like this difficult to beat, i think you'll want to:

  1. keep the difference between the max and min price low.  this reduces the chance that a drug can be bought really low and sold really high.
  2. keep the minimum buying price high.  this reduces the number of times the things from #1 can happen.

my instinct was that cocaine would be the best drug to purchase since it had the largest difference (one trade would at best earn you $14,000).  but if there aren't any limits, you'd be better off doing a lot of smaller trades of ludes.

i haven't accounted for what you do in various situations when you have a limit on the drugs sold.  this is in many versions of the game, so i'd need to understand the likelihood of how many drugs are available in an area first.  i might write another post on that shortly, since that is really what we'd want to understand.  you'd also want to consider how much money you have at any given time.

i think a strong algorithm would do a few things:

  1. cause all locations to have an initially low demand
  2. associate an addiction multiplier to each drug, so as the drug is purchased, the demand increases and so does the price
  3. increase the presence of a police force as a drug with a high addiction multiplier increases in a location, making the risk higher to trade
  4. create a cap on how many drugs can be traded in a location (e.g. sold between players or limited by the system)
14 responses
I don't get it, why would you divide by the maximum of any drug, and not its own? For that matter, you should be dividing by minimum price anyway, since you really want to be calculating (sell-buy)/(buy)*100% = max theoretical rate of profit.

In that case, you can make nearly 6 times your money selling Ludes (what?), way more than that of cocaine.

Perhaps you have spent a bit too much time with this "shopping list" in the past?

thanks michal, my math was a little off there
The title of this blog post is somewhat misleading... ;)
I'm really looking forward to your version of the game. I'm sure we could generalize this information for other types of transactions -- something less controversial than drugs, for example. Vegetables and raw materials for a PG-rated version maybe?
you're missing an important factor... capacity. if the amount of a given drug is capped it greatly changes profit potential. especially if each drug has the same capacity, or total capacity is fixed and must be divided up amongst drugs as desired.

if u can only hold 10 would u rather have 10 cocaine or 10 ludes if you want to maximize profit?

anon, my first drug calculation was taking this into account. i have changed it because most formats of this game allow you to purchase the maximum amount of drugs.

in the real world, you may only have a limited amount of weed. you might not be able to buy $100,000 worth of weed. but in dope wars, you can ;)

This is kinda silly. First, you listed some prices, found the difference, and the called this post the "math behind dope wars". That's somewhat misleading. No big deal really, just disappointing.

But then you end the post by saying the way to balance this game is by shrinking a drug's min-max differential? Yikes. Please go read some basic economic books, and then a few basic game design books. Your "product" will be better for it.

stephen: the original assumption was that there was a limit to the drugs, which i can admit was not a good assumption. so i changed it to assume you can buy as many drugs as you want (usually true in the game setting) and you're looking for the greatest return across all the drugs.

the conclusion is definitely weak. i'll update it, i mostly threw this together quickly without much diligence and should have taken more time on it up front. i was hoping to get some outside feedback, which was pretty helpful and made me think about everything a little bit more.

Your math is really not a good way to asses risk. This work looks like something born out of an MBA degree.

If you are going to comment on the statistics of markets, please do your homework. This just wastes everyone's time.

2plus2not5: updated the conclusion, i think this is a slightly better explanation (although admit the first one was weak). if you have any suggestions feel free to offer here. i was mostly surprised at how simple the trading was from dope wars, which motivated the post in the first place.
Technology is changing the way we live, our life style has evolved with changing technology, it is true for our eating habbits, soical life, leisure and shopping style. The trend of new year is online shopping
Thank you so much for this post! I'm making a similar game for the Facebook platform (Snack Wars), and this is just the kind of information I needed to help design and set it up.
Informative post... I glad to find it... You have done such an awesome job! Thanks for updating my knowledge...

buy generic viagra soft tabs

1 visitor upvoted this post.