This scene does not exist. Louis Sachar's narrator never mentions yellow-spotted lizards or hammocks as a remedy. In Holes, the lizards are lethal—their venom causes agonizing, rapid death. No cure, no folk remedy, no "lie in a hammock and wait it out." Zero.
You're likely conflating Holes with another book, a misremembered joke, or a parody. The novel treats the lizards as pure existential threat—part of Camp Green Lake's brutal ecology. The only "survival" is not getting bitten.
If you're thinking of a specific passage, quote it. But the hammock cure? Pure fiction2.