Trump often tweets about OPEC and oil prices.

He is scrambling to tame the oil rally before midterms.

But analysts say it's his own policies that are pushing prices up.

President Trump spent part of his July 4 holiday shouting at OPEC on twitter, demanding lower gasoline prices.

The tweets are coming more frequently these days, an indication of the political peril that Trump feels because of rising gasoline prices. The logic is odd though. Trump wants lower oil prices while at the same time his administration is trying to zero out 2.5 million barrels per day of Iranian oil exports.

“It does not occur to the U.S. president that it is Trump himself who is driving prices up through his Iran policy,” Commerzbank wrote in a note. If the U.S. succeeds in blocking Iran from exporting its oil, OPEC would struggle to offset the missing barrels. “Perhaps one of the U.S. president’s advisors should explain this to him,” Commerzbank added.

Trump’s advisers are clearly failing at their task, but Iranian officials tried to lend a helping hand by explaining the situation. “You impose sanctions on major producers, founders of OPEC, and yet you are asking them to reduce the prices?! Since when did you start ordering OPEC!” Iran’s OPEC governor Hossein Kazempour Ardebili said in a statement. “Your tweets have driven the prices up by at least $10/b. Pls stop it, otherwise it will go even higher!”

Meanwhile, the U.S. Congress has revived legislation that would remove the immunity that sovereign nations have from being sued from antitrust violations. The so-called “NO PEC Act” would make OPEC subject to antitrust law, allowing the U.S. to go after OPEC for manipulating the oil market. The legislation has floated around Washington for years, typically going nowhere because past presidents have consistently opposed the measure.