How it works
Sure uses your SnapTrade Client ID from an OAuth app to create a per-family SnapTrade user and sync the accounts you authorize. Personal API keys are not supported because they do not use SnapTrade’s Register User flow. Sure supports two ways to authorize a brokerage connection, and the setup steps differ slightly between them.Device code flow
The device code flow (RFC 8628) requires only a Client ID. When you connect a brokerage, Sure displays a short code that you confirm on the SnapTrade website. No redirect URI registration is needed, so this works on any deployment including those that cannot expose a public callback URL.Authorization code flow (browser redirect)
The browser redirect flow requires a Client ID and a Client Secret, plus the redirect URIhttps://<your-host>/snaptrade_items/oauth_callback registered on your OAuth app. When you connect a brokerage, you are sent to SnapTrade in the same browser tab and redirected back after approval.
Sure prefers the browser redirect when both flows are available, because it is the shorter path for the user.
Both flows produce the same access and refresh tokens and result in the same ongoing sync behavior — holdings, activity, and token rotation all work identically after authorization.
Setting up SnapTrade
To connect your brokerage accounts:- Create an account at dashboard.snaptrade.com
- Create or open a SnapTrade OAuth app and copy its Client ID
- In Sure, go to Settings > Bank sync > SnapTrade
- Paste the credentials and click Save Configuration
- Click Connect Brokerage and complete the authorization flow
- After authorization, open the account setup screen and choose which discovered brokerage accounts to link
- Copy the Client Secret from your SnapTrade OAuth app and paste it into the Sure settings alongside the Client ID
- Register
https://<your-host>/snaptrade_items/oauth_callbackas a redirect URI on the OAuth app
Environment variables
Setting only
SNAPTRADE_OAUTH_CLIENT_ID enables the device code flow. Setting both variables enables the browser redirect flow as the default, with the device code flow available as a fallback where shown.
Managing connections
SnapTrade connections are managed per family inside Sure. To open the connections panel, click the menu on a SnapTrade account card and select Manage Connections, or go to Settings > Providers > SnapTrade and expand the connections section directly. After your first successful connection, Sure lets you:- Add another brokerage connection
- Review connected brokerages
- Remove a brokerage connection
- Delete unused or stale brokerage connections before adding more
Supported account types
Sure currently uses SnapTrade for:- Investment accounts
- Crypto accounts
Features
Brokerage syncing
- Brokerage aggregation: Connect supported brokerages through a single provider
- Holdings sync: Import securities positions and cash balances
- Activity sync: Import brokerage activity and trade history
- Multiple brokerages: Connect more than one brokerage under the same SnapTrade configuration
- Link existing accounts: Attach a discovered SnapTrade account to an existing Sure investment or crypto account
Account setup flow
After authorization, Sure separates discovered SnapTrade accounts into:- Linked accounts: Already attached to a Sure account
- Unlinked accounts: Ready to be linked or created in Sure
Activity type coverage
Sure maps the full range of SnapTrade activity types to trades or cash entries: Trade activities (always imported as investment trades): BUY, SELL, REI, REINVEST, OPTION_BUY, OPTION_SELL, OPTIONASSIGNMENT, ASSIGNED, OPTIONEXERCISE, EXERCISED, OPTIONEXPIRATION, EXPIRED, STOCK_DIVIDEND, SPLIT, REVERSE_SPLIT, SPINOFF, and asset transfer variants (EXTERNAL_ASSET_TRANSFER_IN/OUT, INTERNAL_ASSET_TRANSFER_IN/OUT). When SnapTrade supplies anoption_symbol object with a ticker, Sure prefers that option ticker (for example, TQQQ 260220C00051000) over the regular symbol, which may identify the underlying equity. OPTION_BUY and OPTION_SELL are imported as trades, but the activity type alone does not supply an option ticker; without one, Sure falls back to the regular symbol data. Fees on option trades are stored separately and factored into realized gain/loss the same way as equity trades.
Unit-dependent activities (ADJUSTMENT, STOCK_MERGER, MERGER, CORP_ACTION): imported as trades when SnapTrade reports a non-zero share quantity, and as cash entries when the quantity is absent or zero. This lets zero-cash corporate actions (splits, mergers with no cash consideration) record correctly as unit-only trades while still capturing any cash component when it is present.
Cash activities: DIVIDEND, DIV, CONTRIBUTION, WITHDRAWAL, TRANSFER, TRANSFER_IN/OUT, INTERNAL_CASH_TRANSFER_IN/OUT, INTEREST, FEE, TAX, CASH, REBATE, RETURN_OF_CAPITAL, DISTRIBUTION, SUBSTITUTE_DIVIDEND, JOURNAL, OTHER.
Security row disambiguation
A ticker can have more than one security row in Sure’s database when it trades on multiple exchanges. Sure selects a security row in a fixed, deterministic order:- The row from a matching SnapTrade or providerless holding in the account, preserving user remaps and locked cost basis. Holdings from another provider are excluded.
- The row matching the exchange SnapTrade reports for the ticker.
- Online rows first, then rows with a price provider, then the oldest row.
Resync reclassification
If a later sync determines an activity should be classified differently (for example, a CORP_ACTION that previously had units is re-fetched without units), Sure reclassifies the entry automatically. Entries that have been manually edited or locked by an import are protected and will not be reclassified; these cases are recorded in the debug log at Settings > Debug.Option contract support
Sure imports option trades from SnapTrade, including standard and mini-option contracts. When SnapTrade reports anoption_symbol alongside a plain symbol, Sure uses the option symbol. This prevents brokerages such as Robinhood, which populate symbol with the underlying equity even on options activity, from importing option trades as common stock.
Option contracts are displayed with a formatted name that includes the underlying ticker, strike price, option type, and expiration date. For example: AAPL $150 CALL (2026-01-20).
SnapTrade reports option quantity in contracts but quotes price per underlying share. Sure converts the per-share price to a per-contract price by applying the contract multiplier (100 for standard options, 10 for mini-options) so that quantity × price correctly represents total contract value.
Trade amount and fee accuracy
Sure uses SnapTrade’s reported trade amount directly rather than computing it as quantity × price. Brokerage-reported prices are often rounded or estimated, so the computed value can drift by a few cents from the cash that actually moved — most visibly for reinvestments that should match their dividend exactly. When SnapTrade reports a fee for the trade, Sure stores it on the trade record. If a resync omits the fee (SnapTrade only reports it “if provided by the brokerage”), the previously stored value is preserved rather than overwritten. If SnapTrade reports an amount but no price, Sure derives the price from the reported amount, fee, and quantity so the trade can still be imported. These derived-price trades are recorded in the debug log at Settings > Debug so you can inspect them. When a trade cannot be imported — for example because SnapTrade omitted both quantity and amount — it is also recorded in the debug log with the reason, so support can identify the gap without requiring a full sync replay.Background activity import
Fresh brokerage connections may take a little longer to finish importing activity history. Sure continues fetching account activity in the background after the initial connection when needed.Security
Sure encrypts sensitive SnapTrade data at rest using ActiveRecord Encryption when encryption keys are configured in your deployment. ConfigureACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY, ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY, and ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT, or the corresponding Rails encryption credentials, before connecting a SnapTrade integration in a production environment. Without encryption configuration, the fields below are stored in plaintext.
The following fields on each SnapTrade account record are encrypted:
- Account number — encrypted with non-deterministic encryption; never looked up by value, so it does not need to be deterministic
- Raw API payloads — the raw account, transaction, holdings, activities, and balance payloads returned by SnapTrade
Encrypting existing records
If you configured encryption keys after your initial setup, use thesecurity:backfill_encryption rake task to backfill the supported fields:
The backfill covers account_number and raw account, transaction, holdings, and activities payloads. It currently does not backfill raw_balances_payload or SnapTrade item credentials; it is not a complete migration of all existing SnapTrade data.
dry_run=false to apply changes:
Limitations
- Investment-focused: SnapTrade is not the right provider for checking, savings, or credit card syncing
- Connection caps: Free-tier SnapTrade accounts have limited brokerage connection slots
- Provider coverage: Only brokerages supported by SnapTrade can be connected
- Beta maturity: SnapTrade support in Sure is still marked beta in the app
- Activity timing: Activity availability depends on SnapTrade’s data timing and the connected brokerage
- Options in holdings: Option positions are not shown in the holdings view; only options activity (trades) is imported
Troubleshooting
Credentials save, but brokerage connection does not start
- Verify the Client ID was copied from the correct SnapTrade OAuth app
- If using the browser redirect flow, confirm the Client Secret is also set and the redirect URI is registered
- Re-open Settings > Bank sync > SnapTrade and save the credentials again
- Try the Connect Brokerage button again so Sure can re-register the SnapTrade user if needed
Holdings show as empty after connecting a brokerage
SnapTrade deprecated the/positions endpoint for apps registered after their 2026 cutoff. Sure now uses the /positions/all replacement endpoint, so holdings should import correctly for all new and existing connections. If you connected a brokerage before this fix and see no holdings, run a manual sync from the account card to refresh.
No accounts appear after connecting a brokerage
- Wait for the initial sync to finish and refresh the setup page
- Check whether the brokerage was connected successfully in Manage Connections
- Try running another sync from the SnapTrade account card in Sure
Hit the free-tier connection limit
- Open Manage Connections in Sure and delete old brokerage connections you no longer use
- Delete unused or stale brokerage connections first; the limit applies to brokerage connections, not registrations alone
- Upgrade your SnapTrade plan if you need more simultaneous brokerage connections