LAS VEGAS — Nets general manager Sean Marks had a whirlwind Saturday night in which he saw the Wizards match his max offer sheet to restricted free agent Otto Porter Jr. before he rebounded with a trade that brought veteran small forward DeMarre Carroll from the Raptors along with first- and second-round picks in the 2018 draft.

Under NBA rules, Marks was not allowed to comment on the Toronto deal on Sunday because it’s not final. The Wizards matched the offer sheet to Porter, contingent on his passing a physical. That means $24.77 million of the Nets’ salary-cap space is tied up until Tuesday or Wednesday, and they need that cap space to acquire the remaining two years’ worth ($30.2 million) on Carroll’s contract.

Assuming Porter remains a Wizard and Carroll joins the Nets, they should have at least $17 million of cap space to use in other deals this summer or to save until 2018, when they might have as much as $30 million.

Asked at the Las Vegas summer league if he’s done, Marks said: “I’d like to think we’re trying to keep our hand on the pulse and see what happens. We all like having the space we have right now, and we’ll see what comes across our way. If the right deals come across, we’ll certainly look at them.”

The issue of cap space is vital. Shooting guard Kentavious Caldwell-Pope was renounced by the Pistons and now is an unrestricted free agent. He turned down a five-year deal worth $80 million that would have kept him in Detroit. The Nets ranked him behind Porter, but they still might be interested in a long-term deal despite the glut of perimeter players on their roster.

“I hate to be vague, but if the right deal comes along that uses all of our cap space, we could jump at it,” Marks said. “If it doesn’t and we take this cap space into the season, I’m excited about that. Just having that flexibility is nice.”

The Carroll deal is the second by Marks this summer in which the Nets took on a so-called “bad contract” but got a player who not only will provide leadership but be effective in their rotation. Center Timofey Mozgov, who has three years and $48 million left on his contract, is likely to start. Carroll might, too.

advertisement | advertise on newsday

“I look at ‘how do we add talent?’ ” said Marks, who swapped Justin Hamilton in the Carroll deal. “Not just veteran leadership. Any time we can add a piece of talent and our team can really benefit from it, that’s what we’re looking to do.”

Point guard Jeremy Lin was part of a group of veterans who showed up for the Nets’ 88-83 loss to the Bucks’ summer league team Sunday. Lin declined to comment specifically about his role in recruiting Porter, but he was thrilled by the trade to land Carroll.

“I think the difficult thing has always been restricted free agency because you’re kind of putting other things on hold with a lot of uncertainty,” Lin said. “As we all know, we went for Otto, and there were opportunities that were missed out on. That’s just part of the free-agency business.”

Lin hasn’t spoken to Carroll yet, but he contacted a Raptors friend who raved about him. “He’s going to be so instrumental,” Lin said. “He definitely can shoot the three, and he definitely can play defense, which we really, really need. But he can do more. Just veteran leadership, toughness, grit. I’m hoping he comes in and is a vocal leader . . . He’d better help me, and you can print that.”

Until the Nets’ cap situation clears up, Marks’ next step is a mystery. Any bid for Caldwell-Pope would be done with an eye to the future, when Lin possibly could leave as a free agent. For the present, the most glaring need is frontcourt scoring.

Two obvious candidates are unrestricted free agent Ersan Ilyasova and restricted free agent JaMychal Green, who might not get a match from the Grizzlies if the offer is big enough. Both power forwards have three-point range. Marks said he’s not focused on one position but added: “In today’s game, you certainly would love to see stretch fours. Shooting is something that’s real ly valuable.”

He is 0-for-4 in his attempts to land a restricted free agent, but when asked if he’s done with the RFA route, Marks smiled and said, “Never say never.”