question: When was the peace treaty signed based on which Teutonic Knights suffered only minimal territorial losses?
answer: 1 February 1411
context: Title: Polish–Lithuanian–Teutonic War
  Passage: The Polish–Lithuanian–Teutonic War or Great War occurred between 1409 and 1411, pitting the allied Kingdom of Poland and Grand Duchy of Lithuania against the Teutonic Knights.  Inspired by the local Samogitian uprising, the war began by Teutonic invasion of Poland in August 1409.  As neither side was ready for a full-scale war, Wenceslaus IV of Bohemia brokered a nine-month truce.  After the truce expired in June 1410, the military-religious monks were decisively defeated in the Battle of Grunwald (Tannenberg), one of the largest battles in medieval Europe.  Most of the Teutonic leadership was killed or taken prisoner.  While defeated, the Teutonic Knights withstood the siege on their capital in Marienburg (Malbork) and suffered only minimal territorial losses in the Peace of Thorn (1411).  Territorial disputes lasted until the Peace of Melno of 1422.  However, the Knights never recovered their former power and the financial burden of war reparations caused internal conflicts and economic decline in their lands.  The war shifted the balance of power in Eastern Europe and marked the rise of the Polish–Lithuanian union as the dominant power in the region.
  Title: Treaty of Salynas
  Passage: Treaty of Salynas (German: "Frieden von Sallinwerder" , Lithuanian: "Salyno sutartis" ) was a peace treaty signed on 12 October 1398 by the Grand Duke of Lithuania Vytautas the Great and the Grand Master of the Teutonic Knights Konrad von Jungingen.  It was signed on an islet of the Neman River, probably between Kulautuva and the mouth of the Nevėžis River.  It was the third time, after the Treaty of Königsberg (1384) and Treaty of Lyck (1390), that Vytautas promised Samogitia to the Knights.  The territory was important to the Knights as it physically separated the Teutonic Knights in Prussia from its branch in Livonia.  It was the first time that the Knights and Vytautas attempted to enforce the cession of Samogitia.  However, it did not solve the territorial disputes over Samogitia and they dragged on until the Treaty of Melno in 1422.
  Title: Peace of Thorn (1411)
  Passage: The (First) Peace of Thorn was a peace treaty formally ending the Polish–Lithuanian–Teutonic War between allied Kingdom of Poland and Grand Duchy of Lithuania on one side, and the Teutonic Knights on the other.  It was signed on 1 February 1411 in Thorn (Toruń), one of the southernmost cities of the Monastic State of the Teutonic Knights.  In historiography, the treaty is often portrayed as a diplomatic failure of Poland–Lithuania as they failed to capitalize on the decisive defeat of the Knights in the Battle of Grunwald in June 1410.  The Knights returned Dobrzyń Land which they captured from Poland during the war and made only temporary territorial concessions in Samogitia, which returned to Lithuania only for the lifetimes of Polish King Władysław Jagiełło and Lithuanian Grand Duke Vytautas.  The Peace of Thorn was not stable.  It took two other brief wars, the Hunger War in 1414 and Gollub War in 1422, to sign the Treaty of Melno that solved the territorial disputes.  However, large war reparations were a significant financial burden on the Knights, causing internal unrest and economic decline.  The Teutonic Knights never recovered their former might.
citations: Polish–Lithuanian–Teutonic War Peace of Thorn (1411)