Spaces:
Sleeping
Sleeping
saadrizvi09 commited on
Commit ·
dfe51db
1
Parent(s): a7f07e8
restrict to yes/no binary events only
Browse files
backend/src/markets/markets.service.ts
CHANGED
|
@@ -355,14 +355,19 @@ export class MarketsService {
|
|
| 355 |
const closesAt = new Date(Date.now() + daysOut * 86400000);
|
| 356 |
const closesAtStr = `${closesAt.getMonth() + 1}/${closesAt.getDate()}/${closesAt.getFullYear()}`;
|
| 357 |
|
| 358 |
-
// Build a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
const dynamicMarket: MarketDetail = {
|
| 360 |
slug,
|
| 361 |
-
title:
|
| 362 |
tag,
|
| 363 |
closesAt: closesAtStr,
|
| 364 |
-
description: `
|
| 365 |
-
question:
|
| 366 |
resolutionCriteriaUrl: `https://wagerkit.xyz/resolution/${slug}`,
|
| 367 |
sources: [
|
| 368 |
{ name: 'PredictIt', type: 'regulated' },
|
|
@@ -412,9 +417,12 @@ export class MarketsService {
|
|
| 412 |
const hashVal = Math.abs(this.hashCode(dynamicSlug));
|
| 413 |
const daysOut = 30 + (hashVal % 150);
|
| 414 |
const closesAt = new Date(Date.now() + daysOut * 86400000);
|
|
|
|
|
|
|
|
|
|
| 415 |
matches.unshift({
|
| 416 |
slug: dynamicSlug,
|
| 417 |
-
title:
|
| 418 |
tag: this.detectTag(query),
|
| 419 |
closesAt: `${closesAt.getMonth() + 1}/${closesAt.getDate()}/${closesAt.getFullYear()}`,
|
| 420 |
});
|
|
|
|
| 355 |
const closesAt = new Date(Date.now() + daysOut * 86400000);
|
| 356 |
const closesAtStr = `${closesAt.getMonth() + 1}/${closesAt.getDate()}/${closesAt.getFullYear()}`;
|
| 357 |
|
| 358 |
+
// Build a Yes/No binary market
|
| 359 |
+
const yesNoTitle = query.toLowerCase().startsWith('will')
|
| 360 |
+
? this.titleCase(query)
|
| 361 |
+
: `Will ${this.titleCase(query).replace(/\?$/, '')} Happen?`;
|
| 362 |
+
const yesNoQuestion = yesNoTitle.endsWith('?') ? yesNoTitle : `${yesNoTitle}?`;
|
| 363 |
+
|
| 364 |
const dynamicMarket: MarketDetail = {
|
| 365 |
slug,
|
| 366 |
+
title: yesNoTitle.replace(/\?$/, ''),
|
| 367 |
tag,
|
| 368 |
closesAt: closesAtStr,
|
| 369 |
+
description: `Binary Yes/No market: ${yesNoQuestion} This market is dynamically generated and analyzed across multiple prediction market sources.`,
|
| 370 |
+
question: yesNoQuestion,
|
| 371 |
resolutionCriteriaUrl: `https://wagerkit.xyz/resolution/${slug}`,
|
| 372 |
sources: [
|
| 373 |
{ name: 'PredictIt', type: 'regulated' },
|
|
|
|
| 417 |
const hashVal = Math.abs(this.hashCode(dynamicSlug));
|
| 418 |
const daysOut = 30 + (hashVal % 150);
|
| 419 |
const closesAt = new Date(Date.now() + daysOut * 86400000);
|
| 420 |
+
const yesNoTitle = query.toLowerCase().startsWith('will')
|
| 421 |
+
? this.titleCase(query)
|
| 422 |
+
: `Will ${this.titleCase(query).replace(/\?$/, '')} Happen`;
|
| 423 |
matches.unshift({
|
| 424 |
slug: dynamicSlug,
|
| 425 |
+
title: yesNoTitle.replace(/\?$/, ''),
|
| 426 |
tag: this.detectTag(query),
|
| 427 |
closesAt: `${closesAt.getMonth() + 1}/${closesAt.getDate()}/${closesAt.getFullYear()}`,
|
| 428 |
});
|
frontend/src/app/dashboard/page.tsx
CHANGED
|
@@ -27,13 +27,13 @@ const TAG_COLORS: Record<string, string> = {
|
|
| 27 |
|
| 28 |
const SUGGESTIONS = [
|
| 29 |
'Will Bitcoin reach $150k by 2026?',
|
| 30 |
-
'
|
| 31 |
-
'Will
|
| 32 |
-
'
|
| 33 |
-
'
|
| 34 |
-
'
|
| 35 |
-
'Will
|
| 36 |
-
'
|
| 37 |
];
|
| 38 |
|
| 39 |
export default function DashboardPage() {
|
|
|
|
| 27 |
|
| 28 |
const SUGGESTIONS = [
|
| 29 |
'Will Bitcoin reach $150k by 2026?',
|
| 30 |
+
'Will AI replace software engineers by 2030?',
|
| 31 |
+
'Will the Fed cut rates in March 2026?',
|
| 32 |
+
'Will Tesla stock go above $500?',
|
| 33 |
+
'Will the Ukraine war end in 2026?',
|
| 34 |
+
'Will SpaceX land humans on Mars by 2030?',
|
| 35 |
+
'Will inflation drop below 2% in 2026?',
|
| 36 |
+
'Will TikTok be banned in the US?',
|
| 37 |
];
|
| 38 |
|
| 39 |
export default function DashboardPage() {
|