6/12/2023 - devlog
In this week's devlog Michi talks about implementation details of the new rating system.
Michi (molp)
In our last devlog Fabian talked about the upcoming changes and their motivation to the rating system. These changes will be part of the Liquidity release.
This week I started on actually implementing these changes. There is not much to see yet, but I can still talk about the process a bit.
The first task for this feature is finding and removing all occurrences of the sub-scores (activity, reliability, stability). In most cases that's pretty easy, but even removing code has its pitfalls. Since we are not removing the entire rating system, I had to be careful not to remove too much. Luckily we have a whole suite of unit tests and with them comes the confidence that everything is still working as intended after the removal is done.
I also had to take special care of the inter-actor communication. The necessary activity data for each player is mostly created in its user actor, while the rest of the data (reliability and stability) is taken from the respective company actor. Inter-actor communication is always a tad more complicated than just using the data of a single actor.
After the removal was done I moved on to the next task: In order to calculate the reliability based on the value of contract conditions, we have to assign a value to each condition. If these conditions involve a commodity we have to set a monetary value for that commodity. This sounds really easy at first, "just look up its price on the commodity exchange", but there are several problems with that approach: What commodity exchange should we use for the lookup. What if there are no recent or none trades at all? What if someone manipulates the prices at that CX? When should we look up the prices, when the contract is closed or when it reaches a terminal state?
To answer some of these questions I started to implement a new service that keeps track of the prices of a given commodity on all commodity exchanges. In the beginning it will use the internal complexity value of a commodity to have a value to start with. The complexity value for a commodity is being calculated during universe creation and is the sum of all materials and pioneer working ours going into making it. While it is only a rough estimate it still works pretty well as an initial value.
The next step is now to actually use that new service and valuate all contract condition. More on that in the next devlog.
As always: we'd love to hear what you think: join us on Discord or the forums!
Happy trading!