10. In the sequence $\left\{a_{n}\right\}$, all terms are positive, $S_{n}$ is the sum of the first $n$ terms, and $a_{n}+\frac{1}{a_{n}}=2 S_{n}$. The general term formula $a_{n}=$ $\qquad$.
10. $a_{n}=\sqrt{n}-\sqrt{n-1}$.

Substituting $a_{n}=S_{n}-S_{n-1}$ and rearranging, we get $S_{n}^{2}-S_{n-1}^{2}=1$, and $S_{1}=1$, so $\left\{S_{n}^{2}\right\}$ is an arithmetic sequence with the first term 1 and common difference 1. Therefore, $S_{n}^{2}=n$, which means $S_{n}=\sqrt{n}, a_{n}=\sqrt{n}-\sqrt{n-1}$.