Skip to content

sankethchebbi/gts

Repository files navigation

GuessTheSharpe 🎮

A gamified financial learning experience where players analyze stock return charts and predict their Sharpe ratios.

Built by Sanketh Chebbi with ❤️

Features

  • Pixelated Gaming Interface: Retro-style UI with white background and yellow accents
  • User Authentication: Secure login/signup system
  • Real-time Charts: Interactive financial return visualizations using Chart.js
  • Scoring System: Points based on guess accuracy with lives system
  • Leaderboards: Track top players and scores
  • Admin Dashboard: Comprehensive analytics and user management
  • Sound Effects: Retro gaming audio feedback
  • Mobile Responsive: Works on all devices

Technology Stack

  • Frontend: HTML5, CSS3, JavaScript, Chart.js
  • Backend: Python Flask
  • Database: SQLite3
  • Authentication: Session-based with password hashing
  • Styling: Custom CSS with Press Start 2P font

Getting Started

  1. Clone the repository

    git clone <repository-url>
    cd guessthesharpe
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the application

    python app.py
  4. Open your browser Navigate to http://localhost:5000

Game Rules

  • Objective: Analyze financial return charts and guess their Sharpe ratios
  • Scoring:
    • Perfect guess (±0.05): 2 points
    • Good guess (within tolerance): 1 point
    • Missed guess: 0 points + lose 1 life
  • Lives: Start with 5 hearts, game ends when all are lost
  • Sharpe Ratio: Measures risk-adjusted return (higher = better)

Project Structure

guessthesharpe/
├── static/
│   ├── css/style.css          # Game styling
│   ├── js/
│   │   ├── auth.js           # Authentication logic
│   │   └── game.js           # Game engine
│   └── sounds/               # Audio files
├── templates/
│   ├── landing.html          # Home page
│   ├── game.html             # Game interface
│   └── admin.html            # Admin dashboard
├── db/
│   └── sharpe.db             # SQLite database
├── app.py                    # Flask application
├── schema.sql                # Database schema
└── README.md                 # This file

Database Schema

Users Table

  • id: Primary key
  • username: Unique username
  • password: Hashed password
  • created_at: Registration timestamp

Games Table

  • id: Primary key
  • user_id: Foreign key to users
  • score: Total score
  • hearts_left: Remaining lives
  • is_active: Game status
  • started_at: Game start time
  • ended_at: Game end time

Rounds Table

  • id: Primary key
  • game_id: Foreign key to games
  • guessed_sharpe: Player's guess
  • true_sharpe: Actual Sharpe ratio
  • tolerance: Acceptable error margin
  • score_awarded: Points earned
  • timestamp: Round completion time

Admin Features

Access the admin dashboard at /admin for:

  • User statistics
  • Game analytics
  • Performance metrics
  • Data export functionality

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is created for educational purposes.

Support

For issues or questions, please create an issue in the repository.


Happy Trading! 📈

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors