At the same time, Robert Mercer promoted a tougher national stand on immigration by funding politicians and organizations — including Breitbart News — that have fueled hysteria about immigrants by claiming that their entry into the U.S. would directly lead to crime, terrorism and job losses. And after the election, Rebekah Mercer won a spot on the executive committee of Trump’s transition team — and reportedly pushed for hiring Sessions as attorney general.

Since Trump’s election, the policies the Mercers had promoted have taken off — and paid off, according to an investigation by Yahoo News supported by the nonprofit Project on Government Oversight. With Trump ratcheting up anti-immigrant rhetoric and enforcement, Renaissance Technologies — where Mercer was co-CEO until last fall and where he continues to be active — invested in corporations directly involved in the president’s immigration crackdown and the administration’s embrace of private prisons.

These include CoreCivic and GEO Group, the two biggest Department of Homeland Security contractors operating immigrant detention centers. In the last two years, Renaissance has purchased millions of dollars worth of shares in CoreCivic and GEO Group, which have seen their stock prices soar.

Meanwhile, a number of recipients of the Mercer family’s largesse stoked the flames of the immigration Fear Factory. They included nonprofits like Secure America Now, which received $2 million from Robert Mercer and which produced videos released in the last weeks before the election, warning that Muslims were poised to take over the United States, France and Germany.

The general furor about immigration to which these ads contributed appears to have significantly increased the value of some Renaissance investments. Most recently, Trump has spread fear over Central Americans seeking asylum, deployed thousands of troops to the border, and floated a proposal to ignore birthright citizenship — a right contained in the Constitution — with a potentially unlawful executive order.

Renaissance is a so-called “quant” hedge fund and says that it makes investment decisions based on complicated mathematical algorithms. Quant investment strategies “use technology and formulas to automate the investment process,” is how Bloomberg put it in a recent story and guide to the practice, which highlighted Renaissance as one of the earliest and most successful hedge funds utilizing quant.

But that doesn’t mean that quant investing is pure math. A 2014 Senate reportstates that these trading algorithms are “frequently modified manually by programmers” to “direct trades” or change “portfolio size.” And a joint statement submitted to the Senate by three Renaissance executives, including Peter Brown, co-CEO and co-president, said that in making its investment decisions the fund collected all publicly available data it believed “might bear on the movement of prices of tradable instruments,” which included news stories, energy reports and regulatory findings.

Two hedge fund experts told me that quant investing is heavily influenced by political analysis and bets. “Sure, everything is a math equation, but human beings make the equations and decide what the inputs are,” said one, who still works in the hedge fund industry and is very familiar with Renaissance. “Some of the inputs are going to be related to likely policy developments and their political impact. That may get reduced to a number or numbers that are plugged into the equation, but politics is part of the algorithm.”

Renaissance and Robert Mercer declined to comment for this story. Rebekah Mercer did not respond to requests for comment sent to the press office at the Heritage Foundation, where she is a trustee, or to her email sent to Ruby et Violette, a cookie bakery in New York City she co-owned with her two sisters that recently closed.

From the outside, Renaissance’s investments in private prison and detention camp operators look to be based on more than just complicated math, but also on knowledge of Trump’s plans and the ability to influence them. And there is nothing illegal about it.

The Mercers had unique insight into and influence on the new administration’s hard-line approach to crime and immigration. The Huffington Post reported that Rebekah Mercer convinced Trump to hire Steve Bannon, then Breitbart’sexecutive chairman, as his campaign manager and Kellyanne Conway, who previously ran a pro-Ted Cruz Super PAC funded by the Mercers, as his pollster.

Thanks to the Supreme Court’s Citizens United decision, which greenlighted dark money, and the nation’s fractured and polarized political and news landscape, the Mercers and other well-connected billionaire donors have an easier time than ever promoting policies that serve both their ideological and financial interests.

“Unfortunately, wealthy individuals pushing candidates who promote policies that advance their financial goals is not uncommon or illegal,” said Walter Shaub, the former head of the Office of Government Ethics and now senior adviser to the D.C. watchdog group Citizens for Responsibility and Ethics in Washington. “It’s sort of legalized corruption and a general problem of our campaign finance system.”

The White House did not reply to a request for comment.