Retirement tax questions

The only thing that counts with any IRA is how much did you contribute and how much did you withdraw.  Gains and losses that happen inside the IRA are ignored.  If you deposited $1000 and withdraw $1030, then the $30 is "earnings" and is taxed according to your age.  It does't matter where the $30 came from.