For Representatives (elected legislators) I think their salaries should be tied to their constituent mean salary and something reflecting their performance, like an inverse of inflation and/or .gov budget balance modifier.
So, they pass legislation that raises inflation = every members salary is cut, lower inflation = they get a pay raise. This idea may be too hard to implement though as 'economic experts' tend to have some number ~2% as being an ideal for a healthy growing economy and while deflation is generally considered bad, it's not always. Macroeconomics can get quite complicated.
A balanced budget salary modifier however is simpler. Legislatures determine/approve government spending and generally have done a really bad job judging by the several States and federal budget deficits.
So for example their salary increases or decreases based on the same percentage of under or over budget respectively.
Politician (or any government "job" really) should not be a particularly attractive 'career', much less a lucrative one.
The way it should be:
Wanna make money?... get a real job or create a business, etc. - IOW, do something productive that contributes to society.
On the other hand, if you want to serve/help/represent people, etc. on a larger scale than the local soup kitchen or whatever and are independently wealthy (thus don't need the money) or are comfortable living at poverty level, try .gov.