MANAGUA, NICARAGUA, JULY 19 -- President Daniel Ortega said today that the Iran-contra hearings have demonstrated President Reagan's "ability to make his subordinates take the blame for his errors."

Nicaragua's leftist president, in a speech marking the eighth anniversary of the Sandinista revolution, said the hearings demonstrated the "immorality, hypocrisy and decomposition of the so-called American democracy." If Reagan did not know the details of the diversion of funds to the contras, Ortega charged, he was incompetent.

Ortega's comments seemed to reflect frustration that the Iran-contra affair so far has not moved Washington away from supporting the rebels, known as counterrevolutionaries or contras. He addressed tens of thousands of sympathizers at a subdued rally in the city of Matagalpa, 85 miles north of the capital, the heart of a war zone.

Reiterating the theme of many earlier speeches, Ortega warned that the risk of a U.S. military invasion of Nicaragua is not diminished by the recent scandal.

In a summary of the crippling damage done to Nicaragua's economy in six years of warfare, Ortega said so far this year more than 6,000 Nicaraguans have died in the fighting. Military spending will eat up 46 percent of the 1987 budget and about a third of total production. Export income will be $300 million or less for the third year in a row, Ortega estimated.

By contrast, in 1982, the first year of the war, 864 Nicaraguans died while defense accounted for 19 percent of government spending and exports were $406 million.

The war inflicted $1.2 billion in material losses and $1.6 billion in lost production on Nicaragua, Ortega said.

Foreign aid totaled $3.7 billion since 1979, he said. He did not specify if this figure included Soviet weapons deliveries valued by the Pentagon at several billion dollars.

Ortega lashed out at unnamed foreign countries for failing to aid Nicaragua and called for an "emergency response" from international donors.

Present at the ceremony were only six of the nine top Sandinista commanders. Assembly leader Carlos Nunez, Defense Minister Humberto Ortega and Deputy Interior Minister Luis Carrion stayed away as a security precaution.

The only foreign dignitary was Oliver Tambo, leader of South Africa's African National Congress. Tambo, who was given a medal, said South Africans and Nicaraguans "face the same enemy, imperialism."

American singer and songwriter Kris Kristofferson sang a song praising the Sandinistas.