Transfer Tastytrade transactions to Ghostfolio.
Getting Started • Credits • Report Bug • Request Feature • Roadmap
Table of Contents
Tastytrade-Ghostfolio plugin works best when doing account management all by itself. In other words, manually creating activities in your Ghostfolio account is not only not needed, but it's also discouraged. That's because some operations (like symbol change, or stock splits) need to understand the complete picture of the account, and change its state totally.
It'll start by getting (or creatting) a Tastytrade
account from Ghostfolio, and from that it'll start adding trading transactions and/or dividends.
This plugin runs completely in the background, and is provided as container images hosted on
Docker Hub for linux/amd64
.
Start by setting up the appropriate environment variables, listed below:
Name | Type | Default Value | Description |
---|---|---|---|
GHOSTFOLIO_ACCOUNT_TOKEN |
string |
The Ghostfolio Account Token. | |
GHOSTFOLIO_BASE_URL |
string (optional) |
"https://ghostfol.io" | The Ghostfolio URL. If you're self hosting you should change it for your particular instance URL, otherwise all data will be exported to Ghostfolio cloud offering. |
TASTYTRADE_USERNAME |
string |
The Tastytrade username. | |
TASTYTRADE_PASSWORD |
string |
The Tastytrade password. |
For evaluation, you can run it by:
$ docker run --rm --name tastytrade-ghostfolio -e GHOSTFOLIO_ACCOUNT_TOKEN=<account_token> -e TASTYTRADE_USERNAME=myuser -e TASTYTRADE_PASSWORD=super_secure olirafa/tastytrade-ghostfolio
It'll spawn the container, ingest all data from Tastytrade, export it all to Ghostfolio, and then remove the container at the end.
To unleash the plugin's potential, you would want to deploy it scheduled to run from time to time (weekly, for example). For that, two approaches are presented, deploying using Docker Compose or in your Kubernetes cluster.
The plugin was developed without a scheduler (like Cron) by design, so another tool is needed for that. We suggest using Ofelia, and that's what we have in the provided Docker Compose file.
First, clone the repo:
$ git clone https://github.com/OliRafa/tastytrade-ghostfolio.git
Enter the repo folder:
$ cd tastytrade-ghostfolio
Then, you'll need a .env
file with the environment variables set.
A example file can be found here.
With everything ready, run the following command:
$ docker compose up -d
It will deploy it in your Docker Compose infrastructure, running weekly by default.
Start by deploying environment variables as ConfigMaps and/or Secrets.
Since Kubernetes has a build-in scheduler, you can create a CronJob following the official documentation.
For an example of such CronJob deployment, take a look below:
apiVersion: batch/v1
kind: CronJob
metadata:
name: tastytrade-ghostfolio
namespace: ghostfolio
spec:
schedule: "@hourly"
jobTemplate:
spec:
template:
spec:
containers:
- name: tastytrade-ghostfolio
image: olirafa/tastytrade-ghostfolio
imagePullPolicy: IfNotPresent
env:
- name: GHOSTFOLIO_ACCOUNT_TOKEN
valueFrom:
configMapKeyRef:
name: tastytrade-ghostfolio-configs
key: GHOSTFOLIO_ACCOUNT_TOKEN
- name: GHOSTFOLIO_BASE_URL
valueFrom:
configMapKeyRef:
name: tastytrade-ghostfolio-configs
key: GHOSTFOLIO_BASE_URL
- name: TASTYTRADE_USERNAME
valueFrom:
secretKeyRef:
name: tastytrade-credentials
key: user
- name: TASTYTRADE_PASSWORD
valueFrom:
secretKeyRef:
name: tastytrade-credentials
key: password
restartPolicy: OnFailure
- Stock buys and sells
- Forward share splits
- Symbol changes
- Dividends and dividend reinvestments
- Account balance
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Ghostfolio for being an amazing tool!
- Tastytrade for the API and tastyware/tastytrade for the API Python wrapper.
- Yahoo Finance for the API and ranaroussi/yfinance for the API Python wrapper.
Distributed under the Unlicense License.
See LICENSE.txt
for more information.
Rafael Oliveira · olirafa.github.io · GitHub @OliRafa · LinkedIn @OliRafa