DELHI, India — When midnight approaches in Old Delhi and a thick, freezing fog settles over the city, the quilt-wallah Farukh Khan sits on his corner, watching the market for his services come to life.

They shuffle up one by one, men desperate for sleep. The bicycle rickshaw pullers, peeling one of his 20-rupee, or 30-cent, quilts off a pile, fold their bodies into strange angles on the four-foot seats of their vehicles. The day laborers curl their bodies on the frigid sidewalk, sometimes spooned against other men for warmth.

Those who cannot afford to pay Mr. Khan build fires, out of plastic if necessary, and crouch over them, waiting for the night to be over.

Does any city have a more stratified sleep economy than wintertime Delhi? The filmmaker Shaunak Sen, who spent two years researching the city’s sleep vendors for a documentary, “Cities of Sleep,” discovered a sprawling gray market that has taken shape around the city’s vast unmet need for shelter. In some places, it breeds what he calls a “sleep mafia, who controls who sleeps where, for how long, and what quality of sleep.”