Skip to content
Santiago Algozino edited this page Jun 15, 2020 · 3 revisions

Welcome to the KlerosJurorDashboard wiki!

Chance Calculation

The chance to be drawn as a juror in a case is calculated as: pnkStaked / totalPNKInCourt * 3

  • pnkStaked: is the value staked in each court by a wallet
  • totalPNKInCourt: check the next explanation
  • The number 3 is due to the minimum value of jurors for a case. In same courts the minimum is bigger but could not found the way to get this number.

Total Staked in Court

take a look into the totalStakedByCourt method of the StakesKleros function, in the Kleros.py file.

The total staked in a Court is the sum of the PNK staked in the actual court and all the childs courts. e.g. In the Blockchain - Non Technical is the sum of the PNK staked in Blockchain-Non Technical and Blockchain-Non Technical-Token Listing. In the Onboarding court, is just the PNK staked in that court.

To get the total staked by the different wallets in each court some procedure has to be followed. I will try to explain it.

  1. The stakeEvent logs has 3 columns: address, staked, totalStaked. the column that matters for this operation is the totalStaked because told to us the total amount that is still staked in that court (some people maybe is unstaking). If the new wallet 0xA perform this stake operations in the court 1: a) stakes 1000 PNK b) stakes 2000 PNK more c) unstake all

the logs will be (court, stake, newTotalStake): a) 1; 1000; 1000 b) 1; 2000; 3000 c) 1; 0; 0

What we matters is the last value of othe totalStake, so for this wallet is 0 in this court.

Considering this the operations what the backend does is:

  1. load all the events
  2. group all the events by court and wallet (droping all the items except the last of each wallet-court pair)
  3. take the sum of all the newTotalStake values of the different wallets for each court.
  4. for each child in a court: add the totalStake of the child
Clone this wiki locally