In 1987, Jordan Belfort (Leonardo DiCaprio) procures a job as a Wall Street stockbroker for L.F. Rothschild, employed under Mark Hanna (Matthew McConaughey), who quickly entices him with the sex and drugs-fueled stockbroker culture and teaches him that a stockbroker's only job is to make money for himself. Jordan soon finds his career terminated following Black Monday, and takes a job at a boiler room brokerage firm on Long Island that specializes in penny stocks. Thanks to his aggressive pitching style and the high commissions, Jordan makes a small fortune.
Jordan befriends his apartment neighbor Donnie Azoff (Jonah Hill), and the two found their own company. They recruit several of Jordan's friends, whom Jordan trains in the art of the "hard sell". The basic method of the firm is a pump and dump scam. To cloak this, Jordan gives the firm the respectable name of "Stratton Oakmont". After an expos  in Forbes, hundreds of ambitious young financiers flock to his company. Jordan becomes immensely successful, and slides into a decadent lifestyle of prostitutes and drugs. He has an affair with a woman named Naomi Lapaglia (Margot Robbie). When his wife Teresa (Cristin Milioti) finds out, they divorce and he marries Naomi, soon having a daughter, Skylar. Meanwhile, the U.S. Securities and Exchange Commission and the FBI begin investigating Stratton Oakmont. Jordan illegally makes $22 million in three hours upon securing the IPO of Steve Madden (Jake Hoffman). This brings him and his firm to the attention of the FBI, mainly agent Patrick Denham (Kyle Chandler). To hide his illegitimate money, Jordan opens a Swiss bank account with corrupt banker Jean-Jacques Saurel (Jean Dujardin) in the name of Naomi's aunt Emma (Joanna Lumley), who is a British national and thus outside the reach of American authorities. He uses the wife and in-laws of his friend Brad Bodnick (Jon Bernthal), who have European passports, to smuggle the cash into Switzerland.
Donnie gets into a public brawl with Brad, and while Donnie escapes, Brad is arrested. Jordan also learns from his private investigator (Bo Dietl) that the FBI is wiretapping his phones. Fearing for his son, Jordan's father (Rob Reiner) advises him to leave Stratton Oakmont and lie low while Jordan's lawyer (Jon Favreau) negotiates a deal to keep him out of prison. Jordan, however, cannot bear to quit, and talks himself into staying in the middle of his farewell speech. Jordan, Donnie and their wives are on a yacht trip to Italy when they learn that Aunt Emma has died of a heart attack. Jordan decides to travel to Switzerland immediately to settle the bank account. In order to bypass border controls, he forces his yacht captain to sail to Monaco, and the ship is capsized in a storm. After their rescue, the plane sent to take them to Geneva is destroyed when a seagull flies into the engine. Jordan takes this as a sign from God and decides to sober up.
Two years later, the FBI arrests Jordan because Saurel, arrested in Florida on an unrelated charge, has informed on Jordan. Since the evidence against him is overwhelming, Jordan agrees to gather evidence on his colleagues in exchange for leniency. Fed up with Jordan's lifestyle, Naomi tells Jordan she is divorcing him and wants full custody of their children. Jordan loses his mind and tries to run off with Skylar in his car, but ends up crashing it in the driveway. The next morning, Jordan wears a wire to work. Jordan slips Donnie a note warning him about the wire. The FBI discovers the note, and Jordan is arrested for breaching his cooperation deal. The FBI raids and shuts down Stratton Oakmont. Despite this one breach, Jordan receives a reduced sentence for his testimony and serves three years in a minimum security prison. After his release, Jordan makes a living hosting seminars on sales technique.
Output: What had happened that led to Jordan and Teresa getting a divorce?