Connect real bank accounts via Nessie and Plaid to automatically populate financial data for accurate Monte Carlo simulations
Drift supports two banking integrations to import real financial data into the simulation engine: Nessie (Capital One’s DevExchange sandbox) and Plaid (production-ready banking API).
The Nessie service exposes comprehensive endpoints for retrieving customer financial data:
// Get all accounts for a customerGET /api/nessie/accounts?customerId={id}// Get account detailsGET /api/nessie/accounts/{accountId}// Get account transactionsGET /api/nessie/accounts/{accountId}/purchasesGET /api/nessie/accounts/{accountId}/depositsGET /api/nessie/accounts/{accountId}/billsGET /api/nessie/accounts/{accountId}/loansGET /api/nessie/accounts/{accountId}/transfersGET /api/nessie/accounts/{accountId}/withdrawals
From /home/daytona/workspace/source/apps/api/src/routes/nessie.ts:8-20:
The demo uses customer ID 697541cf95150878eafea4ff (Alex Morgan) with comprehensive 12-month financial history including salary deposits, categorized spending, recurring bills, and loan payments.
Plaid data is mapped to an enhanced profile with account-level granularity:From /home/daytona/workspace/source/apps/api/src/services/accountMappers.ts:88-99:
export interface EnhancedFinancialProfile { depository: DepositoryAccount[] // Checking, savings with available balances credit: CreditAccount[] // Credit cards with APR, utilization, min payments loans: LoanAccount[] // Loans with interest rates, amortization investments: InvestmentAccount[] // Holdings with allocation (stocks/bonds/cash) income: IncomeProfile // Monthly amount, frequency, stability score spending: SpendingProfile // By category, volatility, fixed vs variable totalLiquid: number totalCreditDebt: number totalLoanDebt: number totalInvestments: number netWorth: number}
Expected returns and volatility are derived from actual investment allocations:From /home/daytona/workspace/source/apps/api/src/routes/simulation.ts:320-342:
function calculateExpectedReturn(profile: EnhancedFinancialProfile): number { // Aggregate allocation across all investment accounts let stocks = 0, bonds = 0, cash = 0, other = 0 for (const account of profile.investments) { const weight = account.balance / totalValue stocks += account.allocation.stocks * weight bonds += account.allocation.bonds * weight cash += account.allocation.cash * weight other += account.allocation.other * weight } // Historical averages: stocks=10%, bonds=4%, cash=2%, other=6% const expectedReturn = stocks * 0.10 + bonds * 0.04 + cash * 0.02 + other * 0.06 return Math.max(0.02, Math.min(0.15, expectedReturn))}
Plaid requires credentials from https://dashboard.plaid.com. Sandbox mode provides test banks with realistic data for development.