The Bodhisatta was once a merchant. One time he joined an oxcart caravan, and while in a remote area they passed an abandoned well. While digging for water, they found jewels and precious metals. Though they found a lot, they wanted more and kept digging. The Bodhisatta told the others to stop because greed is the root of destruction, but they did not listen to him. Falling clods of earth caused by their digging disturbed a naga king who lived below the well and he came out and killed them all, except the Bodhisatta. Then he and some young naga filled all the carts with even more jewels and drove the Bodhisatta home with all of it. For the rest of his life, he used this enormous treasure for almsgiving and was known across India because of it.
In the Lifetime of the Buddha
Some merchants who were devoted followers of the Buddha, always making donations to him before and after their caravan journeys, once came upon the same abandoned well that made the Bodhisatta rich. They too dug at the bottom hoping to find water and also uncovered treasure. But they were content with what they found and did not dig deeper.
When the merchants returned home they told the Buddha about their luck, and he told them this story so they knew following a life of moderation was the right thing to do.
The naga king was an earlier birth of Sariputta, one of the Buddha’s top disciples.