The Obama administration believes congressional leaders must agree to a deficit-reduction deal by July 22 in order to raise the government’s borrowing limit in time to avoid a default in early August, according to Democratic officials with knowledge of the negotiations.

The government needs a week or two to write and pass the necessary legislation and take the steps necessary to avoid missing a payment. “We’re down to the wire,” one official said.

President Barack Obama and Senate leaders have agreed on the outline of an agreement to cut federal spending by about $1 trillion over at least 10 years, but are deadlocked over whether to include some tax increases, as Democrats insist, or take them off the table, as Republicans want. The Senate agreed Thursday to cancel its planned recess next week to stay in town in pursuit of an agreement. Still, many disagree about what would happen if they don’t reach a deal, and it is hard to know for certain because the federal government hasn’t defaulted in modern times.