For the second quarter, we recognized total revenue of $144.0 million, comprised of stream revenue of $106.0 million and royalty revenue of $38.0 million at an average gold price of $1,976 per ounce, an average silver price of $24.13 per ounce and an average copper price of $3.84 per pound. This is compared to total revenue of $146.4 million for the three months ended June 30, 2022, comprised of stream revenue of $104.9 million and royalty revenue of $41.6 million, at an average gold price of $1,871 per ounce, an average silver price of $22.60 per ounce and an average copper price of $4.31 per pound.
The decrease in total revenue in the second quarter resulted primarily from lower gold sales at Andacollo, lower copper sales at Mount Milligan and lower gold and silver production attributable to our interest at Peñasquito. The decrease was offset by higher gold production attributable to our interest at Cortez as a result of the newly acquired royalties and higher gold and silver prices when compared to the prior year period.
Cost of sales, which excludes depreciation, depletion and amortization (“DD&A”), decreased to $23.4 million for the second quarter, from $23.8 million for the prior year period. The decrease, when compared to the prior year period, was primarily due to a decrease in copper sales at Mount Milligan and lower gold sales at Andacollo, offset by higher silver sales at Khoemacau. Cost of sales is specific to our stream agreements and is the result of our purchase of gold, silver and copper for a cash payment. The cash payment for gold from Mount Milligan is the lesser of $435 per ounce or the prevailing market price of gold when purchased, while the cash payment for our other streams is a set contractual percentage of the gold, silver or copper (Mount Milligan) spot price near the date of metal delivery.
General and administrative costs decreased to $9.1 million for the second quarter, from $9.3 million for the prior year period. The decrease was primarily due to lower non-cash stock compensation expense during the current period.
DD&A expense decreased to $38.4 million for the second quarter, from $44.0 million for the prior year period. The decrease was primarily due to lower depletion rates at Mount Milligan and Pueblo Viejo as a result of proven and probable mineral reserve increases when compared to the prior year period. The decrease was partially offset by higher depletion expense at Khoemacau due to the ramp-up of production and additional depletion expense from the newly acquired royalties at Cortez when compared to the prior year period.
Interest and other expense increased to $8.4 million for the second quarter from $1.4 million for the prior year period. The increase was primarily due to higher interest expense as a result of higher average amounts outstanding under our revolving credit facility compared to the prior year period. We had $400 million outstanding under our revolving credit facility as of June 30, 2023, compared to zero outstanding as of June 30, 2022. The current all-in borrowing rate under our revolving credit facility was 6.7% as of June 30, 2023.
For the second quarter, we recorded income tax expense of $2.0 million, compared with an income tax benefit of $5.9 million for the prior year period. The income tax expense resulted in an effective tax rate of 3.1% in the current period, compared with (9.0%) for the prior year period. The three months ended June 30, 2023 and 2022 both included discrete tax benefits attributable to the release of a valuation allowance on certain deferred tax assets.
Net cash provided by operating activities totaled $107.9 million for the second quarter, compared to $120.2 million for the prior year period. The decrease was primarily due to higher interest payments on amounts outstanding under our revolving credit facility and lower royalty revenue, compared to the prior year period.
Net cash used in investing activities totaled $2.6 million for the second quarter, compared to $0.1 million for the prior year period. The increase was primarily due to higher acquisitions of royalty and stream interests compared to the prior year period.
Net cash used in financing activities totaled $126.0 million for the second quarter, compared to $23.2 million for the prior year period. The increase was primarily due to a repayment of $100 million on our revolving credit facility during the current period.
At June 30, 2023, we had current assets of $165.3 million compared to current liabilities of $63.1 million, which resulted in working capital of $102.2 million and a current ratio of approximately 3 to 1. This compares to current assets of $185.8 million and current liabilities of $63.6 million at December 31, 2022, resulting in working capital of $122.2 million and a current ratio of approximately 3 to 1. The decrease in working capital was primarily due to a decrease in our available cash, which resulted from increased debt repayments during the second quarter.
During the second quarter, liquidity needs were met from $107.9 million in net cash provided by operating activities and available cash resources.
Other Corporate Updates
Total Available Liquidity Increases to Approximately $702 Million
On June 6, 2023, Royal Gold repaid $100 million of outstanding borrowings on the $1 billion revolving credit facility, resulting in $400 million outstanding and $600 million available as of June 30, 2023. Total liquidity at the end of the second quarter increased to approximately $702 million, which consisted of $102 million of working capital and the $600 million undrawn amount available under the revolving credit facility.