Payments in ransom and tribute to pirates amounted to 20% United States annual expenditures in 1800.
If you think the United States budget isn’t in great shape right now, it’s not much compared to what went on in 1800. Before the Declaration of Independence was signed in 1776, it was British treaties with North African states that protected American ships from pirates, specifically the Barbary corsairs.
Naturally, when the US declared its independence, the British protection ceased. In 1777, Morocco publicly recognized the United States as an independent nation, and started seizing American vessels (this is actually what created the United States Navy).
More Barbary states began seizing US ships, so the US managed to sign off on peace treaties that required them to pay tribute for protection. The protection fees plus the ransoms from various pirates made a 20% hole in the US expenditures by 1800. The First and Second Barbary Wars in 1801 and 1815 led to better peace terms, ending the tribute payment, but the Barbary states refused to implement this treaty until, surprisingly, the British made them do so in 1816.
The British brought the hammer down on Barbary pirates, but didn’t extend that to non African slavery, as many Americans and Europeans were still enslaved.