OdyseeTeam / commentron

MIT License
11 stars 12 forks source link

Super Chat sorting Algorithm #53

Open tiger5226 opened 3 years ago

tiger5226 commented 3 years ago

The proposal is to create a usd value for each supported comment that is input to the weighting calculation.

The exchange rate around the time any tip is made, is converted to LBC and added to a new column in the database called weighted_support_amount. A new multi-column index using lbry_claim_id, weight_support_amount. This will be used to calculated the paginated sort of comment.SuperChatList.

The exchange rate should use the SDK exchange API. An integration has to be built for lbry.go to use it from Go.

The integration should grab BTC rate, and then we need to use another service to convert non-USD currency values that the SDK does not return. Or to get conversions from other currencies we might need to fx exchange service, which might be more plausible.

Lots of things to consider here, we will have to piece meal this, like forcing all currencies to represent USD regardless at first.

kauffj commented 3 years ago

Potential fast solution: sort by absolute number of tip, ignoring currency conversion