The Jataka, Vol. II, tr. by W.H.D. Rouse, , at sacred-texts.com
"Some merchants," etc.--This story the Master told while living at Jetavana, about some traders whose home was at Sāvatthi.
The tradition is that these men had acquired wares in Sāvatthi, which they loaded on carts. 'When the time came for them to set about their business, they gave an invitation to the Blessed One, and offered him rich alms; they received the Refuges, were strengthened in the Precepts, and took their leave of the Master with these words, "Sir, we are going a long way. When we have parted with our wares, if we are fortunate and return in safety, we will come and wait upon you again." Then they set off on their journey.
In a difficult part of their road they observed a disused well. There was no water in it that they could see, and they were athirst; so they resolved to dig deeper. As they dug,  they came upon successive layers of minerals of all sorts, from iron to lapis lazuli. This find contented them; they filled their waggons with these treasures, and got back safe to Sāvatthi. They stowed away the treasure which they had brought; and then bethought them, that having been so lucky they would give food to the brotherhood. So they invited the Blessed One, and made him presents; and when they had respectfully greeted him, and sat down on one side, they recounted how they had found their treasure. Said he, "You, good laymen, are content with your find, and accept your wealth and your livelihood with all moderation. But in other days there were men not content, immoderate, who refused to do as wise men advised them, and so lost their life." And he told at their request an old-world tale.
Once on a time, when Brahmadatta was reigning in Benares, the Bodhisatta was born into the family of a business man; and grew up to be a great merchant. At one time he had filled his waggons with goods, and in company with a large caravan he came to this very same wood and saw this very same well. No sooner had the traders seen it, than they wanted to drink, and began to dig, and as they dug they came upon a
quantity of metal and gems. But though they got a great deal of treasure, they were discontented. "There must be another treasure here, better than this!" they thought, and they dug and dug.
Then said the Bodhisatta to them, "Merchants, greed is the root of destruction. Ye have won a great deal of wealth; with this be ye content, and dig no more." But they digged yet the more notwithstanding.
Now this well was haunted by serpents. The Serpent-king, incensed at the falling of clods and earth, slew them with the breath of his nostrils 1, all saving the Bodhisatta,  and destroyed them; and he came up from the serpent world, and put the oxen to the carts, filled them with jewels, and seating the Bodhisatta upon a fine waggon, he made certain young serpents drive the carts, and brought him to Benares. He led him into his house, set the treasure in order, and went away again to his own place in the serpent land. And the Bodhisatta spent his treasure, so that he made much stir throughout all India by his almsgiving, and, having undertaken the deeds of virtue, and kept the holy day, at the end of his life he came to paradise.
The Master, after telling this tale, in his perfect wisdom, uttered the following lines:
"But not content, still more they did desire,
And fiery serpents slew them all with fire.
Dig if thou wilt, but dig not to excess;
For too much digging is a wickedness.
"Digging bestowed a treasure on these men;
But too much digging lost it all again."
When the Master had finished this discourse, he identified the Birth:--"At that time, Sāriputta was the Serpent-king, and the master of the caravan was I myself."
206:1 Nāsikavātena. Perhaps this throws light on the disease ahivātarogo, p. 55 note.