I have never seen a formula browsing the web for an asset or nothing option price when skew is accounted for. I am surprised I do not see something for this which should be standard in FX since digital payoffs are typically in the foreign currency (LHS).

For a cash-or-nothing style payoff in FX, the payoff would be the domestic currency (RHS).

Let $C$ be the price of a vanilla call option with the usual parameters suppressed in the notation. Also, I prefer never to mention spot when in European pricings, so I use the formulas based on forwards below.

In the flat vol Black-Scholes world using the usual BS notation, the price of the cash or nothing option is:

$$e^{-rt}N(d2)$$

Similarly, the asset-or-nothing call in the Black Scholes framework will be the well established formula:

$$e^{-rt}FN(d1)$$

When skew needs to be accounted for, the usual limit of a tight call spread argument and the chain rule will yield for the cash-or-nothing:

$$e^{-rt}(N(d2) - \frac{\partial \sigma}{\partial K} \frac{\partial C}{\partial \sigma})$$

Of course, we also have the usual price of the vanilla call which is long one unit of an asset or nothing call and short K units of a cash or nothing call in the Black-Scholes world:

$$C=e^{-rt}(FN(d1)-KN(d2))$$

Since being long the call will still be long one unit of an asset-or-nothing call and short K units of a cash-or-nothing call in a model independent way, we can then rewrite the vanilla call formula as:

$$C=e^{-rt}(F(N(d1) - X) -K(N(d2)-\frac{\partial \sigma}{\partial K} \frac{\partial C}{\partial \sigma}))$$

where we have the skew correction factor in the cash-or-nothing portion and we call $X$ the skew correction factor for the asset-or-nothing call. Since the vanilla call is correctly priced by both formulas, we can solve for X and we see that:

$$X=\frac{K}{F}\frac{\partial \sigma}{\partial K}\frac{\partial C}{\partial \sigma}$$

This should yield my final answer of the asset-or-nothing price with skew as:

$$C=e^{-rt}(FN(d1)-K\frac{\partial \sigma}{\partial K}\frac{\partial C}{\partial \sigma})$$

or in terms of percentage of one unit of foreign currency notional:

$$e^{-rt}(N(d1)-\frac{K}{F}\frac{\partial \sigma}{\partial K}\frac{\partial C}{\partial \sigma})$$

Is this a standard formula that I have not been able to find? Did I make an error?