feat: insight prediction tweaks

This commit is contained in:
NunoSempere 2022-10-28 13:31:08 +01:00
parent d739def318
commit 1fa2aa1bdd
2 changed files with 16 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import axios from "axios";
import {FetchedQuestion, Platform} from "."; import {FetchedQuestion, Platform} from ".";
import {QuestionOption} from "../../common/types"; import {QuestionOption} from "../../common/types";
import toMarkdown from "../utils/toMarkdown"; import toMarkdown from "../utils/toMarkdown";
import { average } from "../../utils";
/* Definitions */ /* Definitions */
const platformName = "insight"; const platformName = "insight";
@ -318,6 +319,19 @@ export const insight: Platform = {
// return results; // return results;
}, },
calculateStars(data) { calculateStars(data) {
return 2; let nuno = () => {
if((data.qualityindicators.volume || 0) > 10000){
return 4
} else if((data.qualityindicators.volume || 0) > 1000){
return 3
} else{
return 2
}
}
let eli = () => null;
let misha = () => null;
let starsDecimal = average([nuno()]); //, eli(data), misha(data)])
let starsInteger = Math.round(starsDecimal);
return starsInteger;
} }
}; };

View File

@ -74,7 +74,7 @@ const getCurrencySymbolIfNeeded = ({
"openInterest", "openInterest",
"liquidity", "liquidity",
]; ];
let dollarPlatforms = ["predictit", "kalshi", "polymarket"]; let dollarPlatforms = ["predictit", "kalshi", "polymarket", "insight"];
if (indicatorsWhichNeedCurrencySymbol.includes(indicator)) { if (indicatorsWhichNeedCurrencySymbol.includes(indicator)) {
if (dollarPlatforms.includes(platform)) { if (dollarPlatforms.includes(platform)) {
return "$"; return "$";