Xpersona
A

avanza-investment-tracker

CLAWHUB · Unverified

Process Avanza CSV exports, calculate TWRR/Modified Dietz returns, and track portfolio performance. Use when importing stock transactions, calculating investment returns, or managing portfolio data. Reads/writes a local SQLite database, and (for live prices and risk metrics) makes outbound HTTPS requests to Avanza, Riksbanken, and Yahoo Finance. Includes irreversible deletion commands (reset --hard, delete-tx, account delete) — see Security and Data Access in SKILL.md/README. Skill: avanza-investment-tracker Owner: patello Summary: Process Avanza CSV exports, calculate TWRR/Modified Dietz returns, and track portfolio performance. Use when importing stock transactions, calculating investment returns, or managing portfolio data. Reads/writes a local SQLite database, and (for live prices and risk metrics) makes outbound HTTPS requests to Avanza, Riksbanken, and Yahoo Finance. Includes irreve

62
Rank
84
Safety
2.9k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 2.9K downloads reported by the source. Last updated 10/9/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s178t29f61bmma8whfnmacavhx83eknq:avanza-investment-tracker
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-patello-avanza-investment-tracker/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

160,000 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: avanza-investment-tracker
description: "Process Avanza CSV exports, calculate TWRR/Modified Dietz returns, and track portfolio performance. Use when importing stock transactions, calculating investment returns, or managing portfolio data. Reads/writes a local SQLite database, and (for live prices and risk metrics) makes outbound HTTPS requests to Avanza, Riksbanken, and Yahoo Finance. Includes irreversible deletion commands (reset --hard, delete-tx, account delete) — see Security and Data Access in SKILL.md/README."
metadata:
  openclaw:
    requires:
      bins:
        - python3
    permissions:
      filesystem:
        - "read/write: user-specified local SQLite database (--database path); no other files accessed"
      network:
        - "https://www.avanza.se (price/FX/chart data for held assets; optional, disable with --update-prices never)"
        - "https://api.riksbank.se (reference rates for risk metrics; optional)"
        - "https://query1.finance.yahoo.com (benchmark index prices for beta/correlation; optional)"
---

# Avanza Investment Tracker

Parse transaction CSVs and compute portfolio performance metrics.

## Security and Data Access

Be aware of what this skill does before running it:

- **Local database writes:** imports, price updates, and portfolio management read and write a local SQLite database.
- **Network access (optional but on by default):** live price/FX lookups contact Avanza's public API with the asset names in your portfolio; risk metrics (`--risk`, `--beta`) may also contact the Riksbanken API and Yahoo Finance (benchmark ticker + date range). Use `--update-prices never` to stay fully offline.
- **Irreversible deletions:** `reset --hard`, `delete-tx`, `account allocate --undo`, and `account delete` permanently remove transactions and rebuild derived tables. There is no built-in undo. Back up your database first (e.g. `cp` or git), and prefer `delete-tx --dry-run` to preview. Avoid broad selectors like `delete-tx --since` unless you are certain of the blast radius.

## Quick Start

Run commands from your workspace root, specifying the paths to your database and CSV:

```bash
# 1. Import new transactions
python path/to/cli.py --database data/asset_data.db import path/to/transactions.csv

# 2. Update price cache and show statistics
python path/to/cli.py --database data/asset_data.db stats --update-prices auto

# 3. View portfolio allocation and APY
python path/to/cli.py --database data/asset_data.db portfolio --account default
```

## Data Storage Pattern

**User data lives OUTSIDE the skill directory.** Recommended structure:

```
workspace-finance/
├── skills/avanza-investment-tracker/   # Portable skill logic
│   ├── SKILL.md
│   ├── scripts/
│   └── assets/
└── data/avanza/                        # Private portfolio data
    ├── transactions.csv
    ├── special_cases.json
    └── asset_data.db
```

## CLI Reference

| Command | Description |
| :--- | :--- |
| `python scripts/cli.py import FILE [--allo

README.md

# Investment Tracker

## Description

This project aims to create a tool for tracking stocks and investments on investment platforms. The original idea for this project was when I was about to buy a SteamDeck. Then I thought better of it and started to wonder how much the money would grow over time if I invested it instead. I realized that it would require me to keep track of the assets that I purchase a particular month, even if I sell them and buy new ones later on. Or if I get dividends and reinvest them.

With this project, I am able to parse data from my investment platform, keep latest asset values up to date and calculate relevant statistics.

This project is a work in progress and will be updated as I go along.

## Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage) — includes [Network access and privacy](#network-access-and-privacy)
- [CLI Reference](#cli-reference)
- [Virtual Portfolios](#virtual-portfolios)
- [Special Cases](#special-cases)
- [Contributing](#contributing)
- [License](#license)

## Features

- Parse and store data from an investment platform.
- Keep track of where money invested each month is moved and grown over time.
- **Per-account statistics**: Calculate gains/losses for each account separately, then merge for combined views
- Calculate statistics for months and years:
    - Deposit
    - Withdrawal
    - Current Value
    - Total Gain/Loss
    - Realized Gain/Loss
    - Unrealized Gain/Loss
    - APY (Annual Percentage Yield)
- Two viewing modes:
    - **Period-specific**: Track performance of investments made in each month/year
    - **Accumulated**: See total portfolio value over time with assets carried forward
- **Account filtering**: View statistics for any combination of accounts with full accumulated history support
- **System status**: Check database statistics, price freshness, and transaction date range
- **Virtual portfolios**: Track sub-portfolios (e.g. strategy sleeves) separately with allocation, transfers, and virtual-vs-parent performance comparison
- **Risk metrics**: Optional risk/beta calculations against a benchmark (fetches policy rates and benchmark prices from Riksbanken/Yahoo Finance)
- **Reporting**: Investment report command with a virtual-portfolio section and benchmark comparison
- **Safety rails**: Destructive commands (`reset --hard`, `delete-tx`, `account delete`) require confirmation and write an automatic timestamped `.bak` backup first

## Installation

1. Clone the repository.
2. Install the dependencies with `pip install -r requirements.txt`.

## Quick Start

```bash
# 1. Import your transaction data
python cli.py import data/your_transactions.csv

# 2. Get statistics with automatic price updates
python cli.py stats --update-prices auto --period year --deposits all

# 3. Check system status anytime
python cli.py status

# 4. (Optional) Set default accounts for filtering
python cli.py settings default-accounts "account1,savings_account"

# 

_meta.json

{
  "ownerId": "kn7cxaw1m27d1fe93wbz40vqkd8309h7",
  "slug": "avanza-investment-tracker",
  "version": "2.14.1",
  "publishedAt": 1788178662828
}

references/troubleshooting.md

# Troubleshooting

**Database locked:** Close SQLite browsers
**Import fails:** Check CSV is Avanza format, UTF-8
**Missing prices:** Check internet, try without --update-prices
**Path errors:** Run from skill root, use data/file.csv

references/workflows.md

# Workflows

## First-Time Setup

```bash
pip install -r requirements.txt
mkdir -p data
cp assets/special_cases_template.json data/special_cases.json
# Edit data/special_cases.json if you have corporate actions
python scripts/cli.py import data/transactions.csv
python scripts/cli.py stats --update-prices auto
```

## Adding More Data

```bash
python scripts/cli.py import data/new_transactions.csv
python scripts/cli.py stats
```

## Reset Everything

```bash
# Soft reset: mark all transactions as unprocessed
python scripts/cli.py reset

# Hard reset: delete all transactions, stats, and prices
python scripts/cli.py reset --hard
```

Sponsored

Ads related to avanza-investment-tracker and adjacent AI workflows.