Travel and ransom insurance scheme
The term Sklavenkasse (slave fund) was a travel and ransom insurance scheme designated to pay ransom for European seafarers who had been captured by Barbary Pirates in the Mediterranean and off the coasts of Western Europe and sold into the Barbary slave trade. Several North German free imperial cities set up their own slave funds which existed until the mid 19th century.
The earliest slave funds were created in the 17th century by members of the Hanseatic League. 
In 1725, seafarers and shipowners in neighbouring Denmark-Norway had to make compulsory contributions to a ransom insurance.
The individual premiums were based on the seamen's rank and income.
Hamburg Slave Fund.
The Free City of Hamburg's slave fund was created in 1624 by the Hamburg Admiralty, Hamburg's former harbour authority. The scheme was financed by all seamen embarking in Hamburg who, depending on their rank, had to pay a certain amount of their wages into the scheme. The assets of the Hamburg slave fund were supplemented by regular collections in the city's churches and also relied on private donations.
The idea for the Hamburg slave fund was based on an insurance scheme of the same kind set up in Hamburg two years prior, but only for naval officers. Since the premiums were unaffordable for lower-rank crewmen, the general slave fund soon followed with premiums relative to rank and income, which constituted an early form of social insurance.
Between 1719 and 1747 alone, the fund paid 1.8 million "Mark Banco" for the release of a total of 633 seamen, with one Mark Banco being defined as of silver. This translates into an average price of silver per enslaved Hamburg seaman.
Lübeck Slave Fund.
The Lübeck slave fund was established by the city council in 1627. It began operations on May 8, 1629, and existed until the mid 19th century. With the decline of Lübeck's direct shipping connections to the Mediterranean sea, the city's slave fund was highly liquid from the 18th century onwards.
The last ransom payment was made in 1805, while its remaining assets afterwards were used to pay the Sound Dues (1857) and to fund the city's customs authority. Lübeck's slave fund was finally dissolved on July 24, 1861, when the city became part of the German Customs Union.