Markets already solve the tragedy of the commons.
Whether it be fish in the open ocean, breathable air in the atmosphere, or pigs and trees in natural lands, markets already solve issues related to scarcity of these resources.
People generally overconsume or deplete the natural resource until it reaches a point of scarcity and value that it justifies containing and reproducing it.
For instance, when it comes to cattle, fish, and trees, people were generally free to just deplete what nature brought them, and then once their actions made those resources scarce, they found it more profitable to tame the cattle, fish, and trees and farm it at an efficient level of production.
Nature initially oversupplies the resource, but we rationally deplete it until it becomes more cost-effective to artificially supply it for ourselves.