Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MatissJanis/sls-ynab-stock-updates
Serverless function to automatically update balance of investment accounts in YNAB
https://github.com/MatissJanis/sls-ynab-stock-updates
finance fintech investment serverless stock stocks ynab
Last synced: 7 days ago
JSON representation
Serverless function to automatically update balance of investment accounts in YNAB
- Host: GitHub
- URL: https://github.com/MatissJanis/sls-ynab-stock-updates
- Owner: MatissJanis
- License: mit
- Archived: true
- Created: 2018-11-19T10:36:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-07T18:22:04.000Z (over 2 years ago)
- Last Synced: 2024-08-01T22:42:26.770Z (4 months ago)
- Topics: finance, fintech, investment, serverless, stock, stocks, ynab
- Language: JavaScript
- Size: 907 KB
- Stars: 14
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ynab - Automated Serverless Stock Updates
README
# sls-ynab-stock-updates
[![Deploy](https://github.com/MatissJanis/sls-ynab-stock-updates/actions/workflows/deploy.yaml/badge.svg)](https://github.com/MatissJanis/sls-ynab-stock-updates/actions/workflows/deploy.yaml)
Serverless function to automatically update investment account balances in YNAB. If the assets are in multiple currencies - tries it's best to convert to the accounts base currency.
## Requirements
- Node
- NPM## Installation
```sh
npm install
```## Setup
There are a few preliminary steps that must be taken to start using this serverless function.
1. Add information about your portfolio to the YNAB accounts you would like to be tracked.
Format: `INVESTMENTS: {Stock Symbol} {Amount}, {Stock Symbol} {Amount}...`
Example: `INVESTMENTS: AAPL 191, MSFT 120`
Crypto example: `INVESTMENTS: BTC-EUR 0.09231, XMR-USD 120.3341`
![](setup.png)
2. Create a `serverless.env.yml` environment variable file and copy the existing variables from the example file.
```sh
cp serverless.env.example.yml serverless.env.yml
```3. Set the environment variables
- `YNAB_API_TOKEN`: personal API token generated in the [YNAB homepage](https://app.youneedabudget.com/settings/developer).
- `AUTOMATIC_APPROVAL`: should the automatic balance adjustment transactions be auto-approved? Useful to set this to `true` if you are running this function hourly/daily/weekly/etc and don't want to go through streams of transactions.
- `AUTOMATIC_CURRENCY_CONVERSION`: should automatic currency conversion be turned on? Converts to budgets base currency. Useful if, you have assets in multiple currencies and they are all in one account.
- `ALARM_EMAIL`: what email should be notified if the function starts malfunctioning and throwing errors?4. Deploy the function
```sh
npm run deploy
```## Development
1. Define necessary env variables in `serverless.env.yml` (example available in `serverless.env.example.yml`)
2. Run (to run locally)
```sh
npm start
```## Deployment
If you wish to run this serverless function on a schedule (configured in `serverless.yml` file), then it must be deployed. This can be done by running the following command.
```sh
npm run deploy
```