This document summarizes the comprehensive research conducted across cloned repositories and GitHub to identify reusable patterns and features for the CSFloat Investment Tracker API.
Type: Supabase (PostgreSQL) + React + Edge Functions Key Finding: Comprehensive portfolio management with time-series tracking
Valuable Features Found:
- ✅ Portfolio snapshots with time-series data (hourly/daily/monthly granularity)
- ✅ Price override system (manual price entry for items without market data)
- ✅ Marketplace preference system (per-user and per-item)
- ✅ Partial sales tracking (sell portions of multi-item investments)
- ✅ Batch price updates from CSGOTrader API
- ✅ Chart data endpoints for historical visualization
- ✅ Realized vs unrealized profit/loss calculations
- ✅ Sale reversal functionality
- ✅ RPC functions for complex operations
- ✅ Atomic updates with run_id tracking
- ✅ Cleanup mechanisms for stale data
Data Sources Used:
- Steam Community Market
- CSFloat Market
- Skinport
- Buff163
- Via CSGOTrader API:
https://prices.csgotrader.app/latest/{marketplace}.json
Edge Functions:
update-market-prices- Batch price fetching with marketplace-specific configscreate-portfolio-snapshots- Automated snapshot creation
Type: Static JSON API Key Finding: Comprehensive CS2 item database with metadata
Valuable Features Found:
- ✅ Float ranges (min_float/max_float) for all skins
- ✅ Doppler phase identification (Ruby, Sapphire, Black Pearl, Phase 1-4)
- ✅ Gamma Doppler phases (Emerald, Phase 1-4)
- ✅ Rarity classifications with hex color codes
- ✅ Item categorization (weapons, cases, stickers, agents, etc.)
- ✅ Market hash name generation patterns
- ✅ StatTrak/Souvenir availability flags
- ✅ Collection and case relationships
- ✅ Paint index to phase mappings
- ✅ Image URL patterns with CDN fallbacks
- ✅ Multi-language support (25+ languages)
- ✅ Special notes database (historical info like M4A4 Howl)
Data Files Available:
skins.json(5.2MB) - Grouped skinsskins_not_grouped.json(26.6MB) - All variationsall.json(47MB) - Complete databasecrates.json(6.6MB) - Cases and contentscollections.json(1.3MB) - Collectionsstickers.json(15.2MB) - All stickers
Doppler Phase Mappings:
415: "Ruby"
416: "Sapphire"
417: "Black Pearl"
418-421: "Phase 1-4" (Doppler)
568: "Emerald"
569-572: "Phase 1-4" (Gamma Doppler)
1119-1123: Glock-18 Gamma Doppler phasesType: React + TypeScript (Frontend Only, localStorage) Key Finding: Clean TypeScript patterns and Steam fee calculation
Valuable Features Found:
- ✅ Steam fee calculation (scales 10-13.05% based on price)
- ✅ Multi-level caching (5 min items, 24h nameID)
- ✅ Price history tracking with timestamps
- ✅ Investment analytics (best/worst performers)
- ✅ Auto-refresh with configurable intervals
- ✅ Profit alerts system
- ✅ Export/Import functionality
- ✅ Search with debouncing
- ✅ Clean TypeScript interfaces
Steam Fee Formula:
// Fee scales from 10% to 13.05% based on price ($0.20 - $1800)
const minPrice = 0.2;
const maxPrice = 1800;
const minFee = 0.10;
const maxFee = 0.1305;
const feePercent = minFee + ((clampedPrice - minPrice) / (maxPrice - minPrice)) * (maxFee - minFee);
const sellerReceives = buyerPrice * (1 - feePercent);CS2InventoryValueTracker (Atmartushev/CS2InventoryValueTracker)
- Uses SteamWebApi for inventory tracking
- PowerBI visualizations
- 30-day and 90-day price change tracking
- Buy/sell volume analysis
CS2-tracker (AnnieCS2/CS2-tracker)
- Discord webhook integration
- CSV export/import
- Automated daily monitoring
- Interactive charts
SkinsRadar (Max2772/SkinsRadar)
- Proxy support for bypassing Steam rate limits
- Advanced monitoring features
awesome-cs2-trading (redlfox/awesome-cs2-trading)
- Curated list of CS2 trading resources
- Multiple marketplace integrations
Value: Enhance item metadata with accurate float ranges and doppler detection
Endpoints to Create:
GET /api/items/float-range/:itemName- Get min/max float for an itemGET /api/items/doppler-phase/:paintIndex- Get doppler phase infoGET /api/items/metadata/:itemName- Get complete item metadataPOST /api/items/sync-database- Sync from CSGO-API repository
Implementation Tasks:
- Download and cache CSGO-API data locally
- Create
game_items_metadatatable with float ranges, doppler phases, rarity data - Build endpoints to query this data
- Integrate with existing float inspection endpoints
Value: Enable portfolio performance visualization over time
Endpoints to Create:
POST /api/portfolio/snapshot/create/:userId- Create portfolio snapshotGET /api/portfolio/snapshot/history/:userId?granularity=hourly|daily|monthly&period=7d|30d|90d|1y- Get historical snapshotsGET /api/portfolio/chart/:userId?granularity=daily&days=30- Get chart-ready dataPOST /api/portfolio/snapshot/auto-create- Scheduled job endpoint
Database Changes:
- Already have
portfolio_snapshotstable - Add
granularityfield (hourly/daily/monthly) - Add indexes for performance
Value: Track partial position exits and calculate realized profits
Endpoints to Create:
POST /api/portfolio/sale/partial- Sell portion of investmentGET /api/portfolio/pnl/:userId?type=realized|unrealized|total- Get P&L breakdownPOST /api/portfolio/sale/revert/:saleId- Undo sale transaction
Database Changes:
- Update
portfolio_investmentstable: Addoriginal_quantityfield - Update
portfolio_salestable: Link to original investment - Add
quantity_remainingcalculated field
Value: Handle items without market data and user preferences
Endpoints to Create:
PATCH /api/portfolio/investment/:investmentId/price-override- Set manual pricePATCH /api/portfolio/investment/:investmentId/marketplace-override- Set preferred marketplaceGET /api/user/settings/:userId- Get user settingsPATCH /api/user/settings/:userId- Update marketplace priority
Database Changes:
- Add
price_overridefield toportfolio_investments - Add
marketplace_overridefield toportfolio_investments - Create
user_settingstable with marketplace priority
Value: Efficient bulk price updates from external APIs
Endpoints to Create:
POST /api/prices/batch-update- Update prices from CSGOTrader APIPOST /api/prices/cleanup- Remove stale price dataGET /api/prices/sources- List available price sources
Implementation:
- Integrate CSGOTrader API endpoints
- Add
run_idtracking for atomic updates - Marketplace-specific batch sizes and timeouts
- Cleanup mechanism for old prices
Value: Accurate pricing considering Steam market fees
Endpoints to Create:
POST /api/pricing/calculate-fee- Calculate Steam fee for given pricePOST /api/pricing/seller-receives- Calculate what seller receives
Implementation:
- Add utility function for fee calculation
- Integrate into all pricing endpoints
- Support both buyer and seller perspectives
Value: Real-time notifications for price alerts and portfolio events
Endpoints to Create:
POST /api/webhooks/discord/configure/:userId- Set Discord webhook URLPOST /api/webhooks/discord/test/:userId- Test webhookPOST /api/webhooks/discord/alerts- Trigger alerts based on conditions
Database Changes:
- Create
user_webhookstable - Store webhook URLs, alert thresholds
Value: Deeper insights into portfolio performance
Endpoints to Create:
GET /api/analytics/price-changes/:userId?period=24h|7d|30d- Recent price changesGET /api/analytics/volatility/:userId- Portfolio volatility metricsGET /api/analytics/concentration/:userId- Concentration risk analysis
Base URL: https://prices.csgotrader.app/latest/
Endpoints:
/steam.json- Steam Community Market prices/csfloat.json- CSFloat Market prices/skinport.json- Skinport prices/buff163.json- Buff163 prices
Price Structure:
{
"AK-47 | Redline (Field-Tested)": {
"price": 15.50,
"starting_at": { "price": 15.50, "volume": 1234 },
"highest_order": { "price": 14.20, "volume": 567 },
"last_24h": 15.30,
"last_7d": 15.10,
"last_30d": 14.80,
"last_90d": 14.50
}
}Base URL: https://raw.githubusercontent.com/ByMykel/CSGO-API/main/public/api/en/
Files to Download:
skins.json- Float ranges, rarity, categoriescrates.json- Cases and contentscollections.json- Collectionsstickers.json- Sticker database
URL: https://raw.githubusercontent.com/somespecialone/steam-item-name-ids/refs/heads/master/data/cs2.json
Purpose: Convert item names to Steam nameID for API calls
| Feature | Priority | Effort | Value |
|---|---|---|---|
| CSGO-API Integration | HIGH | 4-6 hours | ⭐⭐⭐⭐⭐ |
| Portfolio Snapshots | HIGH | 3-4 hours | ⭐⭐⭐⭐⭐ |
| Partial Sales | HIGH | 2-3 hours | ⭐⭐⭐⭐ |
| Steam Fee Calculation | HIGH | 1-2 hours | ⭐⭐⭐⭐ |
| Price Override System | MEDIUM | 2-3 hours | ⭐⭐⭐ |
| Batch Price Updates | MEDIUM | 3-4 hours | ⭐⭐⭐⭐ |
| Discord Webhooks | MEDIUM | 2-3 hours | ⭐⭐⭐ |
| Advanced Analytics | LOWER | 4-6 hours | ⭐⭐⭐ |
Total Estimated Effort: 21-31 hours for all features
- Start with CSGO-API Integration - Foundational data that enhances all other features
- Add Steam Fee Calculation - Quick win, improves pricing accuracy immediately
- Implement Portfolio Snapshots - Critical for portfolio visualization
- Add Partial Sales - Completes the investment lifecycle tracking
- Batch Price Updates - Improves data freshness and accuracy
- Price Override System - Handles edge cases and rare items
- Discord Webhooks - Adds engagement and notifications
- Advanced Analytics - Nice-to-have enhancements
/var/www/csfloat-api/lib/csgoapi.js- CSGO-API data integration/var/www/csfloat-api/lib/steam-fees.js- Steam fee calculations/var/www/csfloat-api/lib/csgotrader.js- CSGOTrader API client/var/www/csfloat-api/lib/discord.js- Discord webhook integration/var/www/csfloat-api/data/- Directory for cached CSGO-API data
/var/www/csfloat-api/index.js- Add new endpoints/var/www/csfloat-api/create_portfolio_tables.sql- Add new tables/fields
game_items_metadata- CSGO-API data cacheuser_settings- User preferences and marketplace priorityuser_webhooks- Discord webhook configurationsprice_updates_log- Track batch price update runs
- ✅ Complete research (DONE)
- ⏳ Implement Phase 1: CSGO-API Integration
- ⏳ Implement Phase 2: Portfolio Snapshots
- ⏳ Implement Phase 3: Partial Sales
- ⏳ Continue with remaining phases
Expected Timeline: 1-2 weeks for complete implementation of all high-priority features.