Voluntary 2nd pillar purchase

You cannot generate negative income, hence the maximum contribution for pillar 2a is your net income minus deductions.

In reality, only contributions above 150k CHF net taxable net income, net of all deductions, makes sense, below this your marginal tax rate is too low to be a tax efficient scheme for the lock up and lower return than other investments