# Trade And Account Update Flow

## Goal

Make the analyst agent reflect real trades and current account status quickly without forcing the user to write long explanations during volatile markets.

Use two update paths:

- Fast path: paste a compact block into chat immediately after a trade.
- Accurate path: update the CSV templates when there is time.

## Fast Path: Paste This After A Trade

Use this when speed matters.

```text
TRADE_UPDATE
time: 2026-06-06 00:45 KST
account: main/sub
action: BUY/SELL/TRIM/ADD
ticker: SOXL
qty: 100
price: 00.00 USD
reason: 반도체 과매도 반등 확인
cash_source: 현금/종목명 일부매도
thesis: 2-3일 반등 트레이드
invalid: SMH 전저점 이탈 또는 SOXL -6%
notes: 최초 진입/추가진입/손절/익절
```

The agent should immediately update its working view:

- New position size and cash impact.
- Whether the trade matches the prior plan.
- Whether risk, invalidation, and tax impact are acceptable.
- Whether future recommendations should be adjusted.

## Fast Path: Paste This For Account Snapshot

Use this once per day, or after large trades.

```text
ACCOUNT_SNAPSHOT
time: 2026-06-06 07:00 KST
main_total: 54,000,000 KRW
main_cash: 10,000,000 KRW
sub_total: 49,000,000 KRW
sub_cash: 5,000,000 KRW
day_pnl: -1.8%
realized_ytd: 0 KRW
notes: SOXL 예수금 1,000만원 확보 가능
```

## Accurate Path: CSV Files

Use these files when exact tracking matters:

- Positions: `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/portfolio_positions_template.csv`
- Trades: `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/trade_updates_template.csv`
- Account snapshot: `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/account_snapshot_template.csv`
- Tax lots: `/Users/jangbogeun/Documents/Codex/2026-06-06/2/outputs/tax_lots_template.csv`

## What To Share After Each Trade

Minimum:

- account
- action
- ticker
- quantity
- price
- reason
- invalidation condition

Better:

- source of cash
- expected upside band
- thesis timeframe
- whether this was planned or impulsive
- tax lot impact if selling

## Agent Response After Trade Update

After receiving a trade update, the agent should respond with:

1. Trade registered: concise summary.
2. Plan match: matched plan, early, late, or off-plan.
3. Risk check: position size, invalidation, daily loss budget, correlation.
4. Opportunity cost: whether this capital still has the best expected use.
5. Next trigger: what price/news confirms add, hold, trim, or exit.

## Real-Time Efficiency Rules

- During market hours, share trade updates immediately in the compact format.
- At end of day, update the CSVs or paste one account snapshot.
- If only one thing can be shared, share account cash and current positions first.
- For SOXL, always include whether the 10,000,000 KRW cash requirement is still available.
- For sells, include whether the sale created realized gain/loss for tax tracking.

