At dinnertime in Brussels on Sunday, eurozone leaders gathered behind closed doors to determine whether to open negotiations on a third Greek bailout. After 17 hours of brutal, acrimonious talks (and, presumably, countless cups of coffee), they reached a deal. Sort of. If Greece passes a raft of new laws by Wednesday, and if Germany’s Parliament approves, Greece and its creditors will begin negotiating the specifics of a roughly €86 billion three-year loan—a process that could take months. Any eventual deal would require approval by eight national parliaments. Greece would get short-term financing to cover debt payments due in the meantime, and markets cheered the announcement, but we’d suggest tempering your enthusiasm. Monday’s agreement is a key step, but the hard part comes next, and the fragile agreement[i] could still collapse. Global risk remains minimal regardless of what shakes out, but we’d encourage all investors to keep their expectations in check.

Both sides compromised to reach the deal, though Greek Prime Minister Alexis Tsipras had to concede on most of the terms Greek voters rejected just one week ago—and accept a host of even harsher measures. In exchange for his capitulation, eurozone leaders agreed to discuss delaying repayment on Greece’s official sector bonds (debt owed to eurozone governments, the ECB and the IMF). Tsipras won another minor victory, getting leaders to reject a plan (floated by Germany) to funnel €50 billion of Greek assets into an offshore fund, administered by Brussels technocrats, which would oversee the privatizations and use all proceeds to repay Greece’s debts. The fund will still be created, but it will live in Greece, and they’ll be able to use €12.5 billion for fiscal stimulus. Eurozone leaders also pledged to invest up to €35 billion “to support growth and job creation in Greece” over the next three to five years.

But in return for those sweeteners, Greece must do many, many things as outlined in this official statement. First, Parliament must pass laws to streamline and raise VAT (value-added taxes), overhaul the pension system (presumably cutting benefits and raising the retirement age), ensure the national statistics agency’s independence (presumably to avoid a repeat of past instances where the agency fudged numbers to make it look like Greece was in ok shape fiscally), and implement a bunch of tax hikes and spending cuts to achieve budget surpluses. This step is due Wednesday. In other words, Greek lawmakers have about three days to write, debate and pass laws that would ordinarily take months of contentious back-and-forth. Getting this done will likely require Tsipras to rely on opposition support, as his coalition has a 24-seat majority—and over 30 of his Syriza lawmakers have denounced the terms. A big rebellion could force him to establish a unity government with pro-euro opposition parties and, ultimately, hold early elections.

Step two is due July 22, when Greece’s Parliament must approve an overhaul of the civil justice system and rewrite its bank resolution laws to match the EU’s common standards—basically adopting the restructuring and resolution process the ECB and eurozone leaders agreed to last year, which made Cyprus’s bank “bail-in” (which forced losses on uninsured deposits) standard operating procedures. Passing this would clear the way for negotiations to begin on a formal bailout program (or, in their lingo, Memorandum of Understanding), but it would probably also trigger the complete restructuring of Greece’s banking system. About €25 billion of bailout money will be earmarked for Greece’s banks, but many assume even that won’t be enough to prevent bail-ins. So Greek depositors still face big question marks, and capital controls probably remain in place for the foreseeable future.

The laws passed this week and next are only the tip of the iceberg—measures creditors demanded up front to “restore trust” after last weekend’s referendum. To actually seal the deal, Greece’s government must agree to:

Overhaul labor markets to “modernize” collective bargaining, industrial action and collective dismissals, aligning them “with international and European best practices”—and not returning “to past policy settings which are not compatible with the goals of promoting sustainable and inclusive growth”

Clean up the banks and improve governance of the bank stabilization fund

Shrink and streamline the public sector

Undo any measures passed by Syriza that unwound prior public sector cuts, “with the exception of the humanitarian crisis bill”

This list goes above and beyond the terms Tsipras conceded in his bailout request last week. It is an extraordinary capitulation by the man who once headed Greece’s Communist Party’s youth league, and it came after a “torturous” hours-long side meeting with German Chancellor Angela Merkel, French President François Hollande and European Council President Donald Tusk. Descriptions of those talks range from “crucifixion” to “extensive mental waterboarding,” which probably explains Tsipras’ hangdog expression afterward. Tsipras tried to sell the deal, saying he “prevented the financial asphyxiation and the collapse of the financial system, [which had been] planned to the last detail,” likely referring to a proposal, mooted by Germany’s Finance Ministry, for a five-year Greek timeout from the euro.[ii] However, he also admitted his victories were mostly symbolic: “We sent a message of democracy, a message of dignity throughout Europe and the world. This is the most important legacy.” And he closed his statement by warning of the tough fights ahead.

There are a lot of “ifs” between Greece and its bailout money. Even if they eventually finalize a Memorandum, unlocking aid will require regular check-ins with IMF, ECB and eurozone reps, who will demand tangible progress on everything above. Greece’s government—whether the current administration, a unity government or whoever wins the next election—must follow through and implement dozens of contentious, politically unpopular measures. Greece has passed reforms and cuts in the past yet failed to fully implement them, and it is hard to envision things going drastically different this time. It could happen! But we could also find ourselves here in a year or two with things not going to plan. We rather doubt this is the last round of Grexit brinksmanship.

As for what’s next, if Greece fails to pass the required laws on Wednesday, a default becomes more likely, but there is probably some wiggle room on this deadline. Heck, the deadline for this deal was technically Sunday, but they only met it if you were following the live blogs from Hawaii or Fiji.[iii] The 7/20 due date on for a €3.5 billion ECB bond payment is the real deadline, so if Greece doesn’t pass these laws until Thursday or Friday, that could be good enough for paymasters.

Regardless, the global risks here remain minimal. Markets proved over the last couple weeks that there is next to no risk of contagion. Greek bond yields and default insurance costs soared, but no one else’s did. Spanish, Italian, Portuguese and Irish markets stayed calm. World stocks proved resilient. Markets knew Greece was in trouble, but they also knew the trouble was confined and Greece on its own is too small to trigger a global recession. That will all still be true if Grexit risk pops up again, whether that happens two days or two years from now.

[i] Or, as European Council President Donald Tusk called it, the “a-Greek-ment.”

[ii] The plan, according to leaked drafts, would have also included outright debt relief, mountains of humanitarian financial aid and ECB support for Greece’s new currency. Some suggest this might have been a better long-term pathway for Greece rather than another can-kick, but we’ll never know now.