Handles money and numeric precision correctly with the Alpaca API — numbers-as-strings on the wire, decimals vs floats, rounding/truncation before sending amounts, fractional-share precision, and safe DB storage.
Ships in alpaca-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Financial bugs are silent and expensive. Alpaca's wire format and the realities of decimal arithmetic create a few specific traps. This skill is short, opinionated, and language-agnostic.
Read
alpaca-broker-integrationfirst for base URLs and auth (client-credentials Bearer token; legacy Basic still works).
Alpaca returns prices, quantities, notional, and money amounts as JSON strings ("100.50", "1.5", "190.2345"), and accepts them as strings on the way in. This is deliberate: it avoids the precision loss of JSON's binary floats.
Rule: parse string money fields into a decimal type, never a binary float/double. Serialize back to a string. Don't let a number ever live as an IEEE-754 float in the money path.
| Language | Use | Avoid |
|---|---|---|
| Python | decimal.Decimal("100.50") | float("100.50") |
| TypeScript/JS | a decimal lib (decimal.js/big.js) or string arithmetic | Number(...), parseFloat |
| Go | shopspring/decimal | float64 for accumulation |
| Java/Kotlin | java.math.BigDecimal | double |
Real-world caveat: not every Alpaca endpoint is consistent — some market-data numeric fields come as JSON numbers (e.g. bar OHLC). Prices for display/analytics can tolerate floats; money you move or store must not. Know which field you're touching.
Orders take up to 2 decimal places for notional and 9 for qty (Broker API FAQ; the order schema's "2 decimal points" on qty is stale). Journal amount has no documented precision limit — send cash at 2 dp anyway (§3).
Rule: explicitly round/truncate to the target precision before the API call, using a deliberate rounding mode.
floor(amount * 100) / 100). This is house policy, not an API constraint, and it applies to cash only — never truncate a share qty this way.ROUND_DOWN vs ROUND_HALF_UP) — don't inherit whatever the default float formatting does.# splitting a deposit across holdings — round each slice down, track remainder
slice = truncate(total * (pct / 100), 2)
notional takes 2 decimal places, qty takes 9. Round each to its own limit before sending.qty XOR notional — never both (see alpaca-broker-trading-orders).qty from notional / price and send it — pass notional and let Alpaca compute the fill. Round-tripping through a price you fetched introduces drift.qty, so the 9-dp fractional case can't silently truncate.USD, EUR, JPY, …) and carries FX fees. When you touch it, never assume USD — read and store the currency, and treat FX amounts as decimals end-to-end.Related skills: order qty/notional rules → alpaca-broker-trading-orders; journal/transfer amounts → alpaca-broker-journals, alpaca-broker-funding-transfers; reconciling stored vs Alpaca values → alpaca-broker-reconciliation-idempotency.
What SKILL.md sets; muted values are Claude Code's defaults
/alpacahq-alpaca-skills:alpaca-broker-money-precisionfrom alpaca-skills
Generated from the plugin's indexed repository (alpacahq/alpaca-skills) — no native marketplace selected
npx claudepluginhub p/alpacahq-alpaca-skills14 skills in this plugin
/alpaca-broker-account-onboardingOpen and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements, document upload (incl. W-8BEN), account status lifecycle, and account updates/closure. Use when a developer is building onboarding, KYC, or account-management flows on Alpaca in any language./alpaca-trading-backtestExecute deterministic, reproducible historical backtests from a start date, end date, and strategy concept using the Alpaca CLI plus agent-written workspace code. Use when the user wants to backtest a strategy, simulate historical trades, or return trades, diagnostics, and reproducibility artifacts.
/alpaca-broker-funding-transfersMove money between an Alpaca brokerage account and the EXTERNAL banking world via the Broker API — ACH relationships, wire recipient banks, classic transfers (deposits/withdrawals), the v1beta funding wallet (international/instant), transfer status lifecycles, and fees. Use when building deposit/withdrawal flows or connecting external bank accounts on Alpaca in any language. For moving cash/shares BETWEEN accounts inside your own omnibus, use journals instead./alpaca-broker-integrationEntry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language. Use when a developer wants to build on Alpaca — open brokerage accounts, run KYC, fund accounts, move money via journals, place orders, consume real-time event streams, or pull market data — and need to know base URLs, auth, conventions, or which focused sub-skill to use./alpaca-broker-journalsMove cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and reverse-batch journals, the Idempotency-Key header, journal status lifecycle including corrections, and the firm/sweep-account pattern that powers instant funding and share rewards. Use for internal account-to-account movement in any language. For deposits/withdrawals to EXTERNAL banks, use funding-transfers instead./alpaca-broker-market-dataPull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds (IEX vs SIP), the assets master list, market clock & calendar, news, and the real-time WebSocket stream. Use when building charts, quotes, price feeds, or asset metadata on Alpaca in any language.Other plugins' skills for the same job