Speak with an attorney who handles construction defects cases. If the foundation problems are due to construction defects  (e.g. poor design; poor construction; and/or sub-standard materials), you may have a claim against the builder. You would most likely not have grounds to get out from under the mortgage, unfortunately (if you  have one), since the builder's liability or fault does not affect the validity of your obligations to the bank or  lender.