Federal Deposit Insurance Corporation
US Bank Financials
Introduction
The US Bank Financials dataset by the Federal Deposit Insurance Corporation (FDIC) tracks the quarterly call report of every FDIC-insured bank, with its balance sheet, deposits, loans, asset quality, and regulatory capital. The data covers 24,064 banks, starts in June 1984, and is delivered on a quarterly frequency. This dataset is created by parsing the call reports the FDIC publishes. The banks of listed companies are linked to 644 US Equities from March 1998.
For more information about the US Bank Financials dataset, including CLI commands and pricing, see the dataset listing.
About the Provider
The Federal Deposit Insurance Corporation is an independent agency created by Congress in 1933 to maintain stability and public confidence in the nation's financial system. The FDIC insures deposits, examines and supervises financial institutions for safety and soundness and consumer protection, and manages receiverships when banks fail.
Getting Started
The following snippet demonstrates how to request data from the US Bank Financials dataset:
self._symbol = self.add_equity("BAC", Resolution.DAILY).symbol
self._dataset_symbol = self.add_data(FDICBankFinancials, self._symbol).symbol
self._all_banks_symbol = self.add_data(FDICBankReports, FDIC.Banks.ALL).symbol _symbol = AddEquity("BAC", Resolution.Daily).Symbol;
_datasetSymbol = AddData<FDICBankFinancials>(_symbol).Symbol;
_allBanksSymbol = AddData<FDICBankReports>(FDIC.Banks.All).Symbol;
Requesting Data
To add US Bank Financials data to your algorithm, call the AddDataadd_data method. Save a reference to the dataset Symbol so you can access the data later in your algorithm.
class FDICBankFinancialsDataAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self.set_start_date(2019, 1, 1)
self.set_end_date(2021, 3, 31)
self.set_cash(100000)
self._symbol = self.add_equity("BAC", Resolution.DAILY).symbol
self._dataset_symbol = self.add_data(FDICBankFinancials, self._symbol).symbol
self._all_banks_symbol = self.add_data(FDICBankReports, FDIC.Banks.ALL).symbol public class FDICBankFinancialsDataAlgorithm : QCAlgorithm
{
private Symbol _symbol, _datasetSymbol, _allBanksSymbol;
public override void Initialize()
{
SetStartDate(2019, 1, 1);
SetEndDate(2021, 3, 31);
SetCash(100000);
_symbol = AddEquity("BAC", Resolution.Daily).Symbol;
_datasetSymbol = AddData<FDICBankFinancials>(_symbol).Symbol;
_allBanksSymbol = AddData<FDICBankReports>(FDIC.Banks.All).Symbol;
}
}
Accessing Data
To get the current US Bank Financials data, index the current Slice with the dataset Symbol. Slice objects deliver unique events to your algorithm as they happen, but the Slice may not contain data for your dataset at every time step. To avoid issues, check if the Slice contains the data you want before you index it.
def on_data(self, slice: Slice) -> None:
reports = slice.get(FDICBankFinancials).get(self._dataset_symbol)
if reports:
for report in reports.data:
self.log(f"{report.institution_name} {report.report_date}: {report.estimated_uninsured_deposits}") public override void OnData(Slice slice)
{
if (slice.TryGet<FDICBankFinancials>(_datasetSymbol, out var reports))
{
foreach (FDICBankFinancial report in reports.Data)
{
Log($"{report.InstitutionName} {report.ReportDate}: {report.EstimatedUninsuredDeposits}");
}
}
}
To iterate through all of the dataset objects in the current Slice, call the Getget method.
def on_data(self, slice: Slice) -> None:
for dataset_symbol, reports in slice.get(FDICBankFinancials).items():
for report in reports.data:
self.log(f"{dataset_symbol} {report.institution_name}: {report.total_deposits}") public override void OnData(Slice slice)
{
foreach (var kvp in slice.Get<FDICBankFinancials>())
{
var datasetSymbol = kvp.Key;
foreach (FDICBankFinancial report in kvp.Value.Data)
{
Log($"{datasetSymbol} {report.InstitutionName}: {report.TotalDeposits}");
}
}
}
Historical Data
To get historical US Bank Financials data, call the Historyhistory method with the dataset Symbol. If there is no data in the period you request, the history result is empty.
history = self.history[FDICBankFinancials](self._dataset_symbol, timedelta(days=365), Resolution.DAILY)
var history = History<FDICBankFinancials>(_datasetSymbol, TimeSpan.FromDays(365), Resolution.Daily);
For more information about historical data, see History Requests.
Universe Selection
To select a dynamic universe of US Equities based on US Bank Financials data, call the AddUniverseadd_universe method with the FDICBankFinancialsUniverse class and a selection function.
def initialize(self) -> None:
self._universe = self.add_universe(FDICBankFinancialsUniverse, self.universe_selection)
def universe_selection(self, alt_coarse: List[FDICBankFinancialsUniverse]) -> List[Symbol]:
return list({d.symbol for d in alt_coarse if d.domestic_deposits and (d.estimated_uninsured_deposits or 0) / d.domestic_deposits < 0.3}) private Universe _universe;
public override void Initialize()
{
_universe = AddUniverse<FDICBankFinancialsUniverse>(altCoarse =>
(from d in altCoarse.OfType<FDICBankFinancialsUniverse>()
where d.DomesticDeposits > 0m && (d.EstimatedUninsuredDeposits ?? 0m) / d.DomesticDeposits < 0.3m
select d.Symbol).Distinct());
}
For more information about dynamic universes, see Universes.
Remove Subscriptions
To remove your subscription to US Bank Financials data, call the RemoveSecurityremove_security method.
self.remove_security(self._dataset_symbol)
RemoveSecurity(_datasetSymbol);
If you subscribe to US Bank Financials data for assets in a dynamic universe, remove the dataset subscription when the asset leaves your universe. To view a common design pattern, see Track Security Changes.
Supported Banks
The following table shows the accessor code you need to add each bank to your algorithm:
| Bank | Constant | Headquarters |
|---|---|---|
| JPMorgan Chase Bank, National Association | FDIC.Banks.Ohio.JPMorganChaseBankNationalAssociationFDIC.Banks.Ohio.JP_MORGAN_CHASE_BANK_NATIONAL_ASSOCIATION | Columbus, OH |
| Bank of America, National Association | FDIC.Banks.NorthCarolina.BankOfAmericaNationalAssociationFDIC.Banks.NorthCarolina.BANK_OF_AMERICA_NATIONAL_ASSOCIATION | Charlotte, NC |
| Citibank, National Association | FDIC.Banks.SouthDakota.CitibankNationalAssociationFDIC.Banks.SouthDakota.CITIBANK_NATIONAL_ASSOCIATION | Sioux Falls, SD |
| Wells Fargo Bank, National Association | FDIC.Banks.SouthDakota.WellsFargoBankNationalAssociationFDIC.Banks.SouthDakota.WELLS_FARGO_BANK_NATIONAL_ASSOCIATION | Sioux Falls, SD |
| Goldman Sachs Bank USA | FDIC.Banks.NewYork.GoldmanSachsBankUsaFDIC.Banks.NewYork.GOLDMAN_SACHS_BANK_USA | New York, NY |
| U.S. Bank National Association | FDIC.Banks.Ohio.USBankNationalAssociationFDIC.Banks.Ohio.US_BANK_NATIONAL_ASSOCIATION | Cincinnati, OH |
| Capital One, National Association | FDIC.Banks.Virginia.CapitalOneNationalAssociationFDIC.Banks.Virginia.CAPITAL_ONE_NATIONAL_ASSOCIATION | McLean, VA |
| PNC Bank, National Association | FDIC.Banks.Delaware.PncBankNationalAssociationFDIC.Banks.Delaware.PNC_BANK_NATIONAL_ASSOCIATION | Wilmington, DE |
| Truist Bank | FDIC.Banks.NorthCarolina.TruistBankFDIC.Banks.NorthCarolina.TRUIST_BANK | Charlotte, NC |
| The Bank of New York Mellon | FDIC.Banks.NewYork.TheBankOfNewYorkMellonFDIC.Banks.NewYork.THE_BANK_OF_NEW_YORK_MELLON | New York, NY |
| Morgan Stanley Bank, National Association | FDIC.Banks.Utah.MorganStanleyBankNationalAssociationFDIC.Banks.Utah.MORGAN_STANLEY_BANK_NATIONAL_ASSOCIATION | Salt Lake City, UT |
| State Street Bank and Trust Company | FDIC.Banks.Massachusetts.StateStreetBankAndTrustCompanyFDIC.Banks.Massachusetts.STATE_STREET_BANK_AND_TRUST_COMPANY | Boston, MA |
| TD Bank, National Association | FDIC.Banks.Delaware.TdBankNationalAssociationFDIC.Banks.Delaware.TD_BANK_NATIONAL_ASSOCIATION | Wilmington, DE |
| Fifth Third Bank, National Association | FDIC.Banks.Ohio.FifthThirdBankNationalAssociationFDIC.Banks.Ohio.FIFTH_THIRD_BANK_NATIONAL_ASSOCIATION | Cincinnati, OH |
| The Huntington National Bank | FDIC.Banks.Ohio.TheHuntingtonNationalBankFDIC.Banks.Ohio.THE_HUNTINGTON_NATIONAL_BANK | Columbus, OH |
| BMO Bank National Association | FDIC.Banks.Illinois.BmoBankNationalAssociationFDIC.Banks.Illinois.BMO_BANK_NATIONAL_ASSOCIATION | Chicago, IL |
| Charles Schwab Bank, SSB | FDIC.Banks.Texas.CharlesSchwabBankSsbFDIC.Banks.Texas.CHARLES_SCHWAB_BANK_SSB | Westlake, TX |
| Morgan Stanley Private Bank, National Association | FDIC.Banks.NewYork.MorganStanleyPrivateBankNationalAssociationFDIC.Banks.NewYork.MORGAN_STANLEY_PRIVATE_BANK_NATIONAL_ASSOCIATION | Purchase, NY |
| First-Citizens Bank & Trust Company | FDIC.Banks.NorthCarolina.FirstCitizensBankAndTrustCompanyFDIC.Banks.NorthCarolina.FIRST_CITIZENS_BANK_AND_TRUST_COMPANY | Raleigh, NC |
| Citizens Bank, National Association | FDIC.Banks.RhodeIsland.CitizensBankNationalAssociationFDIC.Banks.RhodeIsland.CITIZENS_BANK_NATIONAL_ASSOCIATION | Providence, RI |
Example Applications
The US Bank Financials dataset enables you to monitor the funding, asset quality, and capital of US banks. Examples include the following strategies:
- Ranking listed banks by the share of their deposits that is uninsured
- Measuring unrealized losses on held-to-maturity securities against regulatory capital
- Tracking deposit flows across the banks of one state, listed or not
Classic Algorithm Example
The following example algorithm buys BAC when the share of uninsured deposits across its banks falls from the previous quarter. Otherwise, it liquidates the position.
from AlgorithmImports import *
class FDICBankFinancialsDataAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(2019, 1, 1)
self.set_end_date(2021, 3, 31)
self.set_cash(100000)
self.equity = self.add_equity("BAC", Resolution.DAILY).symbol
self.dataset_symbol = self.add_data(FDICBankFinancials, self.equity).symbol
self.previous_share = None
def on_data(self, slice):
reports = slice.get(FDICBankFinancials).get(self.dataset_symbol)
if not reports:
return
# Sum the latest quarter over every bank the company owns.
latest = max(report.report_date for report in reports.data)
quarter = [report for report in reports.data if report.report_date == latest]
deposits = sum(report.domestic_deposits or 0 for report in quarter)
if not deposits:
return
share = sum(report.estimated_uninsured_deposits or 0 for report in quarter) / deposits
# Hold the stock while the share of uninsured deposits falls.
if self.previous_share is None or share <= self.previous_share:
self.set_holdings(self.equity, 1)
else:
self.liquidate(self.equity)
self.previous_share = share using System;
using System.Linq;
using QuantConnect;
using QuantConnect.Algorithm;
using QuantConnect.Data;
using QuantConnect.DataSource;
public class FDICBankFinancialsDataAlgorithm : QCAlgorithm
{
private Symbol _equity, _datasetSymbol;
private decimal? _previousShare;
public override void Initialize()
{
SetStartDate(2019, 1, 1);
SetEndDate(2021, 3, 31);
SetCash(100000);
_equity = AddEquity("BAC", Resolution.Daily).Symbol;
_datasetSymbol = AddData<FDICBankFinancials>(_equity).Symbol;
}
public override void OnData(Slice slice)
{
if (!slice.TryGet<FDICBankFinancials>(_datasetSymbol, out var reports))
{
return;
}
// Sum the latest quarter over every bank the company owns.
var records = reports.Data.OfType<FDICBankFinancial>().ToList();
var latest = records.Max(report => report.ReportDate);
var quarter = records.Where(report => report.ReportDate == latest).ToList();
var deposits = quarter.Sum(report => report.DomesticDeposits ?? 0m);
if (deposits == 0m)
{
return;
}
var share = quarter.Sum(report => report.EstimatedUninsuredDeposits ?? 0m) / deposits;
// Hold the stock while the share of uninsured deposits falls.
if (_previousShare == null || share <= _previousShare)
{
SetHoldings(_equity, 1);
}
else
{
Liquidate(_equity);
}
_previousShare = share;
}
}
Framework Algorithm Example
The following example algorithm emits an up insight for BAC when the share of uninsured deposits across its banks falls from the previous quarter. Otherwise, it emits a flat insight.
from AlgorithmImports import *
class FDICBankFinancialsFrameworkAlgorithm(QCAlgorithm):
def initialize(self):
self.set_start_date(2019, 1, 1)
self.set_end_date(2021, 3, 31)
self.set_cash(100000)
self.universe_settings.resolution = Resolution.DAILY
self.set_universe_selection(ManualUniverseSelectionModel(
[Symbol.create("BAC", SecurityType.EQUITY, Market.USA)]))
self.add_alpha(UninsuredDepositsAlphaModel())
self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel())
self.set_execution(ImmediateExecutionModel())
class UninsuredDepositsAlphaModel(AlphaModel):
def __init__(self):
self._dataset_symbols = {}
self._previous_share = {}
def update(self, algorithm, data):
insights = []
for dataset_symbol, reports in data.get(FDICBankFinancials).items():
equity = dataset_symbol.underlying
latest = max(report.report_date for report in reports.data)
quarter = [report for report in reports.data if report.report_date == latest]
deposits = sum(report.domestic_deposits or 0 for report in quarter)
if not deposits:
continue
share = sum(report.estimated_uninsured_deposits or 0 for report in quarter) / deposits
# Emit an up insight while the share of uninsured deposits falls.
previous = self._previous_share.get(equity)
direction = InsightDirection.UP if previous is None or share <= previous else InsightDirection.FLAT
insights.append(Insight.price(equity, timedelta(days=90), direction))
self._previous_share[equity] = share
return insights
def on_securities_changed(self, algorithm, changes):
for security in changes.added_securities:
self._dataset_symbols[security.symbol] = algorithm.add_data(FDICBankFinancials, security.symbol).symbol
for security in changes.removed_securities:
dataset_symbol = self._dataset_symbols.pop(security.symbol, None)
if dataset_symbol:
algorithm.remove_security(dataset_symbol) using System;
using System.Collections.Generic;
using System.Linq;
using QuantConnect;
using QuantConnect.Algorithm;
using QuantConnect.Algorithm.Framework.Alphas;
using QuantConnect.Algorithm.Framework.Execution;
using QuantConnect.Algorithm.Framework.Portfolio;
using QuantConnect.Algorithm.Framework.Selection;
using QuantConnect.Data;
using QuantConnect.Data.UniverseSelection;
using QuantConnect.DataSource;
public class FDICBankFinancialsFrameworkAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2019, 1, 1);
SetEndDate(2021, 3, 31);
SetCash(100000);
UniverseSettings.Resolution = Resolution.Daily;
SetUniverseSelection(new ManualUniverseSelectionModel(
QuantConnect.Symbol.Create("BAC", SecurityType.Equity, Market.USA)));
AddAlpha(new UninsuredDepositsAlphaModel());
SetPortfolioConstruction(new EqualWeightingPortfolioConstructionModel());
SetExecution(new ImmediateExecutionModel());
}
}
public class UninsuredDepositsAlphaModel : AlphaModel
{
private readonly Dictionary<Symbol, Symbol> _datasetSymbols = new();
private readonly Dictionary<Symbol, decimal> _previousShare = new();
public override IEnumerable<Insight> Update(QCAlgorithm algorithm, Slice data)
{
var insights = new List<Insight>();
foreach (var kvp in data.Get<FDICBankFinancials>())
{
var equity = kvp.Key.Underlying;
var records = kvp.Value.Data.OfType<FDICBankFinancial>().ToList();
var latest = records.Max(report => report.ReportDate);
var quarter = records.Where(report => report.ReportDate == latest).ToList();
var deposits = quarter.Sum(report => report.DomesticDeposits ?? 0m);
if (deposits == 0m)
{
continue;
}
var share = quarter.Sum(report => report.EstimatedUninsuredDeposits ?? 0m) / deposits;
// Emit an up insight while the share of uninsured deposits falls.
var rising = !_previousShare.TryGetValue(equity, out var previous) || share <= previous;
insights.Add(Insight.Price(equity, TimeSpan.FromDays(90), rising ? InsightDirection.Up : InsightDirection.Flat));
_previousShare[equity] = share;
}
return insights;
}
public override void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes)
{
foreach (var security in changes.AddedSecurities)
{
_datasetSymbols[security.Symbol] = algorithm.AddData<FDICBankFinancials>(security.Symbol).Symbol;
}
foreach (var security in changes.RemovedSecurities)
{
if (_datasetSymbols.Remove(security.Symbol, out var datasetSymbol))
{
algorithm.RemoveSecurity(datasetSymbol);
}
}
}
}
Data Point Attributes
The US Bank Financials dataset provides FDICBankFinancials, FDICBankReports, FDICBankFinancial, and FDICBankFinancialsUniverse objects.
FDICBankFinancials
FDICBankFinancials objects have the following attributes:
FDICBankReports
FDICBankReports objects have the following attributes:
FDICBankFinancial
FDICBankFinancial objects have the following attributes:
FDICBankFinancialsUniverse
FDICBankFinancialsUniverse objects have the following attributes: