Graphs and Pyramids

Question: Do you want to get Rich?
I’ll answer for you: “Yes!”

Follow along with this blog series and if it doesn’t make you rich, you can go back to your youtube videos, you can go back to watching Tiger King on Netflix, you can go back to your crappy life. Let’s continue.

Question: Are you poor? dumb? ugly? do you make bad decisions?
I’ll answer for you: “Yes!”.

If you were not poor, you would be on a yacht in Ibiza and not reading my blog. If you were not dumb you would be doing whatever it is smart people do, I wouldn’t know but I’m pretty sure it’s not reading my blog. If you were not ugly you would be in Paris or Milan murdering the runway instead of reading my blog. If you didn’t make bad decisions you wouldn’t have decided to read my blog which just made you feel sad about your life. See where I’m going with this?

But enough with the negativity. We are here to change your life. To allow you to accept who you are, accept what you’ve done, deconstruct it and rebuilt it, but better. Now talking about building things, who built the Pyramids?

Aliens. Well… aliens that enslaved people and made them do it. Slaves are bad, what’s better than slaves? Paying people to work for you. That is better than slaves… but what’s even better than that? People paying you to work for you. That’s right. We’re going to build Pyramids, and we’re going to sell Pyramids. I’m going to make money from you and you’re going to make money from other people, and they in turn will make money from other people… well maybe, maybe not.

But wait Pyramids are illegal aren’t they? Very, but not these ones. When you think of Pyramids, what do you think of? Egypt right? Yeah, those kinds of pyramids are illegal. But you know who else built pyramids? Peruvians. What? Yeah time for a history lesson. I was born in Chicayo, Peru in the Department of Lambayeque. It’s called “Lambayeque” because of the people who lived here from about 800-1350 AD. They built a religious and ceremonial site referred to as Túcume that spanned over 500 acres and composed of 26 major pyramids. Two big differences, these pyramids were not tombs like the Egyptian ones, and they were level at the top. Here is an artist depiction of what Túcume may have looked like during those times:

May or may not be a true to life representation. I wasn’t there, neither were you, neither was the person who drew this. These level pyramids is where Multi-Level-Marketing programs got their name (not really) and these are legal (mostly). Holy smokes Batman that was a super long intro, can you get to the part about Graphs already?

At Neo4j we have customers that are in the MLM business and they use us to calculate commissions, build real time sales dashboards and do the things they do. Like many of our customers, Neo4j is part of their “secret sauce” and NDAs prevent us from saying much. So to avoid any issues I’m going to build a Neo4j Graph Service to power the kind of MLM setup I don’t believe any of our customers actually have…and while we are at it, we’ll build what Twitter should have built to sustain themselves with commerce instead of advertisements…and pay the creators of the content…and eliminate hate messages… ok now I’m dreaming.

We’re going to build Twitter for Commerce, from here on referred to as “”. Our social network follows the one sided “follows” relationship like Twitter, not the two sided “friends” and “knows” style relationships of Facebook and LinkedIn.

Our users will be able to create Posts with what they have to say:

If you have followed my blog for a while you know that model doesn’t scale and a better one is to use “dated relationship types”:

Ok before you scream that you’ve seen this before or start to fall asleep on me, we’re going to change things up. When a User creates a Post, they are charged 1 Coin. If they have any Silver coins in their possession, they are charged a Silver coin. If they do not have any Silver coins, they are charged a Gold coin. If they do not have any coins, they must get some. Every user starts with 299 Silver coins and zero Gold coins. 299? Why not 300? Because “psychology” that’s why.

If someone LIKES your post, you get one of their coins. If someone RETWEETS your post, you get one of their coins. If someone REPLIES to your post, you get one of their coins. Do you get one of their Silver coins or Gold coins? It depends, if they have Silver coins, you get a silver coin, if they do not have any Silver coins, you get one of their Gold coins. Wait, are we going to calculate this and update their coin balance every single time anyone does anything on the site? Yes we are. Are you sure that will scale? No, but no worries I have a backup plan. If that’s too much to handle we can use the “dated relationship types” to help us calculate balances for the previous day every night and just live with people “over-drafting” their accounts a little bit.

Wait, so how does a User get Gold coins? They buy them. Really? Yeah. If they’ve spent time on the site posting and liking things and getting replies and so on, they are getting value from the site, so they should pay to keep using it or earn enough coin by contributing well liked or highly replied to Posts. This system will reward people with interesting things to say.

Wait, how do we get rid of the haters again? When a User reports a Hater, a team of “hate analyzers” review the alleged hate. If the hate really is hate, the hater is charged 9 coins on the first offense and given a warning, 99 coins on the second offense and given another warning, 999 coins the third offense… etc. The coins are given to the User “hated” on. If the hate is not really hate, the User who reported it is charged 1 coin on the first non-hate charge, 11 coins on their second non-hate charge, 111 coins on their third non-hate charge… etc. The coins are given to the User falsely accused of hate. Doesn’t that mean Rich people will still be able to spew hate? Well… after you add a few “9”s you have to be really really rich to keep going and the person who got the hate probably won’t be complaining. What happens if they go into a negative balance? They can’t post until they get their coin balance to 1. Wait, what if they have 3 Silver coins but -9 Gold coins. They can’t post. What if they have 10 Silver coins and -9 Gold coins? Then they can post once. Is that going to work? I don’t know. I’m not an economist, leave a comment if this plan is flawed.

Ok, I get it, but what do we do with coins? Just collect them like all those other worthless internet points? Spend them on likes and reposts? Is that it?

No. The site will allow Users to make Posts promoting Products, and let Users purchase these products right then and there. Products can only be purchased with Gold coins, not Silver. This is to prevent new accounts being opened and “funneling” their initial silver coins to another account to then purchase things for “free”. takes a 10% service fee on all Product sold on the site. For example, User “max” is selling a Product for 1000 Gold Coins. User “alex” follows “max” and sees the Post promoting the Product and decides to but it. User “alex” pays 1000 Gold coins of which 900 go to “max” for their Product and 100 go to for providing the ability to perform this exchange. Sound pretty straight forward right?

So where do the pyramids come in? I’m glad you asked. If a User has purchased a Product, they can also promote that product. They can do this by retweeting a Post that sells a Product they have purchased or by creating a new Post promoting that product themselves. Their followers can then purchase the product from those retweets or original Posts… and that continues. Let’s take an example:

User “alex” has purchased a product from “max” and liked it enough to decide to promote it to their followers. They create a Repost of the original Post where they purchased from “max”. In previous models this would have simply created a “REPOSTED_ON” relationship from User “alex” to the Post. However that won’t work for this use case. We want to keep track of which Post or Repost Users decided to make their purchase on, and in order to do that it is better that all Reposts are Nodes instead of relationships. Let’s say User “mike” decides to purchase from the Repost “alex” made. We would credit the seller with 70% of the product sale price, 10% goes to, and 20% of each sell gets distributed amongst the “pyramid” that gets built.

A Product sells for 1000 Gold coins. The following receive gold in the following manner for each sale:
– Seller: 700 gold. The seller always gets a minimum of 70% of the gold.
– Site: 100 gold. For providing the service, the site gets 10% of the gold.
– Followers Purchase: 200 more to Seller. Any sales made from a sellers direct followers nets 90% of the sale price to the seller.
– 1st Level Retweet: 200 to retweeter.
– 2nd Level Retweet: 140 to 2nd retweeter, 60 to 1st retweeter.
– 3rd Level Retweet: 140 to 3rd retweeter, 42 to 2nd retweeter, 18 to 1st retweeter.
– 4th Level Retweet: 140 to 4rd retweeter, 29 to 3rd retweeter, 22 to 2nd retweeter, 9 to 1st retweeter.

We will stop after 4 levels to encourage people to really try out the product and make their own post promoting it instead of just being super lazy and retweeting others.

Our model gets a little complicated take a look at this starting point and imagine User “jim” (which is not pictured) follows “david” and decides to purchase from his repost. Then the following scenario play out:

Every single Post that promotes a Product has its own hierarchy. This is pretty insane I think. I’m not sure if that’s ever been done before, but that is what we’re all about. Continue on to Part 2.

Tagged , , , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: