You get to keep only enough to maintain a very modest lifestyle in a low-cost-of-living area, the rest of it has to go towards improving the world in some way.
Edit: Given the previous rules that you must maintain a very modest lifestyle in a low-cost-of-living area, would you rather choose to opt out and not have the money at all?
Exactly what I would do. Build tiny house communities for low income housing that sustain themselves.
They would have some community features like a tool library and food garden and a dog area, and individual indoor and outdoor spaces for everyone.
A portion of either the rent or sale price would be set aside for each person for financial advice or mental health support annually.
Ideally built by a combination of master craftspeople and trainees from at risk youth.