Architecture
System Context
The Insight Service is deployed as a set of AWS Lambda functions. It exposes a REST API behind API Gateway and participates in the broader FloatMe platform as both an event-driven consumer (Kinesis, SQS, EventBridge) and producer (EventBridge).
Inbound Traffic
| Source | Description |
|---|---|
|
IAM-authenticated requests from internal FloatMe services and JWT-authenticated requests from the mobile app. Routes to the |
|
Pave webhook callbacks. The |
|
Plaid transaction events from the Transactions Service. Consumed by the |
|
FloatMe transaction events from the Transactions Service. Consumed by the |
|
Mining job messages enqueued by the webhook Lambda. Consumed by |
|
Manual replay job messages. Consumed by |
|
|
|
|
|
|
Outbound Traffic
| Destination | Description |
|---|---|
EventBridge ( |
|
EventBridge ( |
|
Pave API |
Transaction and balance uploads (feeder, replay-feeder); unified insight and cash-advance score fetches (miner, API). |
SageMaker ( |
ML inference requests for per-transaction income classification, invoked by the API Lambda on |
Segment |
Push notifications and analytics events from the funds-notifier and balance-alert Lambdas. |
Credit Card Service |
Credit card funding notifications sent by the funds-notifier Lambda on income detection events. |
User Service |
User profile lookups by the API Lambda. |
Transactions Service |
Account and balance queries by the miner and API Lambdas. |
Underwriting Service |
Eligibility checks by the API Lambda (income verification) and the balance-alert Lambda. |
Lambda Functions
| Function | Trigger | Responsibility |
|---|---|---|
|
API Gateway (IAM + JWT) |
Primary REST API. Handles all insight CRUD, employment management, payday prediction, income detection via SageMaker, cash-advance score retrieval, and expense forecasting. Composes Pave data, RDS employment records, and DynamoDB insight cache. |
|
Kinesis ( |
Receives Plaid transaction events, uploads the user’s transactions and balances to Pave in paginated batches, and tracks pagination progress per user in DynamoDB ( |
|
API Gateway (Pave webhook, HMAC-verified) |
Receives Pave webhook callbacks. Validates HMAC signatures. Acknowledges |
|
SQS ( |
Dequeues mining jobs. Fetches unified insights (expenses, income, scores) from Pave. Writes all entity types to DynamoDB. Checks |
|
SQS ( |
Manual replay path. Refetches Pave data with custom date or parameter overrides and updates pagination state in DynamoDB. Does not trigger mining or emit events. |
|
Kinesis ( |
Filters the FloatMe transaction stream for negative-amount transactions dated today (America/Chicago timezone). Emits |
|
SQS ( |
On income detection, calls the Credit Card Service and emits a Segment event to notify the user. Stores a |
|
SQS ( |
When a new bank account is linked, validates eligibility via the Underwriting Service and sends a balance alert push notification via Segment. Uses a DynamoDB distributed lock to prevent concurrent alerts for the same user. |
|
SQS ( |
When a user’s bank institution changes, clears stale employment records from the RDS employment table. |
Pave Mining Architecture
The Pave mining sub-system handles the full lifecycle of ingesting transaction data into Pave and retrieving the resulting financial insights. The feeder and miner are decoupled via Pave’s own processing pipeline and a webhook callback.
See Pave Mining for detailed flow diagrams and per-component decision logic.
Data Storage
DynamoDB: prod-pave
The primary data store for all insight entities. Uses a single-table design. Entities stored:
| Entity Type | Content |
|---|---|
|
Aggregate metadata record for a user’s latest insight run (timestamp, version) |
|
Recurring expense records sourced from Pave (merchant, due date, amount, bill type) |
|
Ritual expense records sourced from Pave (normalized merchant, frequency, average amount) |
|
Income source records sourced from Pave (recurring sources, total recurring income) |
|
Bank account balance snapshots computed from Transactions Service data during mining (checking + savings accounts, average monthly income/expenses) |
|
Cash-advance repayment probability scores sourced from Pave (15d, 30d, 45d intervals) |
|
Predicted next payday date and supporting data |
|
Per-user label tracking whether the user’s Plaid data has been labeled in Pave |
|
Per-user, per-request pagination state for tracking whether all Pave insight pages have been processed |
|
Manual income verification data entered by the user; augmented by MX or Ollie verifications |
|
Balance alert state for deduplication |
|
Credit card income notification deduplication state |
See DynamoDB Tables for full key construction, access patterns, and TTL configuration.
RDS PostgreSQL: employment
The employment table stores user-submitted employment records and is the source of truth for payday prediction inputs. Both a main (read-write) and replica (read-only) connection pool are maintained.
See PostgreSQL Schema for column reference and access patterns.
Additional DynamoDB Tables
| Table | Purpose |
|---|---|
|
Stores income detection run results written by the API Lambda during employment detection. Each record captures the output of all detection methods (A, B, C, D, and ML) for a user’s transaction batch, along with ML metadata. TTL is 7 days to allow downstream Snowflake ingestion. Separate from |
|
Shared data-capture table used to record |
|
Legacy user settings table accessed by the balance-alert Lambda for pre-existing user state. |
|
Legacy distributed lock table used by the balance-alert Lambda to prevent concurrent alerts per user. |
External Service Integrations
| Service | Integration |
|---|---|
Pave |
Core analytics provider. The feeder uploads paginated Plaid transactions and balances. The miner fetches unified insights (expenses, income, ritual, scores) after Pave processes them. The API Lambda fetches scores and expense data directly for synchronous API responses. |
Transactions Service |
Queried by the miner to fetch account balances for the |
User Service |
Queried by the API Lambda for user profile data needed in insight and employment responses. |
Underwriting Service |
Queried by the API Lambda during income verification flows and by the balance-alert Lambda to validate eligibility before sending a balance alert notification. |
Credit Card Service |
Called by the funds-notifier Lambda to trigger credit card funding notifications when an income transaction is detected. |
SageMaker |
The |
GrowthBook |
Feature flags fetched at Lambda startup. Controls income detection method selection, SageMaker model thresholds, payday prediction behaviour, and transaction batch sizes in the feeder. |
Segment |
User analytics and push notification delivery. Called by funds-notifier and balance-alert with structured event payloads. |
EventBridge ( |
Both a producer and a consumer. Produces |
Related Pages
-
Pave Mining — Detailed flow for feeder, webhook, miner, and replay-feeder
-
Income Detection — Income signaller and SageMaker ML pipeline
-
Balance Alerts — Balance alert flow and eligibility logic
-
Institution Changes — Institution change handler flow
-
Event Flows — All EventBridge events produced and consumed
-
DynamoDB Tables — Full schema and access pattern reference
-
PostgreSQL Schema — Employment table schema
-
Infrastructure — Terraform resource reference
-
API Specification — Full OpenAPI spec