Changeset 9e6d8a2 for server


Ignore:
Timestamp:
09/17/26 00:36:39 (2 weeks ago)
Author:
Stefan <trsunovstefan@…>
Branches:
main
Children:
4438e45
Parents:
35bcb41
Message:

Remove volatility from Phase 6

Location:
server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • server/db/schema_creation.sql

    r35bcb41 r9e6d8a2  
    261261    avg_price            numeric,
    262262    market_return_pct    numeric,
    263     price_volatility     numeric,
    264263    participating_users  bigint
    265264)
    … …  
    281280            COUNT(*)         AS trade_count,
    282281            AVG(price)       AS avg_price,
    283             STDDEV(price)    AS price_volatility,
    284282            MAX(first_price) AS first_price,
    285283            MAX(last_price)  AS last_price
    … …  
    300298        ROUND(ms.avg_price, 6)                                                            AS avg_price,
    301299        ROUND((ms.last_price - ms.first_price) / NULLIF(ms.first_price, 0) * 100, 2)      AS market_return_pct,
    302         ROUND(COALESCE(ms.price_volatility, 0), 6)                                        AS price_volatility,
    303300        COALESCE(p.participating_users, 0)                                                AS participating_users
    304301    FROM market_stats ms
  • server/reports.go

    r35bcb41 r9e6d8a2  
    8181        defer rows.Close()
    8282
    83         header := fmt.Sprintf("  %-6s  %-5s  %12s  %8s  %14s  %12s  %14s  %8s",
    84                 "Symbol", "Quote", "Volume", "Trades", "Avg Price", "Return %", "Volatility", "Users")
     83        header := fmt.Sprintf("  %-6s  %-5s  %12s  %8s  %14s  %12s  %8s",
     84                "Symbol", "Quote", "Volume", "Trades", "Avg Price", "Return %", "Users")
    8585        fmt.Println()
    8686        fmt.Println(header)
    … …  
    9090        for rows.Next() {
    9191                var symbol, quote string
    92                 var volume, avgPrice, returnPct, volatility float64
     92                var volume, avgPrice, returnPct float64
    9393                var tradeCount, users int64
    94                 if err := rows.Scan(&symbol, &quote, &volume, &tradeCount, &avgPrice, &returnPct, &volatility, &users); err != nil {
     94                if err := rows.Scan(&symbol, &quote, &volume, &tradeCount, &avgPrice, &returnPct, &users); err != nil {
    9595                        fmt.Println("scan error:", err)
    9696                        return
    9797                }
    98                 fmt.Printf("  %-6s  %-5s  %12.4f  %8d  %14.6f  %+12.2f  %14.6f  %8d\n",
    99                         symbol, quote, volume, tradeCount, avgPrice, returnPct, volatility, users)
     98                fmt.Printf("  %-6s  %-5s  %12.4f  %8d  %14.6f  %+12.2f  %8d\n",
     99                        symbol, quote, volume, tradeCount, avgPrice, returnPct, users)
    100100                empty = false
    101101        }
Note: See TracChangeset for help on using the changeset viewer.