The alliance between Marvel and Sony to bring Spider-Man into the Marvel Cinematic Universe, starting with last year’s “Captain America: Civil War” and continuing with next week’s “Spider-Man: Homecoming,” is certainly great for fans. However, the boring truth is that there is plenty of big money at stake for both studios, who definitely want to see their collaboration succeed creatively, but also commercially. The big question has been how they will be slicing the Spider-Man pie, and now some light has been shed on the deal that brought the two studios together.

READ MORE: What Will Be The Biggest Box Office Blockbuster Of 2017?

The Wall Street Journal reports that Sony paid the $175 million pricetag for the movie, while Marvel and Disney essentially handled the logistics and creative angle (though, their partners at Sony still had the final say). Sony will get to keep the box office receipts, while Marvel gets to hang onto money made from merchandising. That’s the simple version. Adding some slight complications is an earlier deal, where Disney and Marvel agreed to give up any film revenue, in exchange for a lump sum payment along with a $35 million fee paid to Sony each time they made a Spider-Man movie. However, that $35 million will be reduced if ‘Homecoming’ hits $750 million worldwide.

All of this is enough to make an accountant’s head spin, but the bottom line is that if ‘Homecoming’ is a huge hit, everybody wins. Fans get to see Spider-Man rolling with his other comic book pals for the first time, Sony has a successful new franchise, and Marvel will reap the rewards of what they hope will be a spike in sales for Spider-Man swag. However, if the film doesn’t perform as expected, it’ll be interesting to see if the two studios stay so friendly.

“Spider-Man: Homecoming” opens on July 7th.