* Nickel miners surge on talk of Indonesia export ban
* Lithium miners lead ASX gains, gold units end at record high
* Rio Tinto (LON:RIO) down, trades ex-div (Updates to close)
Aug 8 (Reuters) - Australian shares rose on Thursday, helped by mining stocks and surprisingly solid July trade numbers out of top trading partner China.
The S&P/ASX 200 index .AXJO ended 48.6 points, or 0.8% higher, at 6,568.1. The index advanced 0.6% on Wednesday
China's July export and import data came in better than expected, suggesting some resilience to the drawn-out Sino-U.S. tariff struggle. Beijing also helped sentiment by fixing the yuan's midpoint level for Thursday at a firmer level than the feared. MKTS/GLOB
The yuan fix is "the number one game in town and will continue to dictate the pace of play for risk assets over the near term," Stephen Innes, managing partner at financial services firm VM Markets Pte Ltd said in a note.
Australian lithium miners surged and led gains on the benchmark. Galaxy Resources GXY.AX jumped 10.9% and Pilbara Minerals PLS.AX climbed 8.2%.
This followed sharp overnight gains for Albemarle Corp ALB.N , the world's largest lithium producer, after it beat quarterly profit estimates and raised its 2019 adjusted profit forecast on Wednesday. nickel miners also had a field day after London nickel touched a 16-month high and Shanghai nickel hit a record amid worries that major supplier Indonesia could soon ban ore exports. MET/L
Nickel miners Independence Group NL IGO.AX , Mineral Resources Ltd MIN.AX and Jervois Mining Ltd JRV.AX tacked on between 2.2% and 7.5%.
Australian gold stocks .AXGD closed at a record high, continuing to revel in its safe-haven status amid lingering uncertainties around the Sino-U.S. trade war and a slew of interest rate cuts by global central banks. GOL/
Newcrest Mining NCM.AX closed 4.1% higher.
Mining major Rio Tinto Ltd RIO.AX , bucking the trend, fell 1.1% as its shares traded ex-dividend. BHP Group BHP.AX was 1.5% higher.
Australian bank stocks .AXFJ were down early, but all of the Big Four except ANZ ANZ.AX managed to end marginally up.
Treasury Wine Estates TWE.AX reversed sharp losses to end 0.1% higher after it rejected a research report by a Hong Kong firm which alleged that the world's largest standalone winemaker may have improperly inflated profits in recent years. Zealand's benchmark S&P/NZX 50 index .NZ50 finished 0.8% higher at 10,874.3. It gained 1.9% the day earlier after the central bank's surprisingly large 50 basis point rate cut.
Adventure goods retailer Kathmandu Holdings KMD.NZ spiked more 14% on strong preliminary annual sales and was the top gainer on the benchmark.