Fraud Detection
GET /fraud-check evaluates float fraud signals for a user before Float Service disburses; POST /fraud-check records the outcome. Signals are 24-hour lookbacks in the fraud log (site-float-service-log) plus one live query on bank account hashes.
Check Sequence
Request body: user_id, install_id, float_type, account_id, zip_code. Checks run in order; the first failure returns can_float: false with the matching error_code.
| Check | Fails when | error_code |
|---|---|---|
1. Bank account activity |
|
|
2. Install ID |
A |
|
3. User ID |
A |
|
4. Payment-method hash |
A |
|
A passing check writes REQUEST rows for the user, install ID, and hash. For pinless floats a second card hash without the zip code is also computed and looked up; a hit only logs a warning, and its REQUEST row is written too.
Source: pkg/fraud/fraud.go, pkg/api/fraud.go
Result Recording
POST /fraud-check with float_result:
float_result |
Rows written |
|---|---|
|
|
|
|
Only SUCCESS rows count toward the 24-hour checks. Row keys are USER, INSTALL_ID, ACCOUNT_HASH, CARD_HASH (schema).
Environment Toggles
Production is unaffected by every toggle below.
| Check | Toggle | Effect |
|---|---|---|
Install ID |
|
Off by default outside prod: the lookup is skipped and |
Card hash |
|
Always bypassed |
Bank account hash |
|
Bypassed for the two Plaid sandbox account hashes ( |
Bank account activity |
|
|
Source: deploy/main.tf, cmd/api/main.go, pkg/fraud/fraud.go