Resulting from the Battle of Poltava and the death of Charles XII, FTP, name this 1721 treaty that ended the Great Northern War.
Leading directly to the construction of the Marly Palace, this treaty became inevitable with the capture of Stettin and the signing of the Treaty of Frederiksborg by some of the lesser combatants in the war that it ended.  Negotiated on the losing side by Ulrica Leonora and her husband Frederick I, it included the transfer of Ingermanland, part of Karelia, and all of Livonia to Peter the Great.  Resulting from the Battle of Poltava and the death of Charles XII, FTP, name this 1721 treaty that ended the Great Northern War.
Leading directly to the construction of the Marly Palace, this treaty became inevitable with the capture of Stettin and the signing of the Treaty of Frederiksborg by some of the lesser combatants in the war that it ended.  
Treaty of Nystad