mismatches that can occur between the interest rate sensitivity of our assets and liabilities, inclusive of hedges, was 0.5 years as of March 31, 2018, moderately higher than our net duration gap of 0.1 years as of December 31, 2017. As of March 31, 2018, our sensitivity to an instantaneous parallel increase in rates of 50 and 100 basis points, and assuming no portfolio rebalancing actions, was an estimated decline of -3.9% and -9.8%, respectively, of our tangible net book value. (See Item 3. Quantitative and Qualitative Disclosures about Market Risk in this Form 10-Q for further information on our interest rate and spread sensitivity).
The average cost of our repo funding increased by 25 basis points during the first quarter, consistent with the increase in the federal funds rate, as the Federal Reserve continued to gradually increase short-term interest rates. Over the same period, three-month LIBOR, which is linked to the receive leg of our pay fixed interest rate swaps, increased 61 basis points, and ended the quarter 49 bps higher than our average repo rate. Despite this favorable spread differential, our average total cost of funds for the first quarter, which includes repurchase agreements, the implied funding costs of our TBA securities and interest rate swaps, increased by 16 basis points to 1.68% for the quarter, as the receive legs of our interest rate swaps had not yet fully reset to the higher prevailing 3-month LIBOR rates. Our average net interest margin (including our TBA dollar roll funded assets and interest rate swap hedges and excluding "catch-up" premium amortization cost due to changes in CPR forecasts) for the first quarter decreased to 1.26%, compared to 1.36% for the fourth quarter, largely due to higher funding costs.
Our investment portfolio decreased modestly during the first quarter, while our asset composition was largely unchanged with 30-year and 15-year Agency RMBS fixed rate securities representing 78% and 18% of our investment portfolio, respectively, as of March 31, 2018. Our forecasted lifetime CPR was 7.6% as of March 31, 2018, down from 8.4% as of December 31, 2017, in line with higher interest rates. As of March 31, 2018, our "at risk" leverage ratio was 8.2x our tangible equity, largely unchanged from 8.1x as of December 31, 2017. Given the favorable funding dynamics for Agency RMBS and the attractive relative valuations between Agency RMBS and credit sensitive assets, we continue to favor levered investments in Agency RMBS over other fixed income products. Should Agency RMBS spreads continue to widen meaningfully, we would view it as an opportunity to opportunistically increase leverage.