We never use a gerund in place of a noun unless we want to call attention to the action itself. Let me use an example.
The sale of my house provided me with extra spending money.Why do I have extra money? Because my house was sold.
The selling of my house provided me with extra spending money.Why am I using the gerund form instead of the simpler "sale"? I would only say this if I wanted to emphasize that the actual act of selling the house is what provided me with money. Maybe I was an unscrupulous seller and took bribes from prospective buyers during the process. Maybe I sold it more than once, so I continued to make money by selling again and again. These are very specific and odd cases. In most cases, I would just say "sale."
So there are two problems with A. One is that we seem to be saying that the actual
process of decline is what provided a reason to invest, when it makes more sense to say that the decline itself (the fact that prices are lower) provides a reason. The second problem is that if we say "the declining of," it sounds like an action that someone undertook, as in "the raising of the flag" or "the lighting of the candles." No one "declined" the values, so this usage makes no logical sense.