Cash-at-hit digital call (source code)

= Cash-at-hit digital call

A barrier claim paying a fixed cash amount at the first time the <stock> reaches a higher level, provided this happens before expiry. In the <Black-Scholes model>, take $a=\log(c/S_0)/\sigma$ and $b=(\sigma^2/2-\rho)/\sigma$. Its unit-cash price is $\mathbb E_Q[e^{-\rho T_{a,b}}\mathbf1_{\{T_{a,b}\leq T\}}]$, given by <truncated discounted Brownian first passage>. The effective square root $\sqrt{b^2+2\rho}=|\rho+\sigma^2/2|/\sigma$ is real for every real interest rate.