Skip to content

UEFA Champions League Fantasy Football bot based on mathematical optimization

License

Notifications You must be signed in to change notification settings

sreekanthrajagopalan/uclfantasybot

Repository files navigation

UCL Fantasy Bot

UEFA Champions League Fantasy Football bot based on mathematical optimization

Introduction

The bot at this time is a simple Python script that logs into a Fantasy Football session for squad management:

  • Get the current team,
  • Get the feed of players data,
  • Find the best team for the next matchday.

The optimal team selection is based on a integer programming (IP) model that selects players based on basic fantasy rules.

Notes

  • The bot does not automatically make the transfers between matchdays at this time.
  • The bot assumes a team already exists.
  • The optimization model does not consider playing wildcard and limitless chips at this time.
  • The optimization model does not consider substitutions within matchdays at this time.

Requirements

The bot is developed natively in Python. The mathematical optimization model is based on Pyomo open-source modeling system.

The bot currently uses HiGHS mixed-integer linear programming solver installed via pip install highspy. For use with Pyomo, APPSI needs to be setup. Use the provided requirements.txt and setup APPSI following instructions.

The bot can also use COIN-OR CBC mixed-integer linear programming solver installed via the Ubuntu package coinor-cbc. Use the .devcontainer provided.

Usage

Install Python modules and optimization solver requirements.

  • Python modules in .devcontainer/requirements.txt
  • COIN-OR CBC or HiGHS solver

Create a login_payload.json file from the template with appropriate user credentials. See this Reddit for details to get the login payload.

Run python squad_manager.py --md 5 to get the squad for the 5th matchday.

Run python squad_manager.py --md 5 --use-wildcard True to get the squad for the 5th matchday with wildcard chip.

Run python squad_manager.py --md 5 --use-limitless True to get the squad for the 5th matchday with limitless chip.

Develop

You may use the .devcontainer in the repository to get started with the development.

TODOs

Known issues

  • Handle the scenario when a team does not exist

Disclaimer

The project is intended to be academic in nature. The author(s) have neither monetarily benefited from third-parties nor have won any official fantasy football prize. The author(s) will duly disclose any such benefits upon receipt and forfeit them if required. The author(s) shall not be held liable for any misuse of the software or for any violation of the spirit of the fantasy football by others.

About

UEFA Champions League Fantasy Football bot based on mathematical optimization

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published