Skip to content

Latest commit

 

History

History
327 lines (241 loc) · 7.72 KB

File metadata and controls

327 lines (241 loc) · 7.72 KB

Chase Integration Testing Guide

🚀 Quick Start

Step 1: Add Chase Credentials to .env

Open your .env file and add:

# Chase Trading Account Credentials
CHASE_USERNAME=your_chase_username
CHASE_PASSWORD=your_chase_password

⚠️ IMPORTANT:

  • Never commit .env file to git
  • Keep credentials secure
  • Use your Chase.com login credentials

Step 2: Run the Test

python test_chase_integration.py

What will happen:

  1. ✅ Script will authenticate with Chase
  2. 🌐 A browser window will open (Chromium)
  3. 📱 You may need to complete MFA (text/email code)
  4. 📊 Script will fetch your portfolio holdings
  5. 💰 Script will fetch real-time quotes
  6. 💾 Results will be saved to JSON files

📋 What to Expect

Browser Window

  • A Chromium browser window will open
  • You'll see the Chase login page
  • The browser must stay open during the session
  • DO NOT close the browser manually

MFA (Multi-Factor Authentication)

If Chase prompts for MFA:

  1. Check your phone for text message
  2. Check your email for code
  3. Enter the code in the browser
  4. Script will continue automatically

Console Output

You'll see detailed output like:

================================================================================
CHASE INTEGRATION TEST
================================================================================

✓ Username: your_username
✓ Password: **********

--------------------------------------------------------------------------------
STEP 1: Authenticating with Chase...
--------------------------------------------------------------------------------

⚠️  A browser window will open for authentication
⚠️  You may need to complete MFA (text/email code)
⚠️  The browser must stay open during the session

✅ Authentication successful!

--------------------------------------------------------------------------------
STEP 2: Fetching Portfolio Holdings...
--------------------------------------------------------------------------------

✓ Found 1 account(s)

================================================================================
ACCOUNT 1: Individual Brokerage
================================================================================
  Account ID: 123456789
  Type: BROKERAGE

  Holdings (3 positions):
  ----------------------------------------------------------------------------

  📊 NVDA - NVIDIA CORP
     Type: EQUITY
     Quantity: 201
     Market Value: $35,175.00

  📊 AAPL - APPLE INC
     Type: EQUITY
     Quantity: 50
     Market Value: $8,750.00

  📊 NVDA250117C00175000 - NVIDIA CALL OPTION
     Type: OPTION
     Quantity: 2
     Market Value: $550.00

================================================================================
TOTAL HOLDINGS: 3 positions across 1 account(s)
================================================================================

--------------------------------------------------------------------------------
STEP 3: Fetching Real-Time Quotes...
--------------------------------------------------------------------------------

Fetching quote for NVDA...
  ✓ NVDA:
    Last: $175.00
    Bid: $174.95
    Ask: $175.05
    Volume: 45,234,567

...

================================================================================
TEST COMPLETE!
================================================================================

✅ Successfully authenticated with Chase
✅ Fetched 3 positions
✅ Fetched 3 quotes

📁 Results saved to:
   - chase_holdings_20251012_105324.json
   - chase_quotes_20251012_105324.json

🎯 Next Steps:
   1. Review the saved JSON files
   2. Check if options positions are included
   3. Verify pricing data accuracy
   4. Integrate with recommendation engine

================================================================================

📁 Output Files

chase_holdings_TIMESTAMP.json

Contains your portfolio positions:

[
  {
    "account_id": "123456789",
    "account_name": "Individual Brokerage",
    "symbol": "NVDA",
    "name": "NVIDIA CORP",
    "quantity": 201,
    "asset_type": "EQUITY",
    "market_value": 35175.00,
    "raw_data": { ... }
  },
  {
    "account_id": "123456789",
    "account_name": "Individual Brokerage",
    "symbol": "NVDA250117C00175000",
    "name": "NVIDIA CALL OPTION",
    "quantity": 2,
    "asset_type": "OPTION",
    "market_value": 550.00,
    "raw_data": { ... }
  }
]

chase_quotes_TIMESTAMP.json

Contains real-time pricing:

{
  "NVDA": {
    "lastPrice": 175.00,
    "bid": 174.95,
    "ask": 175.05,
    "volume": 45234567,
    "change": 2.50,
    "changePercent": 1.45
  }
}

🔍 What We're Testing

  1. Authentication: Can we log in to Chase?
  2. Portfolio Access: Can we fetch your positions?
  3. Options Support: Are options included in holdings?
  4. Pricing Data: Can we get real-time quotes?
  5. Data Quality: Is the data accurate and complete?

⚠️ Troubleshooting

Issue: Browser doesn't open

Solution:

# Reinstall Playwright browsers
python -m playwright install chromium

Issue: Authentication fails

Possible causes:

  • Wrong username/password
  • MFA not completed
  • Chase blocking automated access
  • Browser closed too early

Solution:

  • Double-check credentials in .env
  • Complete MFA when prompted
  • Keep browser open
  • Try again in a few minutes

Issue: No holdings found

Possible causes:

  • Account has no positions
  • Wrong account type
  • API doesn't support this account

Solution:

  • Check your Chase account online
  • Verify you have positions
  • Check account type (must be brokerage)

Issue: Options not showing

Expected: chaseinvest-api doesn't fully support options yet (it's in their TODO)

Workaround:

  • We'll see what data is available
  • May need to use yfinance for options pricing
  • Can still sync stock positions from Chase

Issue: Rate limiting

Solution:

  • Script limits to 5 quotes at a time
  • Wait a few minutes between runs
  • Don't run too frequently

🎯 Success Criteria

Test is successful if:

  1. Authentication works (browser opens, login succeeds)
  2. Holdings are fetched (at least your stock positions)
  3. Quotes are retrieved (real-time pricing)
  4. JSON files are created with valid data

⚠️ Partial success if:

  1. Authentication works but options not included
  2. Holdings fetched but some quotes fail
  3. Data is incomplete but usable

Test fails if:

  1. Cannot authenticate
  2. No holdings retrieved
  3. Browser crashes
  4. Errors prevent completion

📊 After Testing

Review the Data

  1. Open the JSON files
  2. Check if your positions match Chase.com
  3. Verify pricing is accurate
  4. Note any missing data (especially options)

Share Results

Let me know:

  • ✅ Did authentication work?
  • ✅ Were all positions fetched?
  • ✅ Are options included?
  • ✅ Is pricing accurate?
  • ❌ Any errors or issues?

Next Steps

Based on results, we'll:

  1. If successful: Build the Chase integration service
  2. If partial: Work around limitations (e.g., use yfinance for options)
  3. If failed: Troubleshoot or consider alternative approaches

🔐 Security Notes

  • Credentials: Stored only in .env file (not committed to git)
  • Session: Browser session is temporary (closes after script)
  • Data: Saved locally, never sent to third parties
  • API: Unofficial API, use at your own risk

📚 Resources


Ready to test? Run the script and let me know what happens! 🚀