After it was revealed that Bob Lee — the tragically murdered founder of Cash App — reportedly indulged in “underground sex [and] drug parties,” sources said that he was just one of many Silicon Valley types to take part in a free-wheeling swingers’ scene.

Sources claim that the so-called “Lifestyle” — which is built around sexual openness, experimentation with drugs and a general sense of promiscuous behavior — is not uncommon among a certain sector of tech executives and entrepreneurs in the Bay Area.

One Silicon Valley insider recalled attending a regular sex bash popular with the high-tech crowd. Held in what seemed like a typical Bay Area warehouse, what went on there was anything but typical.

“On an upper level was a play space with mattresses inside and towels outside,” the insider told The Post. “It was like going to a tech party, except that everyone took off their clothes and went upstairs for sex.” 

The insider explained that, for at least some in attendance, it’s a whole new world.

“There is a viewpoint that the geeks who had turned into millionaires now have something open to them [opportunities for sex and drugs] in a way that it had not been before,” said the insider. “A lot of these folks were nerds.”

Now, the insider added, the onetime nerds are “rock stars” in their industry: “When there is money and access and power, it all goes together.”

In her book, “Brotopia: Breaking Up the Boys’ Club of Silicon Valley,” Emily Chang writes about a circuit of drug and sex parties that draw the high tech elite — founders and first-round investors — to mansions and chateaus for bacchanal-worthy activities.

She describes bigshots bragging “about how they’re overturning traditional paradigms in their private lives, just as they do in the technology world they rule.”

Chang’s book reveals that the frisky activities usually begin with cuddle puddles — groups of people laying around in tight proximity to one another, often with their inhibitions loosened by Molly. Eventually, she writes, people break up into groups of two or three to take the activities further in private rooms.

Other parties are not so discreet.

“There is a public exhibition side of it,” Josh Powers, who runs a San Francisco fetish club called Power Exchange, told The Post. “Attendees may go there with another person and have other people watch them. There is a correlation between our true players and tech pushing out the culture in San Francisco. We attract people from the tech world.”

Powers said that some parties aimed at picky techies vet the people who are allowed to attend and participate: “Many of them will have you submit pictures showing what you look like and who you are. Some are status-based, aimed at high-level individuals.”

One of the top sex gatherings for those in the tech field is a recurring swingers-scene event known as the Bronze Party — which includes among its rules that voyeurs should only whisper or “not talk at all.”

The Bronze Party not only draw folks from Silicon Valley, but the enterprise is a by-product of that world: Ben Fuller, the man behind Bronze, was once a tech entrepreneur himself. According to CNN, he sold his first company for “less than $5 million.”

Fuller did not return a call for comment.

Laurie Seagall covered the “Lifestyle” in her book “Special Characters: My Adventures with Tech’s Titans and Misfits.”

In the book, she recalled once encountering a sex-party magnate who had a tech-heavy clientele — including, he bragged, a key member of the iPhone development team.

Additionally, he revealed, “The guy who created our check-in software basically built Oracle.”

As for drugs, Powers — who pointed out they are not allowed to be used on Power Exchange premises — confirmed that “some [sex-party attendees] are drug-oriented. Some of them feel that they need it and that things won’t happen if people are not on drugs.”

And it’s not all flashy luxury, as the insider recalled one sex party that took place in a private home.

“There was porn on monitors in the hallway. It was not a billionaire’s mansion. It was a mediocre home. It felt a little gross, kind of sketch,” the insider said. “It was totally women and men from Silicon Valley.”

According to the Wall Street Journal, Lee attended underground parties with Khazar Momeni, the sister of Nima Momeni — who is accused of Lee’s murder.

Sources told the Journal that Lee and Khazar were sleeping together and that it was feared Lee had fallen into a dangerous crowd.

Nima allegedly confronted Lee about the partying and his sister’s involvement during the early hours of April 4 when Lee was stabbed multiple times, prosecutors said.

In spite of whatever debauchery may take place within the Lifestyle, the Silicon Valley insider told The Post that there is a higher calling for devotees which goes beyond raw sex.

For some, “there is a mathematical approach. People who are engineers look at the number of relationships that fail and wonder how they can be optimized” — including by having multiple sexual partners. “That approach is unique to Silicon Valley: If something fails X amount of times, let’s optimize it by doing Y. There is an element of people applying a data-driven approach to sexual relationships.”

And, the insider said, “It’s not like they are partying continually.

“They microdose with mushrooms and ketamine and go on ayahuasca retreats. It’s an intellectual approach to hard partying. It’s normal in Silicon Valley to experiment with drugs and sex. Going to sex parties is one of the things they do” — along with visiting exclusive wineries and attending raves.

Besides, the insider said, “there is no shame in doing drugs” in the tech world. “Silicon Valley is less judgey [than New York] and that makes sense because people think outside the box there. They’re still inventing the future. These people have a propensity for risk. Burning Man is part of the culture.

“You could be walking around naked, and run into a coworker who is naked and it would not be a big deal. A lot of people who do well in Silicon Valley experiment with all kinds of things.”