Sen. Ted Cruz wants refiners and corn farmers to stand together to overhaul the nation's ethanol mandate by pitting them against Wall Street speculators who he said are getting rich off the program that is killing jobs.

“The ones that would be put out of business are the speculators, who can go and speculate on something else,” the Texas Republican said at a Wednesday rally in Philadelphia, at the largest refinery on the East Coast.

The Philadelphia Energy Solutions refinery filed for bankruptcy protection recently, blaming the Environmental Protection Agency's Renewable Fuel Standard for the financial lapse.

The RFS requires refiners to blend corn ethanol at enormous cost, because of the millions of dollars they must pay for renewable identification number credits, or RINs, which Cruz called a unfair "tax" on the American refinery worker.

Cruz said the system is not the fault of the corn farmer who produces the commodity to make ethanol. Nor is it the fault of the refinery industry, which must comply with the program by purchasing RINs.

Instead, he blamed traders who have artificially driven up the cost of RINs by speculating on the certificates as another commodity to be bought, sold and traded.

"Here's the crazy thing," Cruz said. "Of that $218 million you all paid for RINs, you know how much of that ended up in the pockets of Iowa corn farmers? None. The money doesn't go to the corn farmer, and it doesn't go to the ethanol producer. Instead, billions are being made by Wall Street speculators and giant integrated companies that are earning a windfall on this broken regulatory system."

Cruz said he is not calling for "altering the heart of the RFS," but to fix the "broken RIN system," which is not doing what it was intended to do, but instead is driving up costs for refineries that support tens of thousands of jobs in communities such as Philadelphia.

The RIN system was expected to be a nominal cost for refineries, costing them pennies for each one. But the trading system for the credits has driven them up to nearly $1.50 per RIN, which he said is unsustainable.

One credit equals a gallon of corn ethanol. The RFS requires about 16 billion gallons of corn ethanol to be blended into the gasoline supply, which has meant hundreds of millions of dollars in additional regulatory costs for the industry. The Philadelphia Energy Solutions refinery filed for Chapter 11 after racking up more than $200 million in RIN costs last year.

All of that cost is for a program “that doesn’t produce a damn thing,” he said. The cost was “more than double the payroll” of the refinery, Cruz said.

Cruz led a group of 10 senators in December to meet with President Trump and senior White House aides on finding a way to fix the RIN system.

Cruz said Trump directed the EPA and the Agriculture Department to sit down with him and the senators to find a regulatory fix. Cruz told the workers at Wednesday's rally that the agencies are close to finding a "win-win solution" for the program.

He noted it's been difficult to bring senators representing big corn states to the table. He blamed that on an entrenched "big ethanol" lobby that wants to maintain the status quo.

Capping the price of RINs at 10 cents is being considered by the administration, Cruz said. That would be done “in exchange for removing EPA barriers” to allow more ethanol to be blended and sold, which would benefit corn farmers.

“I hope that’s what the president and the administration ultimately decide to do,” Cruz said.

Meanwhile, Senate Majority Whip Sen. John Cornyn of Texas, one of the 10 senators in Cruz's group, is developing a longer-term fix through an RFS overhaul bill. Industry sources and lobbyists say the bill would phase out the program in four years.