| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- generator client {
- provider = "prisma-client-js"
- binaryTargets = ["native", "linux-musl-arm64-openssl-3.0.x", "linux-musl-openssl-3.0.x"]
- }
- datasource db {
- provider = "postgresql"
- url = env("DATABASE_URL")
- }
- model WeatherForecast {
- id String @id @default(cuid())
- city String
- targetDate DateTime
- model String // 'gfs', 'ecmwf', 'icon'
- modelRunTime DateTime
- predictedHigh Float
- stdDev Float
- rawData Json
- createdAt DateTime @default(now())
- @@index([city, targetDate, model])
- }
- model MarketSnapshot {
- id String @id @default(cuid())
- polymarketId Int
- marketGroupId Int
- city String
- targetDate DateTime
- bucketLabel String
- yesPrice Float
- noPrice Float
- volume24h Float
- liquidity Float
- yesTokenId String
- noTokenId String
- createdAt DateTime @default(now())
- @@index([city, targetDate, createdAt])
- }
- model Signal {
- id String @id @default(cuid())
- type String // 'TAIL_NO', 'LATENCY_ARB', 'PARITY_ARB'
- city String
- targetDate DateTime
- bucketLabel String
- marketYesPrice Float
- modelProbability Float
- edge Float
- expectedReturn Float
- agreementScore Float
- confidence String
- recommendedSize Float
- executed Boolean @default(false)
- executedAt DateTime?
- tradeId String?
- trade Trade? @relation(fields: [tradeId], references: [id])
- createdAt DateTime @default(now())
- @@unique([type, city, targetDate, bucketLabel], name: "type_city_date_bucket")
- @@index([type, city, targetDate])
- }
- model Trade {
- id String @id @default(cuid())
- signalId String?
- signals Signal[]
- side String // 'BUY_YES', 'BUY_NO'
- tokenId String
- price Float
- size Float
- costBasis Float // price * size
- orderId String? // Polymarket order ID
- status String // 'PENDING', 'FILLED', 'CANCELLED'
- dryRun Boolean @default(true)
- filledPrice Float?
- pnl Float?
- resolvedAt DateTime?
- createdAt DateTime @default(now())
- @@index([status, createdAt])
- }
- model ObservedTemperature {
- id String @id @default(cuid())
- city String
- date DateTime // target date (date-only, midnight UTC)
- temp Float // observed temperature in city's unit
- unit String // 'C' or 'F'
- recordTime DateTime // when this reading was taken
- source String // 'hko', 'open-meteo', 'wttr'
- createdAt DateTime @default(now())
- @@index([city, date])
- }
- model DailyMetrics {
- id String @id @default(cuid())
- date DateTime @unique
- totalTrades Int
- winningTrades Int
- losingTrades Int
- grossPnl Float
- netPnl Float
- winRate Float
- avgEdge Float
- maxDrawdown Float
- createdAt DateTime @default(now())
- }
|