The Pactum Lotharii from 840 was a treaty between Venice and the Holy Roman Empire, which regulated the border and activities around the border.
The “Istoria Veneticorum” from around the year 1000, is the first work in the historiography of Venice.
The Venetian state was always an ad hoc construct, and institutions came and went at the convenience of the ruling elite.