Data transaction of the Token Rating oracle

Once a day, the Token Rating oracle sends to the blockchain a data transaction with ratings and rates of tokens.

A data transaction contains the information about tokens, that have been rated in the past 24 hours.

A single transaction contains the information about no more than 50 tokens — if there are more rated tokens, then several transactions will be sent.

An example of a data array of such a transaction:

"data": [
  {
    "key": "assetRating_23g8VstaVP9bWcoYJtMUJ1HJk8FZkwcVaQ7d9trhfssY"
    "type": "string",
    "value": "4.3",
  },
  {
    "key": "scoreBoard_23g8VstaVP9bWcoYJtMUJ1HJk8FZkwcVaQ7d9trhfssY"
    "type": "string",
    "value": "{\"1\":{\"votes\":0,\"tokens\":0},\"2\":{\"votes\":1,\"tokens\":322},\"3\":{\"votes\":0,\"tokens\":0},\"4\":{\"votes\":0,\"tokens\":0},\"5\":{\"votes\":1,\"tokens\":1120}}",
  },
  {
    "key": "assetRating_E8gDQh5aDz6VQMwmFhUrpMERorwje6AqNe4FcjGSCNo6"
    "type": "string",
    "value": "5",
  },
  {
    "key": "scoreBoard_E8gDQh5aDz6VQMwmFhUrpMERorwje6AqNe4FcjGSCNo6"
    "type": "string",
    "value": "{\"1\":{\"votes\":0,\"tokens\":0},\"2\":{\"votes\":0,\"tokens\":0},\"3\":{\"votes\":0,\"tokens\":0},\"4\":{\"votes\":0,\"tokens\":0},\"5\":{\"votes\":1,\"tokens\":2827}}",
  }
  ...
]

The key field is formed by concatenating a string "assetRating_" or a "scoreBoard_" and a string with the ID of a token.

The value field contains an escaped string with rates.

An example

Let's say we have an escaped string with rates:

"{\"1\":{\"votes\":0,\"tokens\":0},\"2\":{\"votes\":0,\"tokens\":0},\"3\":{\"votes\":3,\"tokens\":545},\"4\":{\"votes\":0,\"tokens\":0},\"5\":{\"votes\":2,\"tokens\":3827}}"

Let's unescape that string:

{
  "1": {
    "votes": 0,
    "tokens": 0
  },
  "2": {
    "votes": 0,
    "tokens": 0
  },
  "3": {
    "votes": 3,
    "tokens": 545
  },
  "4": {
    "votes": 0,
    "tokens": 0
  },
  "5": {
    "votes": 2,
    "tokens": 3827
  }
}

It follows from the string that no one rated the token with one, two or four stars.

Three users rated the token with three stars. The sum of the weights Wn of those rates is 545.

Two users rated the token with five stars. The sum of the weights Wn of those rates is 3827.

results matching ""

    No results matching ""