A wxWidgets-based desktop client for the Kalshi event trading platform written in C++.
Project hosted on GitHub.
License: GPLv3 (see LICENSE.md file)
To get started with the kdeck project, you will need to install a few dependencies. These should be available through your system package manager.
[!NOTE]
kdeck is primarily developed on Debian 12 (Bookworm) and any instructions may have to be adapted for other systems.
The program is statically linked so no shared libraries should be required. Performance requirements should be minimal but note that kdeck is a GUI program based on wxWidgets, so a desktop environment is required. On Linux, your desktop environment must support GTK.
This project uses vcpkg to manage dependencies and builds. vcpkg is a CMake integration and is loaded via a special toolchain file. Per upstream recommendation, vcpkg is stored as a git submodule.
First install required submodules and bootstrap vcpkg:
git submodule update --init --recursive
./vendor/microsoft/vcpkg/bootstrap-vcpkg.sh
vcpkg is designed to statically compile programs and makes it difficult to rely on shared libraries. For the time being, this repo follows the path of least resistance[^1].
[^1]: Previously, kdeck used the Boost.JSON and curlpp (libcURL wrapper) libraries to make API requests. See the curl-and-boost
branch for the version based on these other libraries. (This branch does not make use of vcpkg but rather vanilla CMake.)
However, a number of build tools are required to be present on the system. A Dockerfile
documents which packages must be installed to acquire the necessary tools on a Debian-based system. You may install these directly or use the Docker-based build.
This project makes use of wxFormBuilder for rapid UI iteration. The project file and generated classes can be found under src/wxfb
.
[!NOTE] While kdeck is statically linked by the vcpkg build process, it is not tested on systems other than Debian 12 (Bookworm).
To build on the command line, simply perform these steps from the root source directory:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE="Debug" ..
make
Or, preferably:
cmake --preset debug
cmake --build --preset debug
You will find the final build output under build/bin
.
[!TIP] Your IDE may provide a CMake integration for building and attaching a debugger.
[!CAUTION] Release builds will target the live Kalshi trading platform. You are responsible for any activity made through the API.
One way to create a release build is to invoke CMake directly, like the debug build above:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE="Release" ..
make
Or, preferably:
cmake --preset release
cmake --build --preset release
For official releases, a Dockerfile
is provided. If you have Docker installed, you may run from the root source directory:
docker build -t kdeck-build .
docker run -v "$(pwd)/build:/src/build" kdeck-build
You will find the final build output under $(pwd)/build/bin
. The container is no longer needed.
For subsequent builds, vcpkg will make use of the binary cache under $(pwd)/build/vcpkg_installed
, resulting in quicker turnarounds.
[!WARNING] This is the default vcpkg binary cache directory for this project. If your host system is Debian 12 (Bookworm), it should be safe to bind-mount this directory and share installed dependencies with the container. Users on other systems wishing to build with and without Docker may want to bind-mount to a different host directory (although builds targeting different system triplets can coexist).
Kalshi provides a REST API for getting portfolio information and making trades, among other things. kdeck uses the Oat++ library to make API requests[^1].
Kalshi provides a demo environment for API development. This is configured by default for debug builds. It is recommended to use different credentials for live and demo environments.