log_transaction
Append each settled Buy or Sell trade to a permanent Trade Log sheet, tagged by Plan ID, so Investment Plans totals recalculate automatically.
Instructions
Append one transaction row (Buy or Sell) to the permanent 'Trade Log' sheet, tagged with its Plan ID. Call this after a trade actually settles on-chain — one row per leg, so a DCA entry or a scaled take-profit exit produces several rows under the same Plan ID. The Investment Plans sheet recalculates its totals automatically from these rows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Transaction type. Must be exactly "Buy" or "Sell" — the spreadsheet's aggregate formulas filter on these literal strings. | |
| notes | No | Short note, e.g. '1st DCA leg' or 'TP1: 50% at +30%'. | |
| planId | Yes | Plan ID this transaction belongs to, e.g. PLAN-0001. | |
| priceUsd | Yes | Execution price per token in USD. | |
| tokenQty | Yes | Number of tokens bought or sold. | |
| amountUsd | Yes | Total USD value of this transaction. | |
| tokenTicker | Yes | Token ticker. |