Calculations
CWS Perforance Calculations
Concept definitions
PNL
Stands for "Profit and Loss".
Represents the performance of a wallet in USD terms, based on its respective trades.
Classes
Traders are distributed in one of 4 classes based on their current wallet holdings.
The 4 classes are assigned based on percentile.
How to calculate the profit and loss of a wallet?
It is calculated as the difference between the trade's entry and current worth/exit. It can be negative.
Examples:
A trader buys $2,000 US worth of a token, and now it's worth $4,000 US.
XP = 4000 - 2000 = 2000XP
How to calculate the performance of a player?
It is calculated as the sum of the experience points of all the wallets. It can be negative.
Examples:
The user starts with $2k (wallet A1) and goes to $200k. Then he transfers in 100k (wallet A2) and goes to $450k:
Data: XP1 = 198000; XP2 = 150000
XPt = 198000 + 150000 = 348000XP
The user starts with $20k (wallet A1) and goes to $200k. Then he transfers in 100k (wallet A2) and goes to $30k. Then he transfers out $10k (wallet A3) and goes to $100k:
Data: XP1 = 180000; XP2 = -270000; XP3 = 80000
XPt = 180000 - 270000 + 80000 = -10000XP
How to calculate the Level of a user?
It is calculated as the sum of the experience points of the wallets. It can NOT be negative (min value is 0). We will be storing in the database the maximum level a user has unlocked, and we will only update it once he unlocks a higher level (levels can not be lost).
Examples:
User has a wallet A with 10000XP, a wallet B with -5000XP, and a wallet C with 50000XP:
Data: XPa = 10000; XPb = -5000; XPc = 50000
XPt = 10000 - 5000 + 50000 = 55000XP
User has a wallet A with 10000XP, a wallet B with -50000XP, and a wallet C with 1000XP:
Data: XPa = 10000; XPb = -50000; XPc = 1000
XPt = 10000 - 50000 + 1000 = 0XP
Last updated