3 views
TauricResearch/TradingAgents
TradingAgents: Multi-Agents LLM Financial Trading Framework
Python★ 116,449+1,395 that day#2 on trending
B83.6/100
Duplication89
1.3% in python, dockerDead code98
0%Complexity67
29.3% The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
1.75%duplicated code · 183 of 10,484 lines
16clones in code
64code files of 185 scanned
1.26%duplicated over all files · 40 clones
Most complex files
- tests/test_memory_log.py171 cx
- cli/display.py125 cx
- tradingagents/llm_clients/chatgpt_auth.py118 cx
- tradingagents/memory/log.py101 cx
- cli/run.py93 cx
- tests/test_graph_end_to_end.py88 cx
- tests/test_chatgpt_auth.py80 cx
- cli/updates.py79 cx
- tradingagents/dataflows/vendors/reddit.py74 cx
- tradingagents/llm_clients/openai_client.py69 cx
Dead code 0% unused · 0 findings
No dead code found — everything here is reachable.
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code.
Largest clones in the code
- 30 lines in 2 placespython117 tokenstradingagents/agents/analysts/market_analyst.py:51–80tradingagents/agents/analysts/news_analyst.py:30–59
51 + """ Make sure to append a Markdown table at the end of the report to organize key points in the report, organized and easy to read.""" 52 + get_language_instruction() 53) 54 55prompt = ChatPromptTemplate.from_messages( 56 [ 57 ( 58 "system", 59 "You are a helpful AI assistant, collaborating with other assistants." 60 " Use the provided tools to progress towards answering the question."First 10 of 30 lines.
- 8 lines in 3 placespython57 tokenstradingagents/agents/tools.py:115–122tradingagents/agents/tools.py:134–141tradingagents/agents/tools.py:153–160
115def get_balance_sheet( 116 ticker: Annotated[str, InjectedState("company_of_interest")], 117 freq: Annotated[str, "reporting frequency: annual/quarterly"] = "quarterly", 118 curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"] = None, 119 trade_date: Annotated[str, InjectedState("trade_date")] = "", 120) -> str: 121 """ 122 Retrieve balance sheet data for the instrument under analysis.134def get_cashflow( 135 ticker: Annotated[str, InjectedState("company_of_interest")], 136 freq: Annotated[str, "reporting frequency: annual/quarterly"] = "quarterly", 137 curr_date: Annotated[str, "current date you are trading at, yyyy-mm-dd"] = None, 138 trade_date: Annotated[str, InjectedState("trade_date")] = "", 139) -> str: 140 """ 141 Retrieve cash flow statement data for the instrument under analysis. - 29 lines in 2 placespython113 tokenstradingagents/agents/analysts/fundamentals_analyst.py:32–60tradingagents/agents/analysts/market_analyst.py:52–80
32 + get_language_instruction() 33) 34 35prompt = ChatPromptTemplate.from_messages( 36 [ 37 ( 38 "system", 39 "You are a helpful AI assistant, collaborating with other assistants." 40 " Use the provided tools to progress towards answering the question." 41 " If you are unable to fully answer, that's OK; another assistant with different tools"First 10 of 29 lines.
7 more
- 6 lines in 3 placespython51 tokens
- 15 lines in 2 placespython87 tokens
- 15 lines in 2 placespython82 tokens
- 9 lines in 2 placespython69 tokens
- 10 lines in 2 placespython65 tokens
- 14 lines in 2 placespython59 tokens
- 7 lines in 2 placespython56 tokens
Largest clones over all files, tests and data included
- 8 lines in 3 placespythontests69 tokens
517with patch("yfinance.Ticker") as mock_ticker_cls: 518 def _make_ticker(sym): 519 m = MagicMock() 520 m.history.return_value = _price_df(spy_prices if sym == "SPY" else stock_prices) 521 return m 522 mock_ticker_cls.side_effect = _make_ticker 523 raw, alpha, days, resolved = settlement.fetch_returns("NVDA", "2026-01-05") 524assert raw is not None and alpha is not None and days is not None553with patch("yfinance.Ticker") as mock_ticker_cls: 554 def _make_ticker(sym): 555 m = MagicMock() 556 m.history.return_value = _price_df(spy_prices if sym == "SPY" else stock_prices) 557 return m 558 mock_ticker_cls.side_effect = _make_ticker 559 raw, alpha, days, resolved = settlement.fetch_returns("NVDA", "2026-01-05") 560assert raw is not None and alpha is not None - 10 lines in 2 placespythontests128 tokens
53}) 54 55with mock.patch.dict(os.environ, env, clear=False), \ 56 mock.patch.object(cli_selections, "DEFAULT_CONFIG", fake_cfg), \ 57 mock.patch.object(cli_selections.updates, "enabled", return_value=False), \ 58 mock.patch.object(cli_selections, "get_ticker", return_value="AAPL"), \ 59 mock.patch.object(cli_selections, "get_analysis_date", return_value="2026-05-29"), \ 60 mock.patch.object(cli_selections, "select_analysts", return_value=[]), \ 61 mock.patch.object(cli_selections, "select_research_depth", return_value=1), \ 62 mock.patch.object(cli_selections, "ensure_api_key") as ensure_key, \122fake_cfg.update({"openai_reasoning_effort": "high"}) 123 124with mock.patch.dict(os.environ, env, clear=False), \ 125 mock.patch.object(cli_selections, "DEFAULT_CONFIG", fake_cfg), \ 126 mock.patch.object(cli_selections.updates, "enabled", return_value=False), \ 127 mock.patch.object(cli_selections, "get_ticker", return_value="AAPL"), \ 128 mock.patch.object(cli_selections, "get_analysis_date", return_value="2026-05-29"), \ 129 mock.patch.object(cli_selections, "select_analysts", return_value=[]), \ 130 mock.patch.object(cli_selections, "select_research_depth", return_value=1), \ 131 mock.patch.object(cli_selections, "ensure_api_key"), \ - 30 lines in 2 placespython117 tokenstradingagents/agents/analysts/market_analyst.py:51–80tradingagents/agents/analysts/news_analyst.py:30–59
51 + """ Make sure to append a Markdown table at the end of the report to organize key points in the report, organized and easy to read.""" 52 + get_language_instruction() 53) 54 55prompt = ChatPromptTemplate.from_messages( 56 [ 57 ( 58 "system", 59 "You are a helpful AI assistant, collaborating with other assistants." 60 " Use the provided tools to progress towards answering the question."First 10 of 30 lines.
- 8 lines in 3 placespython57 tokens
- 29 lines in 2 placespython113 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 64 | 10,484 | 16 | 183 | 1.75% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 170 | 28,241 | 40 | 378 | 1.34% |
| markdown | 2 | 1,155 | 0 | 0 | 0% |
| yaml | 7 | 305 | 0 | 0 | 0% |
| toml | 1 | 89 | 0 | 0 | 0% |
| markup | 1 | 67 | 0 | 0 | 0% |
| bash | 1 | 39 | 0 | 0 | 0% |
| docker | 1 | 30 | 0 | 0 | 0% |
| text | 1 | 9 | 0 | 0 | 0% |
| txt | 1 | 7 | 0 | 0 | 0% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 27, 2026 | #2 | 116,449 (+1,395) | 185 | 29,942 | 40 | 1.26% | 1.75% | B 83.6 | e8f5503 |
| Oct 26, 2026 | #3 | 114,871 (+381) | 185 | 29,942 | 40 | 1.26% | 1.75% | B 83.6 | e8f5503 |
| Sep 15, 2026 | #9 | 106,305 (+745) | 157 | 20,349 | 20 | 1.19% | 1.34% | — | be952b8 |
| Sep 10, 2026 | #6 | 104,143 (+367) | 157 | 20,349 | 20 | 1.19% | 1.34% | — | be952b8 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.