The Bodhisatta was once travelling with a large caravan. In a wood they came across a disused well and, needing water, dug it deeper. There they came across buried treasure, but the men, not being satisfied, dug deeper, in spite of the Bodhisatta's warning.
A Nāga-king who lived there was disturbed and slew all except the Bodhisatta.
The story was related in reference to some arahants of Sāvatthi, who, on their way back from there, after having entertained the Buddha, saw the same well and found treasure there. They, however, were satisfied with their find and reported it to the Buddha (J.ii.294f).