Was the treaty of versailles the main cause of political unrest in germany 1918-23?
The Treaty itself, no, but defeat, yes. The complete economic and social exhuastion of Germany added to the political instability with the abdication of the Kaiser and the crumbling of the traditional militaristic & authoritarian power structure caused a power vacuum which the nascent democratic parties were ill-equipped to fill. In addition there was violent political upheaval with the communists on one hand trying to gain power by revolutionary means, inspired by the revolution in Russia, and at the other political extreme, right-wing militarists angry at Germany’s capitulation and seeking to restore an authoritarian and militaristic form of government. Remember that unlike after WW2, Germany was not occupied by allied forces.