Hi everyone, with the recent interest in U.S. senator insider trading, I open-sourced this repo for you to scrape and analyze the senators' stock transactions yourself: https://github.com/neelsomani/senator-filings
I provided a Jupyter notebook with my own simple analysis (limitations included in the README), but of course it can be modified to suit your needs. Let me know if you have any questions - happy to help!
I didn't use this tool, I instead used Senate Stock Watcher [0]. But a cursory review [1] of the trades made by senators showed the amounts to be very small (66% of trades were < 15k) and the typical Senator is a millionaire. In the 4 month period I analyzed, only 3 trades were between 250-500k.
I looked at performance as well, but its tough to benchmark these things. There were net outflows in the market during that period and if you sold you did relatively well in a falling market, so the typical trade did well. But the relatively small size of the trades makes me skeptical that insider information was used. Matt Levine said it best:
> Of course they could be lying, but in context the defense seems pretty plausible. (Kelly Loeffler, for instance, controversially dumped about 0.6% of her portfolio at around the same time, which sure seems like the sort of thing an investment adviser would do without any input from her? You could call your adviser and say “a disaster is coming, sell everything!,” but calling them to say “a disaster is coming, sell a tiny bit!” seems pointless.)
But this doesn't include William Barr as he is not a Senator.
That's neat idea, but I think the reporting lag is too long to action it. Would still be good for retroactive benchmarketing.
Also consider that extremely wealthy senators (many are) might only have a small part of their assets in stocks and could be part of a bigger financial strategy, as a hedge against other asset classes rather than an indicator of where they or their agent thinks the market will move.
I don't think so. Hardly anyone is that stupid nowadays that they would run their own assets against privileged information. Corruption, especially in western countries,tend to be a bit more sophisticated.A simplified example: Senator A figures out that stock value of company X will drop because of upcoming legislation. He contacts his college years friend,who happens to own a lot of this company's stocks. The friend sell on time just before stock price crashes amd nets millions. Now senator A wants something im return. So it happens that his daughter is finishing marketing studies and will be in need for a job. The friend places senator's daughter in one of his firms and now she's newly baked VP of Marketing.
This was a simplified example. In real life people usually have very complex social networks and it can very easily become Senator A - Senator B- Friend's friend- Neighbors daughter and etc.
It will force senators to need a partner in crime. Communication increases the likelihood of getting solid evidence of insider trading, and also gives another leverage point if the partner in crime can be pressured to produce evidence. The smart ones will still get away with it.
I was surprised to hear of blatant Covid-related insider trading by individuals in government, either some really are too stupid to know better or they feel impunity. I fear it's the latter.
I took a look at Alphavantage, but I wanted other data like daily transaction volume + market caps to do things like weighted regressions. The rate limiting was also a little restrictive.
It would be fun to compare the timeline of stock transactions by legislators with the timeline of public statements by those legislators and their colleagues pertaining to the companies’ stocks they’re selling, or those companies’ industries in general. Not that I expect such nakedly corrupt pumping and dumping or hyping... but I’ve been more surprised in the past.
Too bad they do not have to report their activity real-time, then the next step would be to create something like an "index fund" that simply mimics their choices.
Personally, my suggestion is that federal elected officials be required to put all their assets into a blind trust managed by some common third party (e.g., the CBO or a non-for-profit money manager). If public service is truly important to them, that shouldn't be a big barrier. We don't need people with a conflict of interest leading the nation.
Most of them do this. Like in the recent bashing of a bunch of senators for market insider trading a few of them had their money in blind trusts invalidating the criticism. One of them was Feinstein.
How would you deal with illiquid assets? I can't imagine a republican taking the business they spent their whole life building and putting it into a trust managed by government bureaucrats.
If they don't want to do that, they could always not become a politician? Maybe leave some space for people who aren't business owners, who are spectacularly over-represented?
I'm not seeing the bad part here. Every day there are people who sell off their business and go do something else. If an owner isn't ready for that, well, they can keep running the business. I also think it's fine if the trust doesn't really manage the business, but instead just sells it off and puts the money in stock and bond index funds.
And I think it's not just Republicans who would have to do some hard thinking here. Bloomberg is a Democrat, for example. Does he want to be president, or does he want to run Bloomberg? Both of those seem like plenty for one person to do. I think it's reasonable to say that if he wants to be our leading public servant for a number of years, he should sell off his business to people who have time to focus on it.
On the contrary! In some cases, individuals strive for elected/appointed office because there are clauses which allow for penalty-free exits from locked-up equity.
I realize this doesnt help for illiquid assets, but it does help for assets where you are locked into vesting schedules.
You realize that one unelected entity has control over all the retirement assets of 40% of America, right? I think if we can handle the Social Security Administration existing, we can handle somebody running a small fund for less than 600 people.
You know that the SSA does not manage any market invested assets, right?
When Social security taxes exceed payout (which they haven't since 2009), the income is used to finance deficit spending and the SSA is given a special federal bond.
Sure. But there's an enormous amount of money flowing there, far more than in a tiny investment fund, so it's still a potential vulnerability. The US Treasury and the US Federal Reserve do manage actual assets, and again at enormous scale.
There is a substantial delay between the time of the actual trades and their filing, so any edge they might have had is long gone by the time you have access to the data.
Probably not a very good one, somewhat surprisingly. I haven't run any analyses / haven't looked at this dataset in depth but from past forays into congressional datasets I don't really get what a lot of these people are doing. Usually you can throw a dart, check the financial portfolio, and see massive glaring problems immediately. Huge tilts into single / a handful of companies, totally outsized amounts of money in some random local small cap / mid cap, weird biases and tilts into commercial real estate (for example), you name it and you can see it. If anything I might investigate a counter-congress trading plan if you're looking for edge...
Actually, there have been studies done showing their trades beat the market! It is not possible to know their exact return but the studies I've read suggest they have alpha.
Looks like there might be a historical component around the STOCK act that different studies play with for their data window. In either case — I still say for the poor level of diversification within & around asset classes that I don’t see a lot of shining examples of how to achieve success.
> I still say for the poor level of diversification within & around asset classes that I don’t see a lot of shining examples of how to achieve success.
Wouldn't you expect a poor level of diversification in a stock portfolio based on corruption? They aren't dollar cost averaging and diversifying. They're doing the exact opposite to maximize the trade.
Kinda, I guess for a sophisticated “corruption portfolio” I would expect to see suspiciously timed trading but maybe more coherent core holdings. Just because you have inside info doesn’t mean you have a time machine, you still have to protect against unknowns.
Senate Stock Watcher is really cool. I chatted a bit with Tim Carambat (who built the site), and right now he's basically crowdsourcing the labeling for PDFs. Hoping that we can develop on this package and eliminate the manpower required for projects like Senate Stock Watcher.
There definitely is still a Yahoo Finance API for large corporate customers. That's where Apple's Stocks app gets its data, for example. I'm not sure about the third party services---they probably just scrape Yahoo's website and repackage the data.
Firstly, this doesn't scrape prices - they pay for a live feed direct from the market.
Secondly, it isn't legal. They are protected by license agreement.
But stock prices is not what the value of SNL Financial and/or Capital IQ is for most people. I know a bunch of people who pay the $30K license fee for these (as well as Bloomberg etc) who barely use the stock price at all.
Agreed - and she says it was her husband and not her. There needs to be a law that politicians are no longer single people but in fact come as a package - and politicians should have 0 expectation of privacy as they serve the public.
The argument that politicians should have the same expectation of privacy as regular citizens while also making their stock transparent is inherently contradictory. Regular citizens do not have to make their stock transactions public, but politicians should be required to.
I think it’s entirely reasonable for politicians to assume a life of less privacy since every aspect of their lives is scrutinized by the press anyway.
This whole debate stems from the fact that we have career politicians, which (at the federal level, at least) is not what the founders envisioned. A citizen legislature cannot, by definition, exist when it's filled by people who have never had a real job.
Term limits fixes this from both ends. Politicians are allowed their privacy, because they're just regular people and nobody is going to get rid from a single Senate term or 3-4 House terms. It eliminates the incentive to associate one's self more with DC than your home district. And it would probably result in people having a better opinion of Congress as a whole because it's not filled with people who have never done anything else.
It's a dynamic page, so I have to do things like mark checkboxes, click buttons, etc. But if there's a better way to do it, I'm down to incorporate it!
Usually for dynamic pages, it's still working off of some internal API. So when I search for first name starts with "a", it's sending a POST request to https://efdsearch.senate.gov/search/report/data/ with the following form data, which returns a nice JSON response.
Obviously you'd have to handle with correct headers and CSRF tokens, but it'll be easier than Selenium for sure.
I provided a Jupyter notebook with my own simple analysis (limitations included in the README), but of course it can be modified to suit your needs. Let me know if you have any questions - happy to help!