-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi: user reputation #848
Conversation
// Reputation is the user's reputation breakdown. | ||
type Reputation struct { | ||
Score int `json:"score"` | ||
RawScore int32 `json:"rawScore"` | ||
Privilege float64 `json:"privilege"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still on board with the gist of these changes, especially in a tiered framework introduced in #1120.
One thing to note about #1120 is that I've merged the cancel rate outcome tracking into the score computation instead of having it as a separate banable item. I've also made a TODO in the Connect result with a violations slice, but it can also work like this with Reputation
, perhaps with details of the outcomes that impacted the user's score.
I feel like the way forward it to first merge the hd keys PR (#1015), then fidelity bonds with tiered accounts (#1120 ), then this to complete it (if we feel like this one is still the way forward and not just concept).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged the cancel rate outcome tracking into the score computation
Love it.
@chappjc, @martonp, @JoeGruffins. Could I ask you for a concept ack on the game plan here before proceeding to adapt? |
Things are different with bonds. Closing. |
Conceptual
This PR introduces reputation, which is virtually identical to the ban score we had before, but with different semantics.
The reputation is actually three numbers. Here's the msgjson type.
In addition, there is now a
baselineScore
, which functionally identical to thedefaultBanScore
and is used to give some buffer against penalty to new users. ThebaselineScore
is also used to separate the user's score into two distinct regions, probationary and privileged. A user with aRawScore > baselineScore
is considered a privileged user, and is eligible for increased limits on order placement. The extra order capacity increases linearly fromProbationaryLots
toPrivilegedLots
as the user's score increased frombaselineScore
tomaxScore
. A user with a0 < RawScore < baselineScore
is considered probationary, and has a low and constant taker lot limit ofProbationaryLots
until they get their score back up.RawScore <= 0
is account penalization.The users initial score is
baselineScore
, which is kind of like "waiving the probationary period", so there is a slight inconsistency in the terminology there, but I'm okay with it.The
RawScore
is pretty much the ban score orauth.userScore
from before. It can be used for independently tracking or auditing the reputation for an account client-side (not done in this PR). TheScore
is theRawScore
normalized on (0, 100), and is meant for display. ThePrivilege
is a float on (0.0, 1.0) that progresses linearly with the users score from thebaselineScore
tomaxScore
.Technical
This is mostly a straight refactor, but there are two notable changes.
ProbationaryLots
andPrivilegedLots
).Reputation
tracking and associated types are moved from auth to dex and the methods have been refactored to take only builtin or dex types, e.g. nodb.MarketMatchID
. The idea here is that the client should be able to independently track their own reputation.The market's taker lot limits are sent in the
config
response. The user's reputation is sent in theconnect
response, and then as a notification every time it is updated.