> ## Documentation Index
> Fetch the complete documentation index at: https://safia.maximusolution.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Investment Portfolio Tracking with SAFIA

> Track stocks, crypto, gold, silver, and forex in one place. Get real-time valuations in IDR, rebalancing suggestions, and FIFO sell calculations.

SAFIA acts as your personal portfolio manager — record every asset you own, track its real-time value in Indonesian Rupiah, and get smart rebalancing suggestions whenever your allocation drifts from your target. All of this happens through natural Telegram conversation, with no apps or spreadsheets required.

## Supported Asset Types

SAFIA tracks the following asset classes, each with real-time pricing:

| Asset Type                        | Examples                | Pricing Source       |
| --------------------------------- | ----------------------- | -------------------- |
| **Saham IDX** (Indonesian stocks) | BBCA, TLKM, GOTO        | TradingView Screener |
| **Saham US** (US stocks)          | AAPL, TSLA, NVDA        | TradingView Screener |
| **Crypto**                        | BTC, ETH, SOL           | CoinGecko            |
| **Emas** (Gold)                   | Antam, LM               | harga-emas.org       |
| **Perak** (Silver)                | Silver gram             | bullion-rates.com    |
| **Forex**                         | USD/IDR, EUR/IDR        | TradingView          |
| **Lainnya** (Other)               | P2P lending, reksa dana | Manual value         |

***

## Adding Assets

Tell SAFIA what you bought. You can specify either the **amount you spent** (SAFIA will fetch the real-time price and calculate units automatically) or the exact **quantity and unit price** if you know them.

<Tabs>
  <Tab title="By nominal amount">
    Provide the total amount you spent in IDR or USD — SAFIA fetches the current price and calculates how many units you got.

    ```text theme={null}
    You:    Beli saham Tesla 8 juta

    SAFIA:  ✅ Tercatat beli TSLA senilai Rp 8.000.000.
            Harga saat ini Rp 26.450.000/lembar → 0,30 lembar.
            Portfolio saham US kamu sekarang Rp 8.000.000.
    ```

    ```text theme={null}
    You:    Buy BTC for 500 dollars

    SAFIA:  Got it! BTC purchase recorded at $500 (~Rp 8.125.000).
            Current price: $97,400 → 0.00513 BTC added to your portfolio.
    ```
  </Tab>

  <Tab title="By quantity and price">
    If you know the exact units and price per unit, provide both directly.

    ```text theme={null}
    You:    Beli 100 lembar BBCA harga 9.500 per lembar

    SAFIA:  ✅ 100 lembar BBCA @ Rp 9.500 = Rp 950.000 tercatat.
            Total posisi BBCA kamu: 100 lembar (Rp 950.000).
    ```

    ```text theme={null}
    You:    Tambah 50 gram emas harga 1.580.000 per gram

    SAFIA:  50 gram emas @ Rp 1.580.000/gr dicatat ✅
            Nilai emas kamu: Rp 79.000.000.
    ```
  </Tab>

  <Tab title="Multiple lots">
    You can record multiple purchases of the same asset over time — SAFIA tracks each lot separately for accurate FIFO sell calculations.

    ```text theme={null}
    You:    Beli lagi 0.1 ETH harga 52 juta

    SAFIA:  Lot baru ETH ditambahkan: 0,1 ETH @ Rp 52.000.000.
            Total posisi ETH: 0,35 ETH (2 lot).
    ```
  </Tab>
</Tabs>

<Tip>
  SAFIA uses real-time prices to calculate units when you provide a nominal amount. If a price is unavailable (e.g., an obscure token or delisted stock), SAFIA will ask you to provide the quantity and unit price manually.
</Tip>

***

## Selling Assets (FIFO Method)

When you sell an asset, SAFIA reduces your holdings using **First In, First Out (FIFO)** — the oldest lots are sold first. Just tell SAFIA what and how much you sold.

```text theme={null}
You:    Jual 50 lembar BBCA

SAFIA:  ✅ 50 lembar BBCA terjual.
        Lot pertama (100 lembar @ Rp 9.500) dikurangi → sisa 50 lembar.
        Nilai posisi BBCA yang tersisa: Rp 475.000.
```

```text theme={null}
You:    Sold 0.005 BTC

SAFIA:  BTC sale recorded ✅ — 0.005 BTC removed (FIFO from your oldest lot).
        Remaining BTC position: 0.00813 BTC.
```

<Note>
  If you try to sell more than you hold, SAFIA will sell only what is available and inform you of the actual quantity recorded.
</Note>

***

## Viewing Your Portfolio

Ask SAFIA for a portfolio overview at any time. You'll get total value in IDR, a breakdown by asset type, and individual positions.

```text theme={null}
You:    Tampilkan portfolio ku

SAFIA:  Portfolio kamu (total Rp 142.500.000):

        📈 Saham IDX — Rp 55.000.000 (38,6%)
           • BBCA 50 lembar · Rp 475.000
           • TLKM 1.000 lembar · Rp 4.100.000
           ... (dan 3 lainnya)

        🪙 Crypto — Rp 43.500.000 (30,5%)
           • BTC 0,00813 BTC · Rp 35.375.000
           • ETH 0,35 ETH · Rp 8.125.000

        🥇 Emas — Rp 44.000.000 (30,9%)
           • 50 gram LM · Rp 44.000.000
```

<CardGroup cols={2}>
  <Card title="Total Portfolio Value" icon="coins">
    Sum of all assets converted to IDR at current market prices.
  </Card>

  <Card title="Allocation Breakdown" icon="chart-pie">
    Each asset type's value and percentage share of the total portfolio.
  </Card>

  <Card title="Individual Positions" icon="list">
    Quantity, current price, and total value for each asset you hold.
  </Card>

  <Card title="Filter by Type" icon="filter">
    Ask "show my crypto" or "lihat saham IDX ku" to view a single asset class.
  </Card>
</CardGroup>

***

## Portfolio Rebalancing

SAFIA can compare your current allocation against a target you define, and tell you exactly how much to buy or sell in each category to reach your goal.

<Steps>
  <Step title="State your target allocation">
    Tell SAFIA your desired allocation as percentages across asset types.

    ```text theme={null}
    You:    Aku mau rebalance portofolio. Target: saham 50%, crypto 30%, emas 20%.

    SAFIA:  Oke, aku analisis portfoliomu sekarang...
    ```
  </Step>

  <Step title="Review the suggestions">
    SAFIA compares your current allocation to the target and tells you exactly what to buy or sell.

    ```text theme={null}
    SAFIA:  Rebalancing menuju 50% Saham / 30% Crypto / 20% Emas
            (total portfolio Rp 142.500.000):

            📈 Saham IDX (38,6% → 50%)
               Beli tambahan Rp 16.250.000

            🪙 Crypto (30,5% → 30%)
               Pertahankan ✅

            🥇 Emas (30,9% → 20%)
               Jual sekitar Rp 15.575.000
    ```
  </Step>

  <Step title="Execute trades at your own discretion">
    SAFIA provides guidance only — you decide which trades to execute and record them via chat when done.

    <Note>
      SAFIA is a financial record-keeping and education tool, not a licensed broker. All investment decisions are yours.
    </Note>
  </Step>
</Steps>

***

## Deleting Assets

<Accordion title="Delete specific asset lots">
  Ask SAFIA to remove a specific position by describing it.

  ```text theme={null}
  You:    Hapus posisi TLKM ku

  SAFIA:  Posisi TLKM (1.000 lembar) sudah dihapus dari portfolio ✅
  ```
</Accordion>

<Accordion title="Reset entire portfolio">
  To clear all asset records, ask SAFIA to reset your portfolio.

  ```text theme={null}
  You:    Reset portfolio ku semuanya

  SAFIA:  Yakin? Ini akan menghapus semua aset secara permanen.
          Ketik "ya, reset portfolio" untuk konfirmasi.

  You:    ya, reset portfolio

  SAFIA:  Portfolio dihapus 🗑️ — 12 aset (7 posisi) telah dihapus.
          Mulai portofolio baru kapan saja.
  ```

  <Warning>
    Resetting your portfolio is permanent. SAFIA will ask for explicit confirmation before deleting all asset records.
  </Warning>
</Accordion>
