Determination of solubility equilibrium using galvanic cell reactions

This is the problem:

We can determine the solubility equilibrium for silver bromide using cell:

Ag (s) | AgNO3 (aq) || KBr (aq) | AgBr (s) | Ag (s)

We know that:

$$\text{AgBr} + \text{e}^- \rightarrow \text{Ag} + \text{Br}^- \ \ \ \text{E}^0=0.095 \text{V}$$

$$\text{Ag}^+ + \text{e}^- \rightarrow \text{Ag}\ \ \ \text{E}^0=0.799 \text{V}$$

First of all isn't that cell diagram incorrect? As far as I understand it is the silver reducing from silver nitrate to metallic silver thus being cathode. And vice versa for the silver bromide that is being produced more as silver is oxidating. Shouldn't the cell diagram be like this instead:

KBr (aq) | AgBr (s) | Ag (s) || Ag (s) | AgNO3 (aq)

Anyways, if we consider the Nernst equation:

$$E = E_0-\frac{RT}{nF}\ln{k}$$

and assume that the galvanic cell is in equilibrium when there is no voltage (i.e. $$E=0$$). We can then write:

$$\ln{k}=\frac{E^0nF}{RT} \\ \leftrightarrow k=e^{\frac{E^0nF}{RT}}$$

Then plug in the numbers:

$$\ln{k}=\frac{(-0.095+0.799)\ \text{V}\cdot 1 \ \text{mol}\cdot 96485.31 \ \frac{\text{C}}{\text{mol}}}{8.31451\ \frac{\text{J}}{\text{mol}\cdot \text{K}}\cdot 293.15 \ \text{K}} \\ \leftrightarrow k= 1.26754\cdot 10^{12}$$

But the right answer is:

$$1.26 \cdot 10^{-12}\ \text{mol}^2/\text{dm}^6$$

Any ideas what am I doing wrong?

The leftmost and rightmost parts of the galvanic cell notation are supposed to be electrodes, not electrolytes (no KBr (aq) and the likes of it there). What is more, the double vertical line represents the interface where the junction potential has been eliminated ((c) Atkins), i.e. salt bridge, which in this case is the interface between electrolytes. The left hand side of the cell is anode, where the oxidation occurs, and the silver ions are reduced at the cathode, which is written on the right hand side. It seems to me that the correct notation is:

Ag (s) | AgBr (s) | KBr (aq) || AgNO3 (aq) | Ag (s)

In turn, the cell reaction is $$\ce{Ag+ + Br- -> AgBr}$$, and the EMF of this reaction is +0.704 V. It is not surprising that the equilibrium constant of this reaction is much larger than unity, otherwise silver bromide wouldn't be so stable and so insoluble. What you're missing is that the solubility product, which you want to calculate, is an equilibrium constant of the inverse process - not the formation, but the dissolution of $$\ce{AgBr}$$. So take the inverse of the equilibrium constant which you obtained from the galvanic cell EMF, and you'll get $$7.9\cdot10^{-13}$$, which is pretty close to the reference values.

Consider the net reaction you are looking at:

$$\ce{Ag+ + Br- -> AgBr}, E^{\circ} = 0.704\ \mathrm{V}$$

The equilibrium, not surprisingly, lies to the right, which we can tell from the standard potential and from knowledge about the solubility of silver bromide.

This means that you expect the concentrations of reactants to be quite small. When they then go into the equilibrium constant, I expect a very large equilibrium constant. In other words, your answer is much more consistent with the chemical situation than the expected answer, based solely on the magnitude of the two answers.