*mps*

# Path Integral Method for Floating Barrier Option Pricing

Qi Chen 1<EMAIL_ADDRESS>Hong-tao Wang 2<EMAIL_ADDRESS>Chao
Guo 2<EMAIL_ADDRESS>1 School of Economics and Management, Langfang Normal
University, Langfang 065000, China
2 School of Science, Langfang Normal University, Langfang 065000, China

###### Abstract

Path integral method in quantum mechanics provides a new thinking for barrier
option pricing. For proportional floating barrier step options, the option
price changing process is similar to the one dimensional trapezoid potential
barrier scattering problem in quantum mechanics; for floating double-barrier
step options, the option price changing process is analogous to a particle
moving in a finite symmetric square potential well. Using path integral
method, the analytical expressions of pricing kernel and option price could be
derived. Numerical results of option price as a function of underlying price,
floating rate, interest rate and exercise price are shown, which are
consistent with the results given by mathematical method.

##  I Introduction

In 1973, Black and Scholes derived the analytical expression of fixed-
volatility option price by solving stochastic differential equations Black .
Financial mathematics applied to derivative pricing has made great progress
from then on Amin ; Rubinstein . Recently, more complex options have emerged
in financial markets, which are collectively called exotic options Merton:1973
; Geske:1979 . A kind of exotic option is the one attached some conditions to
an ordinary option, taking barrier options for example: when the underlying
price touches the barrier, the option contract will be activated, which is
called knock-in option; when the underlying price touches the barrier, the
option contract is invalid, which is called knock-out option. Snyder had
discussed down-and-out option in 1969 Snyder . Baaquie et al discussed this
kind of option by path integral method, and derived the corresponding
analytical expressions Baaquie . Similar to one-dimensional infinite square
potential well in quantum mechanics, the analytical expression for double-
knock-out option price was also derived Baaquie:2004 , which is in accordance
with the result derived by mathematical method Haug . In addition, path
integral method has been applied to the research of interest rate derivative
pricing Marakani ; Srikant . Some works investigating step options appear in
Linetsky:2001 ; Linetsky:1999 ; Lee:2019 . Exotic barrier options pricing
could be studied in Lee:2021 ; Xing:2013 . Studies of option pricing by path
integral method can be found in Baaquie ; Baaquie:2004 ; Kleinert:2012 .

In this paper, we will discuss two kinds of barrier options, which are called
proportional floating barrier step (PFBS) option and proportional floating
double-barrier step (PFDBS) option, respectively. Floating barrier options are
the barrier options with time dependent barrier levels Kunitomo:1992 . A step
option could be also called a gradual knock-out (knock-in) option: when the
underlying price touches and passes the barrier, the option contract is not
invalid immediately, but the option knocks out (knocks in) gradually
Linetsky:2001 ; Linetsky:1999 . A proportional step call is defined by its
payoff Linetsky:1999

$e^{-V_{0}\tau}{\rm max}(S_{T}-K,0)$ (1)

where $S_{T}$ is the underlying price on the expiration date, $K$ is the
exercise price, $V_{0}$ is called knock-out rate, which is corresponding to
the potential in quantum mechanics. The exponential $e^{-V_{0}\tau}$ is
interpreted as a knock-out discount factor with discounting time $\tau$. A
daily knock-out factor $d$ could be defined as Linetsky:2001 ; Linetsky:1999

$d=e^{-V_{0}/250}$ (2)

where 250 trading days per year is assumed. A proportional floating barrier
step option is considered as a proportional step option combined with a
floating barrier. We focus on the relation between proportional floating
barrier step call (proportional floating double-barrier step call) option
pricing and one dimensional trapezoid potential scattering (finite symmetric
square well): when a particle moving ahead and going through the boundary, the
wave function begins to decay exponentially, which is similar to a
proportional floating barrier step (proportional floating double-barrier step)
option knocks out over time.

Our work is organized as follows. In Section 2, we will derive the analytical
expressions for proportional floating barrier step call option price by path
integral method. In Section 3, we will derive the analytical expressions for
floating double-barrier option price by path integral method. The analytical
expressions for proportional floating double-barrier step call price are given
in Section 4. In Section 5, we show the numerical results for option price as
a function of underlying price, exercise price interest rate and floating
rate, respectively. We summarize our main results in Section 6. The pricing
formulas for Black-Scholes model, the standard barrier option (SBO), the
standard double-barrier option (SDBO), proportional step option and
proportional double-barrier step option derived by path integral method are
reviewed in Appendix A-E.

##  II Proportional Floating Barrier Step Option pricing

Consider a barrier with the following definition Kunitomo:1992

$A(t)=A_{0}e^{\delta_{t}},\ \ t\in[0,\tau]$ (3)

where $A_{0}$ is the barrier level at time $t=0$, $\delta$ is the floating
rate, which denotes the rate of change of the barrier. Making the following
variable substitution Baaquie

$S=e^{x},\ x\in(-\infty,+\infty)$ (4)

where $S$ is the underlying asset price, and the barrier could be converted
into

$B(t)=B_{0}+\delta t$ (5)

where

$A(t)=e^{B(t)},\ \ A_{0}=e^{B_{0}},\ \ t\in[0,\tau]$ (6)

Without loss of generality, we set $\delta>0$ throughout the following
discussion. An up-and-out proportional floating barrier step option price
changing could be analogous to a one-dimensional particle moving under the
following potential

$V(x,t)=\left\\{\begin{aligned} 0&,&x\leq B_{0}+\delta t,\\\
V_{0}&,&x>B_{0}+\delta t.\end{aligned}\right.$ (7)

for $x>B_{0}+\delta t$, the wave function decays as the distance increases in
the case of the particle energy $E<V_{0}$, which is similar to an option
touches a barrier at $x=B_{0}+\delta t$ and knocks out gradually. The
Hamiltonian for a proportional floating barrier step (PFBS) option is

$H_{\rm PFBS}=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial x}+r+V(x)$
(8)

where $r$ is the fixed interest rate, and $\sigma$ is the volatility. The
Hamiltonian (8) is non-Hermitian, considering the following transformation

$H_{\rm PFBS}=e^{\alpha x}H_{\rm eff}e^{-\alpha x}=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}+V(x)$ (9)

where

$\alpha=\frac{1}{\sigma^{2}}\left(\frac{\sigma^{2}}{2}-r\right),\ \
\gamma=\frac{1}{2\sigma^{2}}\left(\frac{\sigma^{2}}{2}+r\right)^{2}$ (10)

and $H_{\rm eff}$ is Hermitian. The stationary state Schrödinger equation for
option price under $\rm H_{eff}$ is

$\left\\{\begin{aligned} -\frac{\sigma^{2}}{2}\frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+\gamma\phi=E\phi&,&x\leq B_{0}+\delta t,\\\
-\frac{\sigma^{2}}{2}\frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+(\gamma+V_{0})\phi=E\phi&,&x>B_{0}+\delta t.\end{aligned}\right.$
(11)

where $\phi$ is the stationary state wave function of the option, and $E$ is
corresponding to the option energy under the potential (7). The Schrödinger
equation above could be simplified into

$\left\\{\begin{aligned} \frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+p_{1}^{2}\phi=0&,&x\leq B_{0}+\delta t,\\\ \frac{{\rm
d}^{2}\phi}{{\rm d}x^{2}}-p_{2}^{2}\phi=0&,&x>B_{0}+\delta
t.\end{aligned}\right.$ (12)

where

$p_{1}^{2}=\frac{2(E-\gamma)}{\sigma^{2}},\ \
p_{2}^{2}=\frac{2(V_{0}+\gamma-E)}{\sigma^{2}}$ (13)

here the condition $E<V_{0}$ has been considered, and the range of $p_{1}^{2}$
and $p_{2}^{2}$ is

$p_{1}^{2}<\frac{2(V_{0}-\gamma)}{\sigma^{2}},\ \ \
p_{2}^{2}=\frac{2V_{0}}{\sigma^{2}}-p_{1}^{2}>\frac{2\gamma}{\sigma^{2}}$ (14)

The general solution for (12) is

$\phi(x,t)=\left\\{\begin{aligned} e^{ip_{1}[x-(B_{0}+\delta
t)]}&+A_{1}e^{-ip_{1}[x-(B_{0}+\delta t)]}&,&x\leq B_{0}+\delta t,\\\
&A_{2}e^{-p_{2}[x-(B_{0}+\delta t)]}&,&x>B_{0}+\delta t.\end{aligned}\right.$
(15)

where

$A_{1}=\frac{p_{1}-ip_{2}}{p_{1}+ip_{2}},\ \
A_{2}=\frac{2p_{1}}{p_{1}+ip_{2}}$ (16)

here the boundary condition at $x=B_{0}+\delta t$ is used. Now we calculate
the price of up-and-out proportional floating barrier step call. Let
$\tau_{1}$ indicates the occupation time below the barrier, and $\tau_{2}$ is
the occupation time above the barrier. The pricing kernel is

$\begin{split}p_{\rm
PFBS}(x,x^{\prime};\tau)&=\braket{x}{e^{-\tau_{1}H_{1}-\tau_{2}H_{2}}}{x^{\prime}}\\\
&=e^{\alpha(x-x^{\prime})}\int\frac{{\rm
d}p}{2\pi}\braket{x}{e^{-\tau_{1}H_{\rm
eff1}}}{p}\braket{p}{e^{-\tau_{2}H_{\rm eff_{2}}}}{x^{\prime}}\\\
&=e^{\alpha(x-x^{\prime})}e^{-\tau\gamma}\int\frac{{\rm
d}p}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\phi(x,0)\phi^{*}(x^{\prime},\tau)\end{split}$
(17)

where $\phi^{*}(x,t)$ is the complex conjugate of $\phi(x,t)$, and the option
price is

$C_{\rm PFBS}(x;\tau)=\int_{{\rm ln}K}^{+\infty}{\rm d}x^{\prime}p_{\rm
PFBS}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)$ (18)

where $K$ is the exercise price, $S=e^{x}$ is the initial underlying asset
price, $S^{\prime}=e^{x^{\prime}}$ is the underlying asset price at $t=\tau$,
and

$\begin{split}H_{1}&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial x}+r,\ \ \
H_{2}=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial
x}+r+V_{0}\\\ H_{\rm eff1}&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma,\ \ \ H_{\rm
eff2}=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma+V_{0}\end{split}$ (19)

We set the exercise price $K<e^{B_{0}}$. For $x<B_{0}+\delta t$ and
$x>B_{0}+\delta t$, the wave functions are different, and the integral for
(18) should be split into four cases

  * •

$x<B_{0}$, and ${\rm ln}K<x^{\prime}<B_{0}+\delta\tau$

the pricing kernel

$\begin{split}p_{{\rm
PFBS1}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{(}e^{ip_{1}(x-B_{0})}+A_{1}e^{-ip_{1}(x-B_{0})}\bigg{)}\times\\\
&\bigg{(}e^{-ip_{1}[x^{\prime}-(B_{0}+\delta\tau)]}+A_{1}^{*}e^{ip_{1}[x^{\prime}-(B_{0}+\delta\tau)]}\bigg{)}\\\
&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{[}2\cos
p_{1}(x-x^{\prime}+\delta\tau)+\\\
&\frac{\sigma^{2}}{V_{0}}(p_{1}^{2}-p_{2}^{2})\cos
p_{1}(x+x^{\prime}-2B_{0}-\delta\tau)-\frac{2\sigma^{2}}{V_{0}}p_{1}p_{2}\sin
p_{1}(x+x^{\prime}-2B_{0}-\delta\tau)\bigg{]}\end{split}$ (20)

  * •

$x<B_{0}$, and $x^{\prime}>B_{0}+\delta\tau$

the pricing kernel

$\begin{split}p_{{\rm
PFBS2}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{(}e^{ip_{1}(x-B_{0})}+A_{1}e^{-ip_{1}(x-B_{0})}\bigg{)}A_{2}^{*}e^{-p_{2}[(x^{\prime}-(B_{0}+\delta\tau)]}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{[}\frac{\sigma^{2}}{V_{0}}p_{1}^{2}\cos
p_{1}(x-B_{0}-\delta\tau)-\\\ &\frac{\sigma^{2}}{V_{0}}p_{1}p_{2}\sin
p_{1}(x-B_{0}-\delta\tau)\bigg{]}e^{-p_{2}(x^{\prime}-B_{0}-\delta_{\tau})}\end{split}$
(21)

the option price for $x<B_{0}$ is

$C(x;\tau)|_{x<B_{0}}=\int_{{\rm ln}K}^{B_{0}+\delta\tau}p_{{\rm
PFBS1}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)+\int_{B_{0}+\delta\tau}^{+\infty}p_{{\rm
PFBS2}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)$ (22)

  * •

$x>B_{0}$, and ${\rm ln}K<x^{\prime}<B_{0}+\delta\tau$

the pricing kernel

$\begin{split}p_{{\rm
PFBS3}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}A_{2}e^{-p_{2}(x-B_{0})}\bigg{(}e^{-ip_{1}[(x^{\prime}-(B_{0}+\delta\tau)]}+A_{1}^{*}e^{ip_{1}[(x^{\prime}-(B_{0}+\delta\tau)]}\bigg{)}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}e^{-p_{2}(x-B_{0}-\delta\tau)}\bigg{[}\frac{\sigma^{2}}{V_{0}}p_{1}^{2}\cos
p_{1}(x^{\prime}-B_{0}-\delta\tau)\\\ &-\frac{\sigma^{2}}{V_{0}}p_{1}p_{2}\sin
p_{1}(x^{\prime}-B_{0}-\delta\tau)\bigg{]}\end{split}$ (23)

  * •

$x>B_{0}$, and $x^{\prime}>B_{0}+\delta\tau$

$\begin{split}p_{{\rm
PFBS4}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}A_{2}e^{-p_{2}(x-B_{0})}A_{2}^{*}e^{-p_{2}[(x^{\prime}-(B_{0}+\delta\tau)]}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\frac{\sigma^{2}}{V_{0}}p_{1}^{2}e^{-p_{2}(x+x^{\prime}-2B_{0}-\delta\tau)}\end{split}$
(24)

the option price for $x>B_{0}$ is

$C(x;\tau)|_{x>B_{0}}=\int_{{\rm ln}K}^{B_{0}+\delta\tau}p_{{\rm
PSO3}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)+\int_{B_{0}+\delta\tau}^{+\infty}p_{{\rm
PSO4}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)$ (25)

##  III Floating Double-Barrier Option pricing

Consider the following barriers Kunitomo:1992

$A=A_{0},\ \ \ B(t)=B_{0}e^{\delta t},\ \ \ t\in[0,\tau]$ (26)

where $A$ is the fixed lower bound ($A_{0}<B_{0}$), $B(t)$ is the upper bound
changing with time. We set $\delta>0$, which means the width of barriers
increase with time. Let

$A=e^{a},\ \ \ B(t)=e^{b(t)}$ (27)

and the barriers could be converted into

$a=a_{0},\ \ \ b(t)=b_{0}+\delta t,\ \ \ t\in[0,\tau]$ (28)

where $B_{0}=e^{b_{0}}$. The potential for floating double barrier (FDB)
option is

$V(x)=\left\\{\begin{aligned} \infty&,&x\leq a_{0},\\\
0&,&a_{0}<x<b_{0}+\delta t,\\\ \infty&,&x\geq b_{0}+\delta
t.\end{aligned}\right.$ (29)

and the orthonormal eigenstate is

$\phi_{n}(x)=\left\\{\begin{aligned} \sqrt{\frac{2}{b_{0}-a_{0}+\delta
t}}\sin&[p_{n}(x-a_{0})],&a_{0}<x<b_{0}+\delta t,\\\ 0&,&x<a_{0},\
x>b_{0}+\delta t.\end{aligned}\right.$ (30)

where

$p_{n}=\frac{n\pi}{b_{0}-a_{0}+\delta t}$ (31)

Owing to $p_{n}$ changes with time $t$, we discretize $\tau$ so that there are
$N$ steps to maturity, with each time step is

$\epsilon=\tau/N$ (32)

The pricing kernel could be rewritten as

$\begin{split}P_{\rm FDB}(x,x^{\prime};\epsilon,\tau)&=\braket{x}{e^{-\tau
H_{\rm FDB}}}{x^{\prime}}\\\
&=\lim_{\epsilon\to\infty}\int_{a_{0}}^{b_{0}+\delta\epsilon}{\rm
d}x_{1}\int_{a_{0}}^{b_{0}+2\delta\epsilon}{\rm
d}x_{2}...\int_{a_{0}}^{b_{0}+(N-1)\delta\epsilon}{\rm d}x_{N-1}\times\\\
&\braket{x}{e^{-\epsilon H_{\rm FDB}}}{x_{1}}\braket{x_{1}}{e^{-\epsilon
H_{\rm FDB}}}{x_{2}}...\braket{x_{N-1}}{e^{-\epsilon H_{\rm
FDB}}}{x^{\prime}}\end{split}$ (33)

where $H_{\rm DFB}$ is the same as (9) except that $V(x)$ is defined by (29).
Now we calculate $jth$ matrix element

$\braket{x_{j-1}}{e^{-\epsilon H_{\rm
DFB}}}{x_{j}}=e^{\alpha(x_{j-1}-x_{j})}e^{-\epsilon\gamma}\sum_{n=1}^{+\infty}e^{-\frac{1}{2}\epsilon\sigma^{2}p_{n,j-1}^{2}}\phi_{n}(x_{j-1})\phi_{n}(x_{j})$
(34)

where

$\phi_{n}(x_{j})=\sqrt{\frac{2}{b_{0}-a_{0}+j\delta\epsilon}}\sin\bigg{[}\frac{n\pi}{b_{0}-a_{0}+j\delta\epsilon}(x-a_{0})\bigg{]}$
(35)

similarly

$\begin{split}\braket{x_{j-1}}{e^{-2\epsilon H_{\rm
DFB}}}{x_{j+1}}&=\int_{a_{0}}^{b_{0}+jd\epsilon}{\rm
d}x_{j}\braket{x_{j-1}}{e^{-\epsilon H_{\rm
DFB}}}{x_{j}}\braket{x_{j}}{e^{-\epsilon H_{\rm DFB}}}{x_{j+1}}\\\
&=\int_{a_{0}}^{b_{0}+jd\epsilon}{\rm
d}x_{j}e^{\alpha(x_{j-1}-x_{j+1})}e^{-2\epsilon\gamma}\sum_{n=1}^{+\infty}\sum_{n^{\prime}=1}^{+\infty}e^{-\frac{1}{2}\epsilon\sigma^{2}(p_{n,j-1}^{2}+p_{n^{\prime},j}^{2})}\times\\\
&\phi_{n}(x_{j-1})\phi_{n}(x_{j})\phi_{n^{\prime}}(x_{j})\phi_{n^{\prime}}(x_{j+1})\\\
&=e^{\alpha(x_{j-1}-x_{j+1})}e^{-2\epsilon\gamma}\sum_{n=1}^{+\infty}e^{-\frac{1}{2}\epsilon\sigma^{2}n^{2}\pi^{2}\big{(}\frac{1}{(b_{0}-a_{0}+(j-1)\delta\epsilon)^{2}}+\frac{1}{(b_{0}-a_{0}+j\delta\epsilon)^{2}}\big{)}}\phi_{n}(x_{j-1})\phi_{n}(x_{j+1})\end{split}$
(36)

where the orthonormalization condition

$\int_{a_{0}}^{b_{0}+jd\epsilon}{\rm
d}x_{j}\phi_{n}(x_{j})\phi_{n^{\prime}}(x_{j})=\delta_{nn^{\prime}}=\left\\{\begin{aligned}
0&,&n\neq n^{\prime},\\\ 1&,&n=n^{\prime}.\end{aligned}\right.$ (37)

has been used. After some similar calculation, the pricing kernel(33) could be
denoted as

$\begin{split}P_{\rm DFB}(x,x^{\prime};\epsilon,\tau)&=\braket{x}{e^{-\tau
H_{\rm FDB}}}{x^{\prime}}\\\
&=e^{\alpha(x-x^{\prime})}e^{-\tau\gamma}\sum_{n=1}^{+\infty}e^{-\frac{1}{2}\sigma^{2}n^{2}\pi^{2}\lim\limits_{N\to\infty}\epsilon\sum_{j=0}^{N-1}\frac{1}{(b_{0}-a_{0}+j\delta\epsilon)^{2}}}\times\\\
&\sqrt{\frac{2}{b_{0}-a_{0}}}\sqrt{\frac{2}{b_{0}-a_{0}+\delta\tau}}\sin\bigg{[}\frac{n\pi}{b_{0}-a_{0}}(x-a_{0})\bigg{]}\sin\bigg{[}\frac{n\pi}{b_{0}-a_{0}+\delta\tau}(x-a_{0})\bigg{]}\end{split}$
(38)

where the summation in the exponential could be calculated as follow

$\begin{split}\sum_{j=0}^{N-1}\epsilon\frac{1}{(b_{0}-a_{0}+j\delta\epsilon)^{2}}&=\frac{1}{\delta^{2}\epsilon}\sum_{j=0}^{N-1}\frac{1}{\big{(}j+\frac{b_{0}-a_{0}}{\delta\epsilon}\big{)}^{2}}\\\
&=\frac{1}{\delta^{2}\epsilon}\bigg{[}\sum_{j=0}^{+\infty}\frac{1}{\big{(}j+\frac{b_{0}-a_{0}}{\delta\epsilon}\big{)}^{2}}-\sum_{j=N}^{+\infty}\frac{1}{\big{(}j+\frac{b_{0}-a_{0}}{\delta\epsilon}\big{)}^{2}}\bigg{]}\\\
&=\frac{1}{\delta^{2}\epsilon}\bigg{[}\sum_{j=0}^{+\infty}\frac{1}{\big{(}j+\frac{b_{0}-a_{0}}{\delta\epsilon}\big{)}^{2}}-\sum_{k=0}^{+\infty}\frac{1}{\big{(}k+\frac{b_{0}-a_{0}}{\delta\epsilon}+N\big{)}^{2}}\bigg{]}\\\
&=\frac{1}{\delta^{2}\epsilon}\bigg{[}\psi^{\prime}\bigg{(}\frac{b_{0}-a_{0}}{\delta\epsilon}\bigg{)}-\psi^{\prime}\bigg{(}\frac{b_{0}-a_{0}}{\delta\epsilon}+N\bigg{)}\bigg{]}\end{split}$
(39)

where

$\psi(z)=\frac{\Gamma^{\prime}(z)}{\Gamma(z)}$ (40)

is the $\psi$ function, and

$\Gamma(z)=\int_{0}^{\infty}e^{-t}t^{z-1}{\rm d}t,\ \ {\rm Re}z>0$ (41)

is the $\Gamma$ function.

##  IV Proportional Floating Double-Barrier Step Option pricing

The price changing of a proportional floating double-barrier step (PFDBS)
option could be analogous to a particle moving in a symmetric square potential
well with the potential

$V(x)=\left\\{\begin{aligned} 0&,&a_{0}<x<b_{0}+\delta t,\\\ V_{0}&,&x\leq
a_{0},\ x\geq b_{0}+\delta t.\end{aligned}\right.$ (42)

where the lower barrier is fixed at $a_{0}$, and the upper barrier level
increases with time ($\delta>0$). For $x\leq a_{0}$ or $x\geq b_{0}+\delta t$,
the wave function decays with the increasing distances from the well, which is
similar to an option touches a barrier and knocks out gradually. The
Hamitonian $H_{\rm PFDBS}$ is the same as (9) except that $V(x)$ is defined by
(42). The stationary state Schrödinger equation for option price is

$\left\\{\begin{aligned} &-\frac{\sigma^{2}}{2}\frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+\gamma\phi=E\phi,&a_{0}<x<b_{0}+\delta t,\\\
&-\frac{\sigma^{2}}{2}\frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+(\gamma+V_{0})\phi=E\phi,&x<a_{0},\ x>b_{0}+\delta
t.\end{aligned}\right.$ (43)

where $\phi$ is the option price wave function, $E$ is corresponding to bound
state energy levels in the potential well. (LABEL:schrodingereq) could be
simplified into

$\left\\{\begin{aligned} \frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+k_{1}^{2}\phi=0&,&a_{0}<x<b_{0}+\delta t,\\\ \frac{{\rm
d}^{2}\phi}{{\rm d}x^{2}}-k_{2}^{2}\phi=0&,&x<a_{0},\ x>b_{0}+\delta
t.\end{aligned}\right.$ (44)

where

$k_{1}^{2}=\frac{2(E-\gamma)}{\sigma^{2}},\ \
k_{2}^{2}=\frac{2(V_{0}+\gamma-E)}{\sigma^{2}}$ (45)

the corresponding eigenwave function is

$\phi(x,t)=\left\\{\begin{aligned} A_{3}\ e^{k_{2}(x-\frac{b_{0}+a_{0}+\delta
t}{2})}&,&x\leq a_{0},\\\ A_{1}\sin(k_{1}x+\xi)&,&a_{0}t<x\leq b_{0}+\delta
t,\\\ A_{2}\ e^{-k_{2}(x-\frac{b_{0}+a_{0}+\delta t}{2})}&,&x>b_{0}+\delta
t.\end{aligned}\right.$ (46)

Considering the continuity for both wave function and its derivative at
$x=a_{0}$ and $x=b_{0}+\delta t$, we have

$\delta=\frac{\ell\pi}{2}-k_{1}\frac{b_{0}+a_{0}+\delta t}{2},\ \
\ell=0,1,2,...$ (47)

and (46) could be split into two parts

$\phi_{1}(x,t)=\left\\{\begin{aligned}
&-A_{21}e^{k_{2}(x-\frac{b_{0}+a_{0}+\delta t}{2})},&x\leq a_{0},\\\
&A_{1}\sin k_{1}\left(x-\frac{b_{0}+a_{0}+\delta t}{2}\right),&a_{0}\leq x\leq
b_{0}+\delta t,\\\ &A_{21}e^{-k_{2}(x-\frac{b_{0}+a_{0}+\delta
t}{2})},&x>b_{0}+\delta t.\end{aligned}\right.\ \ \ \ for\ \ \ell=0,2,4,...$
(48)

and

$\phi_{2}(x,t)=\left\\{\begin{aligned}
&A_{22}e^{k_{2}(x-\frac{b_{0}+a_{0}+\delta t}{2})},&x\leq a_{0},\\\ &A_{1}\cos
k_{1}\left(x-\frac{b_{0}+a_{0}+\delta t}{2}\right),&a_{0}\leq x\leq
b_{0}+\delta t,\\\ &A_{22}e^{-k_{2}(x-\frac{b_{0}+a_{0}+\delta
t}{2})},&x>b_{0}+\delta t.\end{aligned}\right.\ \ \ \ for\ \ \ell=1,3,5,...$
(49)

where

$\begin{split}A_{1}&=\sqrt{\frac{2k_{2}}{k_{2}(b_{0}-a_{0}+\delta t)+2}},\ \
A_{21}=A_{1}\sin\frac{k_{1}(b_{0}-a_{0}+\delta
t)}{2}e^{k_{2}\frac{b_{0}-a_{0}+\delta t}{2}},\ \ \\\
A_{22}&=A_{1}\cos\frac{k_{1}(b_{0}-a_{0}+\delta
t)}{2}e^{k_{2}\frac{b_{0}-a_{0}+\delta t}{2}}\end{split}$ (50)

the normalization condition has been used. Considering boundary conditions for
(48) and (49) at $x=b_{0}+\delta t$ respectively, we have

$\cot\frac{k_{1}(b_{0}-a_{0}+\delta t)}{2}=-\frac{k_{2}}{k_{1}}$ (51)
$\tan\frac{k_{1}(b_{0}-a_{0}+\delta t)}{2}=\frac{k_{2}}{k_{1}}$ (52)

let

$\beta=\sqrt{k_{1}^{2}+k_{2}^{2}}=\frac{\sqrt{2V_{0}}}{\sigma}$ (53)

(51) and (52) could be combined into

$k_{1n}\frac{b_{0}-a_{0}+\delta
t}{2}=\frac{n\pi}{2}-\arcsin{\frac{k_{1n}}{\beta}},\ \ n=1,2,3,...$ (54)

(54) is the energy level equation. In general, there is no analytical solution
for energy eigenvalues, yet the approximate expression could be derived . For
low energy levels ($k_{1n}\ll\beta$),
$\arcsin{({k_{1n}}/\beta)}\approx{k_{1n}}/\beta$, (54) could be simplified
into

$k_{1n,{\rm low}}\approx\frac{\beta n\pi}{\beta(b_{0}-a_{0}+\delta t)+2}$ (55)

for high energy levels ($k_{1n}\approx\beta$),
$\arcsin{{(1-{k_{1n}}}/\beta)}\approx\pi/2-\sqrt{2{k_{1n}}/\beta}$, (54) could
be simplified into

$k_{1n,{\rm high}}\frac{b_{0}-a_{0}+\delta
t}{2}\approx\frac{(n-1)\pi}{2}+\sqrt{2-\frac{2(n-1)\pi}{\beta(b_{0}-a_{0}+\delta
t)}}$ (56)

Now we calculate the expressions of option pricing kernels. The maximum number
of energy levels is determined by

$n_{\rm max}=\bigg{[}\frac{\beta(b_{0}-a_{0}+\delta t)}{\pi}\bigg{]}$ (57)

the bracket [ ] represents the minimal integer not less than
${\beta(b_{0}-a_{0}+\delta t)}/{\pi}$. (57)indicates that $n_{\rm max}$
increases with time. We assume that there are $n_{0}$ energy levels during
($0,\tau_{1}$), $(n_{0}+1)$ energy levels during ($\tau_{1},\tau_{2}$),…,
$(n_{0}+N)$ energy levels during ($\tau_{N},\tau$), and

$0<\tau_{1}<\tau_{2}<...<\tau_{N}<\tau$ (58)

the pricing kernel could be denoted as

$\begin{split}\braket{x}{e^{-\tau H_{\rm
PFDBS}}}{x^{\prime}}&=\int_{-\infty}^{+\infty}{\rm
d}x_{1}\int_{-\infty}^{+\infty}{\rm d}x_{2}...\int_{-\infty}^{+\infty}{\rm
d}x_{N}\braket{x}{e^{-\tau_{1}H_{\rm
PFDBS}}}{x_{1}}\braket{x_{1}}{e^{-(\tau_{2}-\tau_{1})H_{\rm
PFDBS}}}{x_{2}}\times\\\ &...\times\braket{x_{N}}{e^{-(\tau-\tau_{N})H_{\rm
PFDBS}}}{x^{\prime}}\end{split}$ (59)

according to (38), the pricing kernel for ($\tau_{i},\tau_{i+1}$) is

$\begin{split}\braket{x_{i}}{e^{-(\tau_{i+1}-\tau_{i})H_{\rm
PFDBS}}}{x_{i+1}}&=e^{\alpha(x_{i+1}-x_{i})}e^{-(\tau_{i+1}-\tau_{i})\gamma}\sum_{n=1}^{n_{0}+i}e^{-\frac{1}{2}\sigma^{2}\lim\limits_{\epsilon\to
0}\epsilon\sum\limits_{j=0}\limits^{(\tau_{i+1}-\tau_{i})/\epsilon}(k_{1n,j\epsilon})^{2}}\phi(x_{1},\tau_{i})\phi(x_{2},\tau_{i+1})\\\
&=e^{\alpha(x_{i+1}-x_{i})}e^{-(\tau_{i+1}-\tau_{i})\gamma}\bigg{[}\sum_{n=2,4,...}e^{-\frac{1}{2}\sigma^{2}\lim\limits_{\epsilon\to
0}\epsilon\sum\limits_{j=0}\limits^{(\tau_{i+1}-\tau_{i})/\epsilon}(k_{1n,j\epsilon})^{2}}\phi_{1}(x_{1},\tau_{i})\phi_{1}(x_{2},\tau_{i+1})+\\\
&\sum_{n=1,3,...}e^{-\frac{1}{2}\sigma^{2}\lim\limits_{\epsilon\to
0}\epsilon\sum\limits_{j=0}\limits^{(\tau_{i+1}-\tau_{i})/\epsilon}(k_{1n,j\epsilon})^{2}}\phi_{2}(x_{1},\tau_{i})\phi_{2}(x_{2},\tau_{i+1})\bigg{]}\end{split}$
(60)

where $n_{0}$ is the number of energy levels for ($0,\tau_{1}$),
$\phi_{1}(x,t)$ and $\phi_{2}(x,t)$ are given by (48) and (49), respectively.
The definition of tiny time interval $\epsilon$ is the same as (32). For low
energy levels, the summation in the exponent during an arbitrary time interval
($\tau_{i},\tau_{i+1}$) could be calculated as

$\begin{split}\epsilon\sum_{j=0}^{(\tau_{i+1}-\tau_{i})/\epsilon}(k_{1n,j\epsilon,{\rm
low}})^{2}&=\beta^{2}n^{2}\pi^{2}\epsilon\sum_{j=0}^{(\tau_{i+1}-\tau_{i})/\epsilon}\frac{1}{[\beta(b_{0}-a_{0}+\delta\tau_{i}+j\delta\epsilon)+2]^{2}}\\\
&=\frac{n^{2}\pi^{2}}{\delta^{2}\epsilon}\sum_{j=0}^{(\tau_{i+1}-\tau_{i})/\epsilon}\frac{1}{\big{[}j+\frac{\beta(b_{0}-a_{0}+\delta\tau_{i})+2}{\beta\delta\epsilon}\big{]}^{2}}\\\
&=\frac{n^{2}\pi^{2}}{\delta^{2}\epsilon}\bigg{[}\psi^{\prime}\bigg{(}\frac{\beta(b_{0}-a_{0}+\delta\tau_{i})+2}{\beta\delta\epsilon}\bigg{)}-\psi^{\prime}\bigg{(}\frac{\beta(b_{0}-a_{0}+\delta\tau_{i})+2}{\beta\delta\epsilon}+\frac{\tau_{i+1}-\tau_{i}}{\epsilon}+1\bigg{)}\bigg{]}\end{split}$
(61)

for high energy levels, the expression is

$\epsilon\sum_{j=0}^{N-1}(k_{1n,j\epsilon,{\rm
high}})^{2}=\epsilon\sum_{j=0}^{(\tau_{i+1}-\tau_{i})/\epsilon}\bigg{[}\frac{2}{b_{0}-a_{0}+\delta\tau_{i}+j\delta\epsilon}\bigg{(}\frac{(n-1)\pi}{2}+\sqrt{2-\frac{2(n-1)\pi}{\beta(b_{0}-a_{0}+\delta\tau_{i}+j\delta\epsilon)}}\bigg{)}\bigg{]}^{2}$
(62)

in fact, the contribution to option price from large $n$ is negligible. We
will only take low energy levels into account in the following section. The
option price could be denoted as

$C_{\rm PFDBS}(x;\tau_{1},\tau_{2},...,\tau)=\int_{{\rm ln}K}^{+\infty}{\rm
d}x^{\prime}\braket{x}{e^{-\tau H_{\rm PFDBS}}}{x^{\prime}}(e^{x^{\prime}}-K)$
(63)

where $K$ is the exercise price.

##  V Numerical Results

In Fig. 1, we show the proportional floating barrier step call price and the
proportional floating double-barrier step call price as functions of
underlying price, respectively, where the floating rate $\delta$ is set to
0.01. The dashed lines are corresponding to fixed barrier cases for
comparison. It is shown that the option prices decrease with the increasing of
potential $V_{0}$ for both the two diagrams. In the limit $V_{0}\to\infty$,
the option payoff tends to be the payoff of a standard step option (left) or
of a standard double-barrier step option.

Figure 1: Proportional floating barrier step call price (left) and
proportional floating double-barrier step call price (right) as functions of
underlying asset price for different potentials, respectively. The dashed
lines indicate the corresponding fixed barrier cases for comparison.
Parameters: $a={\rm ln}100=4.5$, $b={\rm ln}130=4.867$, $S=100$, $r=0.05$,
$\sigma=0.3$, $\tau=1$, $\delta=0.01$.

In Fig. 2, we show the proportional floating barrier step call price (left)
and the proportional floating double-barrier step call price (right) as
functions of floating rate $\delta$. For a fixed $V_{0}$, the option price
increases with the increasing of the floating rate $\delta$.

Figure 2: Proportional floating barrier step call price (left) and
proportional floating double-barrier step call price (right) as functions of
floating rate $\delta$ for different potentials, respectively. Parameters:
$a={\rm ln}100=4.5$, $b={\rm ln}130=4.867$, $S=100$, $r=0.05$, $\sigma=0.3$,
$K=100$, $\tau=1$.

In Fig. 3, we show the proportional floating barrier step call price (left)
and the proportional floating double-barrier step call price (right) as
functions of exercise price. The dashed lines are corresponding to fixed
barrier cases for comparison. It is shown that the option prices decrease with
the increasing of exercise price.

Figure 3: Proportional floating barrier step call price (left) and
proportional floating double-barrier step call price (right) as functions of
exercise price . Parameters: $a={\rm ln}100=4.5$, $b={\rm ln}130=4.867$,
$S=100$, $r=0.05$, $\sigma=0.3$, $\tau=1$, $\delta=0.01$.

In Fig. 4, we show the proportional floating barrier step call price (left)
and the proportional floating double-barrier step call price (right) as
functions of fixed interest rate. The dashed lines are corresponding to fixed
barrier cases for comparison. In the limit $V_{0}\to\infty$, the option payoff
tends to be the payoff of a standard step option (left) or of a standard
double-barrier step option.

Figure 4: Proportional floating barrier step call price (left) and
proportional floating double-barrier step call price (right) as functions of
fixed interest rate . Parameters: $a={\rm ln}100=4.5$, $b={\rm ln}130=4.867$,
$S=100$, , $\sigma=0.3$, $\tau=1$, $K=100$,$\delta=0.01$.

In Fig. 5, we show the proportional floating barrier step call delta (left)
and the proportional floating double barrier step call delta (right) as
functions of the underlying price. The definition of delta is

$\Delta=\frac{\partial C}{\partial S}=e^{-x}\frac{\partial C}{\partial x}$
(64)

the dashed lines are corresponding to the fixed barrier cases for comparison,
respectively.

Figure 5: Proportional floating barrier step call price (left) and
proportional floating double-barrier step call price (right) as functions of
underlying price . Parameters: $a={\rm ln}100=4.5$, $B=b={\rm ln}130=4.867$,
$S=100$, $K=100$, $r=0.05$, $\sigma=0.3$, $\tau=1$, $\delta=0.01$.

##  VI Conclusion

Path-integral is an effective method linking option price changing to a
particle moving under some potential in the space. Here we have studied
pricing of the proportional floating barrier step call option and the
proportional floating double-barrier step call option, which could be
analogous to a particle moving through a trapezoid potential barrier or a
symmetric square potential well, respectively. We have presented option prices
changing with the initial underlying prices, floating rates, interest rates
and exercise prices, respectively. The numerical results are in accordance
with the results using mathematical method in Linetsky:2001 ; Linetsky:1999 .
The pricing of other barrier options could be studied by defining appropriate
potentials $V$.

##  Appendix A Path Integral Method for Black-Scholes Model Pricing

According to Ref Baaquie:2004 , starting from Black-Scholes pricing formula,
the price of European option can be derived by path integral method. The
Black-Scholes formula is

$\frac{\partial C}{\partial t}+rS\frac{\partial C}{\partial
S}+\frac{1}{2}\sigma^{2}S^{2}\frac{\partial^{2}C}{\partial S^{2}}=0$ (65)

where $C$ is European option price, $S$ is the underlying asset price,
$\sigma$ is the fixed volatility, and $r$ is the interest rate. Let

$S=e^{x},\ \ (-\infty<x<+\infty)$ (66)

and (65) can be denoted as

$\frac{\partial C}{\partial
t}=\bigg{[}-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)+r\bigg{]}C$ (67)

let

$H_{\rm BS}=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial x}+r$ (68)

the Black-Scholes equation is written as

$\frac{\partial C}{\partial t}=H_{\rm BS}C$ (69)

Comparing (69) to Schrödinger equation, we have

$\sigma^{2}\sim\frac{1}{m^{2}},\ \ C\sim\psi(x)$ (70)

where $m$ is the particle mass, and $\psi(x)$ is the wave function. The Black-
Scholes Hamitonian (68) in momentum representation can be denoted as

$H_{\rm
BS}=\frac{1}{2}\sigma^{2}p^{2}+i\left(\frac{1}{2}\sigma^{2}-r\right)p+r$ (71)

where $p=-i\frac{\partial}{\partial x}$. The pricing kernel is

$\begin{split}\braket{x}{e^{-\tau H_{\rm
BS}}}{x^{\prime}}&=\int_{-\infty}^{+\infty}\frac{{\rm
d}p}{2\pi}\braket{x}{e^{-\tau H_{\rm BS}}}{p}\braket{p}{x^{\prime}}\\\
&=e^{-r\tau}\int_{-\infty}^{+\infty}\frac{{\rm
d}p}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}\left(p-\frac{x^{\prime}-x_{0}}{\tau\sigma^{2}}\right)^{2}-\frac{(x^{\prime}-x_{0})^{2}}{2\tau\sigma^{2}}}\\\
&=\frac{1}{\sqrt{2\pi\tau\sigma^{2}}}e^{-r\tau}e^{-\frac{1}{2\tau\sigma^{2}}(x^{\prime}-x_{0})^{2}}\end{split}$
(72)

where the completeness relation has been used, and

$x_{0}=x+\tau\left(r-\frac{\sigma^{2}}{2}\right)$ (73)

The European call option price can be denoted as

$\begin{split}C(x,\tau)&=e^{-r\tau}\int_{-\infty}^{+\infty}\frac{{\rm
d}x^{\prime}}{\sqrt{2\pi\tau\sigma^{2}}}(e^{x^{\prime}}-K)_{+}e^{-\frac{1}{2\tau\sigma^{2}}(x^{\prime}-x_{0})^{2}}\\\
&=e^{-r\tau}\int_{\ln{K}-x_{0}}^{+\infty}\frac{{\rm
d}x^{\prime}}{\sqrt{2\pi\tau\sigma^{2}}}(e^{x^{\prime}+x_{0}}-K)e^{-\frac{1}{2\tau\sigma^{2}}{x^{\prime}}^{2}}\\\
&=SN(d_{+})-e^{-r\tau}KN(d_{-})\end{split}$ (74)

where

$N(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x}e^{-\frac{1}{2}z^{2}}{\rm d}z,\ \
d_{\pm}=\frac{\ln{\frac{S}{K}}+\left(r\pm\frac{\sigma^{2}}{2}\right)\tau}{\sigma\sqrt{\tau}}$
(75)

##  Appendix B Path Integral Method for the Standard Barrier Option Pricing

The up-and-out standard barrier (UOSB) option Hamiltonian is

$\begin{split}H_{\rm UOSB}&=H_{\rm BS}+V(x)\\\
&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{\sigma^{2}}{2}-r\right)\frac{\partial}{\partial
x}+r+V(x)\\\ &=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}+V(x)\end{split}$ (76)

where

$\alpha=\frac{1}{\sigma^{2}}\left(\frac{\sigma^{2}}{2}-r\right),\ \
\gamma=\frac{1}{2\sigma^{2}}\left(\frac{\sigma^{2}}{2}+r\right)^{2}$ (77)

and the potential $V(x)$ is

$V(x)=\left\\{\begin{aligned} 0&,&x<B,\\\ \infty&,&x\geq
B.\end{aligned}\right.$ (78)

the corresponding wave function is

$C(x)=\left\\{\begin{aligned} &e^{ip(x-B)}-e^{-ip(x-B)},&x<B,\\\ &0,&x\geq
B.\end{aligned}\right.$ (79)

and the pricing kernel is

$\begin{split}p_{\rm UOSB}(x,x^{\prime};\tau)&=\braket{x}{e^{-\tau
H_{DB}}}{x^{\prime}}\\\
&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\infty}\frac{{\rm
d}p}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p^{2}}\big{[}e^{ip(x-B)}-e^{-ip(x-B)}\big{]}\big{[}e^{-ip(x^{\prime}-B)-e^{ip(x^{\prime}-B)}}\big{]}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\infty}\frac{{\rm
d}p}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p^{2}}[\cos(p(x-x^{\prime}))-\cos(p(x+x^{\prime}-2B))]\end{split}$
(80)

the corresponding option price

$\begin{split}C_{\rm UOSB}(x;\tau)&=\int_{{\rm ln}K}^{B}{\rm
d}x^{\prime}p_{\rm UOSB}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)\\\
&=2e^{-\tau\gamma}\int_{{\rm ln}K}^{B}{{\rm
d}x^{\prime}}e^{\alpha(x-x^{\prime})}\int_{0}^{\infty}\frac{{\rm
d}p}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p^{2}}[\cos(p(x-x^{\prime}))-\cos(p(x+x^{\prime}-2B))](e^{x^{\prime}}-K)\end{split}$
(81)

##  Appendix C Path Integral Method for the Standard Double-Barrier Option
Pricing

The standard double-barrier (SDB) option Hamiltonian is Baaquie:2004

$\begin{split}H_{\rm SDB}&=H_{\rm BS}+V(x)\\\
&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{\sigma^{2}}{2}-r\right)\frac{\partial}{\partial
x}+r+V(x)\\\ &=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}+V(x)\end{split}$ (82)

where

$\alpha=\frac{1}{\sigma^{2}}\left(\frac{\sigma^{2}}{2}-r\right),\ \
\gamma=\frac{1}{2\sigma^{2}}\left(\frac{\sigma^{2}}{2}+r\right)^{2}$ (83)

and the potential $V(x)$ is

$V(x)=\left\\{\begin{aligned} \infty&,&x\leq a,\\\ 0&,&a<x<b,\\\
\infty&,&x\geq b.\end{aligned}\right.$ (84)

the corresponding eigenstate is

$\phi_{n}(x)=\left\\{\begin{aligned}
\sqrt{\frac{n\pi}{b-a}}\sin&[p_{n}(x-a)],&a<x<b,\\\ 0&,&x<a,\
x>b.\end{aligned}\right.$ (85)

where

$p_{n}=\frac{n\pi}{b-a},\ \ E_{n}=\frac{1}{2}\sigma^{2}p_{n}^{2},\ \
n=1,2,3,...$ (86)

The pricing kernel is

$\begin{split}p_{\rm SDB}(x,x^{\prime};\tau)&=\braket{x}{e^{-\tau
H_{DB}}}{x^{\prime}}\\\
&=e^{\alpha(x-x^{\prime})}\braket{x}{e^{-\tau\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma+V\right)}}{x^{\prime}}\\\
&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\sum_{n=1}^{+\infty}e^{-\frac{1}{2}\tau\sigma^{2}p_{n}^{2}}\phi_{n}(x)\phi_{n}(x^{\prime})\end{split}$
(87)

and the option price

$\begin{split}C_{\rm SDB}(x;\tau)&=\int_{{\rm ln}K}^{b}{\rm d}x^{\prime}p_{\rm
SDB}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)\\\
&=\frac{2}{b-a}e^{-\tau\gamma}\int_{{\rm ln}K}^{b}{\rm
d}x^{\prime}e^{\alpha(x-x^{\prime})}\sum_{n=1}^{+\infty}e^{-\frac{1}{2}\tau\sigma^{2}\frac{n^{2}\pi^{2}}{(b-a)^{2}}}\sin\frac{n\pi(x-a)}{b-a}\sin\frac{n\pi(x^{\prime}-a)}{b-a}(e^{x^{\prime}}-K)\end{split}$
(88)

##  Appendix D Path Integral Method for Proportional Step Option Pricing

An up-and-out proportional step option price changing could be analogous to a
one-dimensional particle moving under the following potential

$V(x)=\left\\{\begin{aligned} 0&,&x<B,\\\ V_{0}&,&x\geq
B.\end{aligned}\right.$ (89)

for $x\leq B$, the wave function decays as the distance increases in the case
of the particle energy $E<V_{0}$, which is similar to an option touches a
barrier at $x=B$ and knocks out gradually. Making the following variable
substitution Baaquie

$S=e^{x},\ x\in(-\infty,+\infty)$ (90)

the Hamiltonian for a proportional step option (PSO) is

$H_{\rm PSO}=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial x}+r+V(x)$
(91)

where $S$ is the underlying asset price, $r$ is the fixed interest rate, and
$\sigma$ is the volatility. The Hamiltonian (91) is non-Hermitian, considering
the following transformation

$H_{\rm PSO}=e^{\alpha x}H_{\rm eff}e^{-\alpha x}=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}+V(x)$ (92)

where

$\alpha=\frac{1}{\sigma^{2}}\left(\frac{\sigma^{2}}{2}-r\right),\ \
\gamma=\frac{1}{2\sigma^{2}}\left(\frac{\sigma^{2}}{2}+r\right)^{2}$ (93)

and $H_{\rm eff}$ is Hermitian. The stationary state Schrödinger equation for
option price under $\rm H_{eff}$ is

$\left\\{\begin{aligned} -\frac{\sigma^{2}}{2}\frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+\gamma\phi=E\phi&,&x<B,\\\ -\frac{\sigma^{2}}{2}\frac{{\rm
d}^{2}\phi}{{\rm d}x^{2}}+(\gamma+V_{0})\phi=E\phi&,&x\geq
B.\end{aligned}\right.$ (94)

where $\phi$ is the stationary state wave function of the option, and $E$ is
corresponding to the option energy under the potential (89). The Schrödinger
equation above could be simplified into

$\left\\{\begin{aligned} \frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+p_{1}^{2}\phi=0&,&x<B,\\\ \frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}-p_{2}^{2}\phi=0&,&x\geq B.\end{aligned}\right.$ (95)

where

$p_{1}^{2}=\frac{2(E-\gamma)}{\sigma^{2}},\ \
p_{2}^{2}=\frac{2(V_{0}+\gamma-E)}{\sigma^{2}}$ (96)

here the condition $E<V_{0}$ has been considered, and the range of $p_{1}^{2}$
and $p_{2}^{2}$ is

$\begin{split}p_{2}^{2}&>\frac{2\gamma}{\sigma^{2}}\\\
p_{1}^{2}&=\frac{2V_{0}}{\sigma^{2}}-p_{2}^{2}<\frac{2(V_{0}-\gamma)}{\sigma^{2}}\end{split}$
(97)

The general solution for (95) is

$\phi(x)=\left\\{\begin{aligned}
e^{ip_{1}(x-B)}&+A_{1}e^{-ip_{1}(x-B)}&,&x<B,\\\ &A_{2}e^{-p_{2}(x-B)}&,&x\leq
B.\end{aligned}\right.$ (98)

where

$A_{1}=\frac{p_{1}-ip_{2}}{p_{1}+ip_{2}},\ \
A_{2}=\frac{2p_{1}}{p_{1}+ip_{2}}$ (99)

here the boundary condition at $x=B$ is used. Now we calculate the price of
up-and-out proportional step call. Let $\tau_{1}$ indicates the occupation
time below the barrier $B$, and $\tau_{2}$ is the occupation time above the
barrier $B$. The pricing kernel is

$\begin{split}p_{\rm
PSO}(x,x^{\prime};\tau)&=\braket{x}{e^{-\tau_{1}H_{1}-\tau_{2}H_{2}}}{x^{\prime}}\\\
&=e^{\alpha(x-x^{\prime})}\int\frac{{\rm
d}p}{2\pi}\braket{x}{e^{-\tau_{1}H_{\rm
eff1}}}{p}\braket{p}{e^{-\tau_{2}H_{\rm eff_{2}}}}{x^{\prime}}\end{split}$
(100)

and the option price is

$C(x;\tau)=\int_{{\rm ln}K}^{+\infty}{\rm d}x^{\prime}p_{\rm
PSO}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)$ (101)

where $K$ is the exercise price, and

$\begin{split}H_{1}&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial x}+r\\\
H_{2}&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial
x}+r+V_{0}\\\ H_{\rm eff1}&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\\\ H_{\rm
eff2}&=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma+V_{0}\end{split}$ (102)

We set the exercise price $K<e^{B}$. For $x<B$ and $x>B$, the wave functions
are different, and the integral for (101) should be split into four cases

  * •

$x<B$, and ${\rm ln}K<x^{\prime}<B$

the pricing kernel

$\begin{split}p_{{\rm
PSO1}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{(}e^{ip_{1}(x-B)}+A_{1}e^{-ip_{1}(x-B)}\bigg{)}\times\\\
&\bigg{(}e^{-ip_{1}(x^{\prime}-B)}+A_{1}^{*}e^{ip_{1}(x^{\prime}-B)}\bigg{)}\\\
&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{[}2\cos
p_{1}(x-x^{\prime})+\frac{\sigma^{2}}{V_{0}}(p_{1}^{2}-p_{2}^{2})\cos
p_{1}(x+x^{\prime}-2B)-\\\ &\frac{2\sigma^{2}}{V_{0}}p_{1}p_{2}\sin
p_{1}(x+x^{\prime}-2B)\bigg{]}\end{split}$ (103)

  * •

$x<B$, and $x^{\prime}>B$

the pricing kernel

$\begin{split}p_{{\rm
PSO2}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{(}e^{ip_{1}(x-B)}+A_{1}e^{-ip_{1}(x-B)}\bigg{)}A_{2}^{*}e^{-p_{2}(x^{\prime}-B)}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\bigg{[}\frac{\sigma^{2}}{V_{0}}p_{1}^{2}\cos
p_{1}(x-B)-\frac{\sigma^{2}}{V_{0}}p_{1}p_{2}\sin p_{1}(x-B)\bigg{]}\times\\\
&e^{-p_{2}(x^{\prime}-B)}\end{split}$ (104)

the option price for $x<B$ is

$C(x;\tau)|_{x<B}=C_{1}(x;\tau)+C_{2}(x;\tau)$ (105)

where

$\begin{split}C_{1}(x,\tau)&=\int_{{\rm ln}K}^{B}p_{{\rm
PSO1}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)\\\
C_{2}(x,\tau)&=\int_{B}^{+\infty}p_{{\rm
PSO2}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)\end{split}$ (106)

  * •

$x>B$, and ${\rm ln}K<x^{\prime}<B$

the pricing kernel

$\begin{split}p_{{\rm
PSO3}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}A_{2}e^{-p_{2}(x-B)}\bigg{(}e^{-ip_{1}(x^{\prime}-B)}+A_{1}^{*}e^{ip_{1}(x^{\prime}-B)}\bigg{)}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}e^{-p_{2}(x-B)}\bigg{[}\frac{\sigma^{2}}{V_{0}}p_{1}^{2}\cos
p_{1}(x^{\prime}-B)\\\ &-\frac{\sigma^{2}}{V_{0}}p_{1}p_{2}\sin
p_{1}(x^{\prime}-B)\bigg{]}\end{split}$ (107)

  * •

$x>B$, and $x^{\prime}>B$

$\begin{split}p_{{\rm
PSO4}}(x,x^{\prime};\tau)&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}A_{2}e^{-p_{2}(x-B)}A_{2}^{*}e^{-p_{2}(x^{\prime}-B)}\\\
&=2e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\int_{0}^{\frac{\sqrt{2(V_{0}-\gamma)}}{\sigma}}\frac{{\rm
d}p_{1}}{2\pi}e^{-\frac{1}{2}\tau\sigma^{2}p_{1}^{2}}\frac{\sigma^{2}}{V_{0}}p_{1}^{2}e^{-p_{2}(x+x^{\prime}-2B)}\end{split}$
(108)

the option price for $x>B$ is

$C(x;\tau)|_{x>B}=C_{3}(x;\tau)+C_{4}(x;\tau)$ (109)

where

$\begin{split}C_{3}(x,\tau)&=\int_{{\rm ln}K}^{B}p_{{\rm
PSO3}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)\\\
C_{4}(x,\tau)&=\int_{B}^{+\infty}p_{{\rm
PSO4}}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)\end{split}$ (110)

##  Appendix E Path Integral Method for Proportional Double-Barrier Step
Option Pricing

The price changing of a proportional double-barrier step (PDBS) option could
be analogous to a particle moving in a symmetric square potential well with
the potential

$V(x)=\left\\{\begin{aligned} 0&,&a<x<b,\\\ V_{0}&,&x<a,\
x>b.\end{aligned}\right.$ (111)

for $x<a$ or $x>b$, the wave function decays with the increasing distances
from the well, which is similar to an option touches a barrier and knocks out
gradually. The Hamitonian for a double-barrier step option is Baaquie

$H_{\rm PDBS}=-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\left(\frac{1}{2}\sigma^{2}-r\right)\frac{\partial}{\partial x}+r+V(x)$
(112)

which is a non-Hermitian Hamitonian. Considering the following transformation

$H_{\rm PDBS}=e^{\alpha x}H_{\rm{eff}}e^{-\alpha x}=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}+V(x)$ (113)

where

$\alpha=\frac{1}{\sigma^{2}}\left(\frac{\sigma^{2}}{2}-r\right),\\\
\gamma=\frac{1}{2\sigma^{2}}\left(\frac{\sigma^{2}}{2}+r\right)^{2}$ (114)

and $H_{\rm{eff}}$ is a Hermitian Hamitonian which is considered as the
symmetric square potential well Hamitonian. The stationary state Schrödinger
equation for option price is

$\left\\{\begin{aligned} &-\frac{\sigma^{2}}{2}\frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+\gamma\phi=E\phi,&a<x<b,\\\ &-\frac{\sigma^{2}}{2}\frac{{\rm
d}^{2}\phi}{{\rm d}x^{2}}+(\gamma+V_{0})\phi=E\phi,&x<a,\
x>b.\end{aligned}\right.$ (115)

where $\phi$ is the option price wave function, $E$ is corresponding to bound
state energy levels in the potential well. (LABEL:schrodingereqPDBS) could be
simplified into

$\left\\{\begin{aligned} \frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}+k_{1}^{2}\phi=0&,&a<x<b,\\\ \frac{{\rm d}^{2}\phi}{{\rm
d}x^{2}}-k_{2}^{2}\phi=0&,&x<a,\ x>b.\end{aligned}\right.$ (116)

where

$k_{1}^{2}=\frac{2(E-\gamma)}{\sigma^{2}},\ \
k_{2}^{2}=\frac{2(V_{0}+\gamma-E)}{\sigma^{2}}$ (117)

The general solution for (116) is

$\phi(x)=\left\\{\begin{aligned} A_{3}\ e^{k_{2}(x-\frac{b+a}{2})}&,&x\leq
a,\\\ A_{1}\sin(k_{1}x+\delta)&,&a<x\leq b,\\\ A_{2}\
e^{-k_{2}(x-\frac{b+a}{2})}&,&x>b.\end{aligned}\right.$ (118)

Considering the continuity for both wave function and its derivative at $x=a$
and $x=b$, we have

$\delta=\frac{\ell\pi}{2}-k_{1}\frac{b+a}{2},\ \ \ell=0,1,2,...$ (119)

According to different $\ell s$ in (119), (118) could be split into two parts

$\phi_{1}(x)=\left\\{\begin{aligned} &-A_{2}e^{k_{2}(x-\frac{b+a}{2})},&x\leq
a,\\\ &A_{1}\sin k_{1}\left(x-\frac{b+a}{2}\right),&a\leq x\leq b,\\\
&A_{2}e^{-k_{2}(x-\frac{b+a}{2})},&x>b.\end{aligned}\right.\ \ \ \ for\ \
\ell=0,2,4,...$ (120)

and

$\phi_{2}(x)=\left\\{\begin{aligned} &A_{2}e^{k_{2}(x-\frac{b+a}{2})},&x\leq
a,\\\ &A_{1}\cos k_{1}\left(x-\frac{b+a}{2}\right),&a\leq x\leq b,\\\
&A_{2}e^{-k_{2}(x-\frac{b+a}{2})},&x>b.\end{aligned}\right.\ \ \ \ for\ \
\ell=1,3,5,...$ (121)

where

$A_{1}=\sqrt{\frac{2k_{2}}{k_{2}(b-a)+2}},\ \
A_{2}=A_{1}\sin\bigg{(}k_{1}\frac{b-a}{2}\bigg{)}e^{k_{2}\frac{b-a}{2}}$ (122)

here the normalization condition has been used. Considering boundary
conditions for (120) and (121) at $x=b$ respectively, we have

$\cot k_{1}\frac{b-a}{2}=-\frac{k_{2}}{k_{1}}$ (123) $\tan
k_{1}\frac{b-a}{2}=\frac{k_{2}}{k_{1}}$ (124)

let

$\beta=\sqrt{k_{1}^{2}+k_{2}^{2}}=\frac{\sqrt{2V_{0}}}{\sigma}$ (125)

(123) and (124) could be combined into

$k_{1n}\frac{b-a}{2}=\frac{n\pi}{2}-\arcsin{\frac{k_{1n}}{\beta}},\ \
n=1,2,3,...$ (126)

(126) is the energy level equation. In general, there is no analytical
solution for energy eigenvalues, yet numerical results for $k_{1n}$ could be
obtained by Mathematica. In Table. 1, we show $k_{1n}$ for different $n$s at
$V_{0}=55.7859$, $26.3401$, and $12.8233$ , which are corresponding to
$d=0.8$, $0.9$ and $0.95$ in Linetsky:2001 , respectively. The range of
$k_{1n}$ could be obtained from (117)

$k_{1n}<\sqrt{\frac{2(V_{0}-\gamma)}{\sigma^{2}}}$ (127)

$V_{0}$ |  $n$ |  $k_{1n}$ |  $n$ |  $k_{1n}$
---|---|---|---|---
55.7859 |  1 |  7.38515 |  4 |  28.8819
2 |  14.7215 |  5 |  34.4789
3 |  21.9384 |  6 |  42.1887
26.3401 |  1 |  6.94708 |  3 |  20.1958
2 |  13.7663 |  4 |  25.0978
12.8233 |  1 |  6.41782 |  2 |  12.527
Table 1: $k_{1n}$ for different $n$s at $V_{0}=55.7859$, $26.3401$.
Parameters: $\sigma=0.3$, $r=0.05$.

which restricts the number of energy levels is 5, 3 and 2 for $V_{0}=55.7859$,
$26.3401$, and $12.8233$, respectively.

Now we calculate the pricing kernel of proportional double-barrier step
option. a and b in (111) could be considered as the lower and the upper
barriers of the option. Let $\tau_{1}$ indicates the occupation time between
the lower barrier a and the upper barrier b, and $\tau_{2}$ is the occupation
time below the lower barrier a and above the upper barrier b. The pricing
kernel is

$\begin{split}P_{\rm
PDBS}(x,x^{\prime};\tau)&=\braket{x}{e^{-\tau_{1}H_{1}-\tau_{2}H_{2}}}{x^{\prime}}\\\
&=\int_{-\infty}^{+\infty}{\rm
d}x^{\prime\prime}\braket{x}{e^{-\tau_{1}H_{1}}}{x^{\prime\prime}}\braket{x^{\prime\prime}}{e^{-\tau_{2}H_{2}}}{x^{\prime}}\\\
&=e^{-\tau\gamma}\int_{-\infty}^{+\infty}{\rm
d}x^{\prime\prime}e^{\alpha(x-x^{\prime})}\sum_{n}\sum_{n^{\prime}}e^{-\tau_{1}E_{1n}-\tau_{2}E_{2n^{\prime}}}\phi_{n}(x)\phi_{n}(x^{\prime\prime})\phi_{n^{\prime}}(x^{\prime\prime})\phi_{n^{\prime}}(x^{\prime})\end{split}$
(128)

where $S_{0}=e^{x}$ is the initial price of the underlying asset,
$S_{T}=e^{x^{\prime}}$ is the final price of the underlying asset. Using the
orthonormalization condition

$\int_{-\infty}^{+\infty}{\rm d}x^{\prime\prime}\
\phi_{n}(x^{\prime\prime})\phi_{n^{\prime}}(x^{\prime\prime})=\delta_{nn^{\prime}}=\left\\{\begin{aligned}
0&,&n\neq n^{\prime},\\\ 1&,&n=n^{\prime}.\end{aligned}\right.$ (129)

the pricing kernel (128) is simplified into

$\begin{split}P_{\rm
PDBS}(x,x^{\prime};\tau)=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}\sum_{n}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}\phi_{n}(x)\phi_{n}(x^{\prime})\end{split}$
(130)

where (117) is used, and the proportional double-barrier call price is

$C_{\rm PDBS}(x;\tau)=\int_{{\rm ln}K}^{+\infty}{\rm d}x^{\prime}p_{\rm
PDBS}(x,x^{\prime};\tau)(e^{x^{\prime}}-K)$ (131)

where

$\begin{split}H_{1}&=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}\\\ H_{2}&=e^{\alpha
x}\left(-\frac{\sigma^{2}}{2}\frac{\partial^{2}}{\partial
x^{2}}+\gamma\right)e^{-\alpha x}+V_{0}\end{split}$ (132)

$\phi_{n}(x)$ is the energy eigenstate in coordinate representation, $K$ is
the exercise price, and $\tau=\tau_{1}+\tau_{2}$ is the time to expiration.
Setting ${\rm ln}K\in(a,b)$, combining with the expressions of $\phi(x)$ in
(120) and (121), the option price for $a<x<b$ could be denoted as

$C(x,\tau)\big{|}_{a<x<b}=\int_{{\rm ln}K}^{b}{\rm d}x^{\prime}P_{\rm
PDBS}(x,x^{\prime};\tau)\big{|}_{a<x<b,{\rm
ln}K<x^{\prime}<b}(e^{x^{\prime}}-K)+\int_{b}^{+\infty}P_{\rm
PDBS}(x,x^{\prime};\tau)\big{|}_{a<x<b,x^{\prime}>b}(e^{x^{\prime}}-K)$ (133)

where

$\begin{split}P_{\rm PDBS}(x,x^{\prime};\tau)\big{|}_{a<x<b,{\rm
ln}K<x^{\prime}<b}&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}(e^{x^{\prime}}-K)\times\\\
&\bigg{(}\sum_{n=2,4,6...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{1}^{2}\sin\bigg{[}k_{1n}\bigg{(}x-\frac{b+a}{2}\bigg{)}\bigg{]}\sin\bigg{[}k_{1n}\bigg{(}x^{\prime}-\frac{b+a}{2}\bigg{)}\bigg{]}+\\\
&\sum_{n=1,3,5...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{1}^{2}\cos\bigg{[}k_{1n}\bigg{(}x-\frac{b+a}{2}\bigg{)}\bigg{]}\cos\bigg{[}k_{1n}\bigg{(}x^{\prime}-\frac{b+a}{2}\bigg{)}\bigg{]}\bigg{)}\end{split}$
(134) $\begin{split}P_{\rm
PDBS}(x,x^{\prime};\tau)\big{|}_{a<x<b,x^{\prime}>b}&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}(e^{x^{\prime}}-K)\times\\\
&\bigg{(}\sum_{n=2,4,6...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{1}A_{2}\sin\bigg{[}k_{1n}\bigg{(}x-\frac{b+a}{2}\bigg{)}\bigg{]}e^{-k_{2n}(x^{\prime}-\frac{b+a}{2})}+\\\
&\sum_{n=1,3,5...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{1}A_{2}\cos\bigg{[}k_{1n}\bigg{(}x-\frac{b+a}{2}\bigg{)}\bigg{]}e^{-k_{2n}(x^{\prime}-\frac{b+a}{2})}\bigg{)}\end{split}$
(135)

Similarly, the option price for $x>a$ is

$C(x,\tau)\big{|}_{x>a}=\int_{{\rm ln}K}^{b}{\rm d}x^{\prime}P_{\rm
PDBS}(x,x^{\prime};\tau)\big{|}_{x>a,{\rm
ln}K<x^{\prime}<b}(e^{x^{\prime}}-K)+\int_{b}^{+\infty}P_{\rm
PDBS}(x,x^{\prime};\tau)\big{|}_{x>a,x^{\prime}>b}(e^{x^{\prime}}-K)$ (136)

where

$\begin{split}P_{\rm PDBS}(x,x^{\prime};\tau)\big{|}_{x>a,{\rm
ln}K<x^{\prime}<b}&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}(e^{x^{\prime}}-K)\times\\\
&\bigg{(}\sum_{n=1,3,5...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{2}A_{1}e^{-k_{2n}(x-\frac{b+a}{2})}\sin\bigg{[}k_{1n}\bigg{(}x^{\prime}-\frac{b+a}{2}\bigg{)}\bigg{]}+\\\
&\sum_{n=2,4,6...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{2}A_{1}e^{-k_{2n}(x-\frac{b+a}{2})}\cos\bigg{[}k_{1n}\bigg{(}x^{\prime}-\frac{b+a}{2}\bigg{)}\bigg{]}\bigg{)}\end{split}$
(137) $\begin{split}P_{\rm
PDBS}(x,x^{\prime};\tau)\big{|}_{x>a,x^{\prime}>b}&=e^{-\tau\gamma}e^{\alpha(x-x^{\prime})}(e^{x^{\prime}}-K)\times\\\
&\bigg{(}\sum_{n=1,3,5...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{2}^{2}e^{-k_{2n}(x-\frac{b+a}{2})}e^{-k_{2n}(x^{\prime}-\frac{b+a}{2})}+\\\
&\sum_{n=2,4,6...}e^{-\frac{1}{2}\tau\sigma^{2}k_{1n}^{2}}A_{2}^{2}e^{-k_{2n}(x-\frac{b+a}{2})}e^{-k_{2n}(x^{\prime}-\frac{b+a}{2})}\bigg{)}\end{split}$
(138)

## References

  * (1) F. Black and M. Scholes, _The pricing of options and corporate liabilities_ , Journal of political economy 81, 637 (1973).
  * (2) K. Amin and A. J. Morton, _Implied volatility functions in arbitrage-free term structure models_ , Journal of Financial Economics 35, 141 (1994).
  * (3) M. Rubinstein, _Displaced diffusion option pricing_ , Journal of Finance 38, 213 (1983).
  * (4) R. C. Merton, _Theory of rational option pricing_ , Bell Journal of Economics 4, 141-183 (1973).
  * (5) R. Geske, _The valuation of compound options_ , Journal of Finantial Economics 7(1) : 63-81 (1979).
  * (6) G. L .Snyder, _Alternative forms of options_ , Financial Analysts Journal 25, 93-99 (1969).
  * (7) B. E. Baaquie, C. Coriano and M. Srikant, _Hamiltonian and potentials in derivative pricing models: exact results and lattice simulations_ , Physica A 334, 531-57 (2004).
  * (8) B. E. Baaquie, _Quantum finance. Path integrals and Hamiltonians for options and interest rates_ , Cambridge University Press (2004).
  * (9) E. G. Haug, _The complete guide to option pricing formulas_ , McGraw-Hill (1997).
  * (10) B. E. Baaquie and S. Marakani, _Finite hidging in field theory models of interest rates_ , Phys. Rev. E 69: 036130 (2004).
  * (11) B. E. Baaquie and M. Srikant _Comparison of field theory models of interest rates with market data_ , Phys. Rev. E 69: 036129 (2004).
  * (12) D. Davydov and V. Linetsky, _Structuring, Pricing and Hedging Double-Barrier Step Options_ , Journal of Computational Finance 5(2) (2001).
  * (13) V. Linetsky, _Step options_ , Mathematical Finance 9(1), 55-96 (1999).
  * (14) X. Xing and H Yang, _American type geometric step options_ , Journal of Industrial and Management Optimization 9(3) (2013).
  * (15) H. Lee, B Ko and S. Song, _Valuing Step Barrier options and their icicled variations_ , The North American Journal of Economics and Finance 49(C) (2019).
  * (16) H. Lee, H Ha, M, Lee, _Valuation of piecewise linear barrier options_ , The North American Journal of Economics and Finance 58 (2021).
  * (17) H. Kleinert, _Option pricing from path integral for non-Gaussian fluctuations. Natural martingale and application to truncated Levy disrtibutions_ , Physica A 312, 217-242 (2012).
  * (18) N. Kunitomo and M. Ikeda, _Pricing Options With Curved Boundaries_ , Mathematical Finance 2(4) (1992).


indicates a message drop, and @ indicates a message capture (for later
release).

We use the function tCS2C defined in Section 3.4 to construct scenario initial
system configurations. For convenience we repeat the definition here.

    op tCS2C : Nat Nat AMsgL RMap Nat Nat
               Nat Nat AMsgL RMap Nat Nat
              Caps -> Conf .
    eq tCS2C(n0,j0,amsgl0,rbnds0,mqd0:Nat,w4ab0:Nat,
             n1,j1,amsgl1,rbnds1,mqd1:Nat,w4ab1:Nat,
            caps) =
       net(mtDM,mtDM)
       mkDevC(n0,j0,amsgl0,rbnds0,mqd0:Nat,w4ab0:Nat)
       mkDevC(n1,j1,amsgl1,rbnds1,mqd1:Nat,w4ab1:Nat)
       (if caps == mtC then mt else mkAtt(caps) fi)  .

It generates a configuration with two endpoint agents (constructed using
mkDevC) and an attacker (if caps is non empty). The arguments specify initial
application messages (amsglj) and resource maps (rbndsj). The first two
numbers for a device construction determine the device id and inital delay for
message sending. The last two numbers for a device construction specify the
congestion control behavior: a new message can not be sent if there are more
than w4ab requests not yet acknowledged, and there must be a delay of a least
mqd between requests.

We also use three application message constructors to generate
requests.555Recall that a client will retry a confirmable request if no
acknowlegment or response is received within a specified time. Non-confirmable
requests are not acknowledged and are not retried.

  * •

mkPutN(tag,server,resource,val): a non-confirmable request to server to set
resource to val.

  * •

mkPutC(tag,server,resource,val): a confirmable request to server to set
resource to val.

  * •

mkGetN(tag,server,resource) a non-confirmable request to get the resource
value from server.

See Section 3.4 for definitions.

To check if an attack is possible in a given scenario, we search from the
constructed initial configuration initSys to a terminal configuration 666See
section 0.A for a characterization of terminal configurations. that satisfies
a property P(c:Conf, params) characterizing the effects of the attack
typically in terms of properties of unperturbed executions that are violated.
Requiring solutions to be terminal allows us to rely on a number of
consequences such as if a message is sent, then it will be received unless it
is dropped.

    search initSys =>! {c:Conf ["eve" | a:Attrs caps(mtC)]}
        such that P(c:Conf, params)

This lists all the ways the property P can be satisfied. In some cases, we also search for executions in which the attacker fails, i.e. the expected execution properties hold. Including the term ["eve" | a:Attrs caps(mtC)] in the search pattern ensures that the attacker will use all its capabilities in reaching a solution state.

We use the following predicates to form the search properties. These are very
basic properties that characterize the state of endpoints at the end of a
scenario.

#### Properties of the server state.

  * •

checkRsrc(c:Conf,sv,r,v): The resource r of server sv has value v.

  * •

hasRspTSnt(c:Conf,sv,cl,aid): Server sv has sent a response to client cl in
response to a request with token matching aid (the application provided
message identifier, which is part of the message id and token strings).

  * •

rspTSntBefore(c:Conf,sv,cl,aid0,aid1): Server sv sent responses to client cl
in response to a request with token matching aid0 and a requesst with token
matching aid1 with the aid0 matching response being sent first.

#### Properties of the client state.

  * •

hasRspTRcd(c:Conf,cl,sv,aid): Client cl had received a response from server sv
to a request with token matching aid. (The empty string matches any token.)

  * •

hasGetRsp(c:Conf,cl,sv,aid,val): Client cl had received a response from server
sv to a GET request with token matching aid. The response body contains value
val. (If val is the empty string, the value check is omitted.)

  * •

rspPend(c:Conf,cl,sv,aid): Client cl is waiting for a response from server sv
to a request with token matching aid.

The following subsections treat the different vulnerabilities. They begin with
a diagram of the proposed attack, followed by a formal definition of the
corresponding scenario, search commands and results demonstrating attack
success and failure situations. We show the scenario definitions and search
commands for the original CoAP case. The search command for the corresponding
dialected scenario is given by applying the dialect transformation D (defined
in Section 7.3) to the initial system configuration and lifing the search
pattern to the dialected structure to expose the relevant elements. Thus the
dialected version of the CoAP search command

            search initSys =>!
              {c:Conf ["eve" | a:Attrs caps(mtC)]
                      [epid | devatts:Attrs]}
              such that prop(c:Conf,epid) .

is

           search D(initSys) =>!
             {c0:Conf  ["eve" | a:Attrs caps(mtC)]
                       [epid | conf(c:Conf)]
              ddattrs0:Attrs]}
            such that prop(c:Conf,epid) .

Note that the goal property doesn’t change.

###  0.B.1 The Selective Blocking Attack.

This scenario illustrates the ability of an attacker to block a single
message. How the attacker recognizes the intended target is not discussed in
[4]. Th scenario is adapted from Figures 1,2 of [4].

          dev0      eve    dev1        dev       eve     dev1
          ---      ---   unlock        ---       ---    unlock
           o -PUTN->X      |            o -PUTN->  ------>  o
                           |            |         X <-2.04- o
                        unlock          |                 lock

              (1) drop message            (2) drop response

              Figures 1,2 scenarios

-PUTN-> a non-confirmable request to lock the door. -2.04-> the PUTN response. (1) Attacker blocks the request. (2) Attacker blocks the response.

The function caFig1.2 specifies the scenario for the message dropping attacks
of Figures 1 and 2, parameterized by congestion control parameters (mqd:Nat
the minimum time between message sends; more that w4b:Nat requests in w4Ack
blocks sending additional requests).

        op caFig1.2 : Nat Nat -> Conf .
        eq caFig1.2(mqd:Nat,w4b:Nat) =
             tCS2C(0,0,mkPutN("putN","dev1","door","lock"),
                       mtR,mqd:Nat,w4b:Nat,
                   1,1,nilAM,rb("door","unlocked"),2,0,
                   drop) .

#### Figure 1 successful attack.

Dropping a request is specified by checking that the server did not make any
response (hence it did not receive the request) and the client awaits a
response (it sent a request). Note this is redundant given the semantics, but
a systematic characterization.

        search {caFig1.2(5,0)} =>!
          {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
          not(hasRspTSnt(c:Conf,"dev1","dev0","putN")) and
          rspPend(c:Conf,"dev0","dev1","putN")  .

or by checking that the server resource has the original value.

          search {caFig1.2(5,0)} =>!
          {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
          checkRsrc(c:Conf,"dev1","door","unlocked") .

In either case there are 2 solutions among 7 states. The results for the
corresponding two dialected cases are similar, 2 solutions among 9 states
visited.

#### Figure 2 successful attack.

Dropping the response can be specified by checking that the server sent a
response and the client did not receive one.

        search {caFig1.2(5,0)} =>!
        {c:Conf  ["eve" | a:Attrs caps(mtC)]} such that
          hasRspTSnt(c:Conf,"dev1","dev0","putN") and
          checkRsrc(c:Conf,"dev1","door","lock") and
          rspPend(c:Conf,"dev0","dev1","putN") .

There are 2 solutions out of 13 states visited.

#### Figure 1,2 attack failures.

To check that there are good executions in the presence of an attacker we
check that the server sends a response and the client receives it and the
attacker used all its capabilities.

        search {caFig1.2(5,0)} =>!
          {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
             hasRspTSnt(c:Conf,"dev1","dev0","putN") and
             hasRspTRcd(c:Conf,"dev0","dev1","putN") .

There is no solution, some message has to be dropped and there are only two
messages.

###  0.B.2 The Request Delay Attack.

This scenario is based on figure 3 of [4].

              dev0        eve        dev1
              ----        ---        lock
               o -PUTNDU-> @
               o -PUTNSO->  ------>    o
               o <-------  <-2.01--    o
                           o -PUTNDU-> o
                           X <-2.04-   o
                                    unlock
               Figure 3 scenario

The client intends to unlock the door, PUTNDU, then turn a signal on PUTSO.
However the attacker delays the door unlock request and drops the PUTNDU
response. The signal goes on with the door locked.

The Figure 3 attack scenario is constructed by the function caFig3.

          op caFig3 : Nat Nat Nat -> Conf .
          eq caFig3(d:Nat,mqd:Nat,w4b:Nat) =
           tCS2C(0,0,mkPutN("putND","dev1","door","unlock") ;
                     mkPutN("putNS","dev1","signal","on"),
                    mtR,mqd:Nat,w4b:Nat,
                1,1,nilAM,rb("door","lock"),2,0,
                drop delay(d:Nat)) .

#### Figure 3 successful attacks.

From the diagram we characterize the attack by server properties saying a
request with token matching putNS was received and processed before the
request with token matching putND; the door is unlocked, and the client has
not received a response to the message with token matching putND.

          search {caFig3(15,5,0)} =>!
          {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
          checkRsrc(c:Conf,"dev1","door","unlock") and
          rspTSntBefore(c:Conf,"dev1","dev0","putNS","putND") and
          rspPend(c:Conf,"dev0","dev1","putND") .

There are 4 solutions in 330 states visited. In the dialected version of the
scenario, there are 4 solutions among 496 states visited.

#### Figure 3 failed attacks.

Failed attacks are those executions where the attacker uses all its
capabiities, but the endpoint events are as expected in absence of attacker.
That is, the server has responded to putND before putNS and the client has
received the two expected responses. If we require the client receive all
responses there will be no solution, as something needs to be dropped. So we
only require the client receive a response to putND.

          search {caFig3(15,5,0)} =>!
          {c:Conf  ["eve" | a:Attrs caps(mtC)]} such that
          checkRsrc(c:Conf,"dev1","door","unlock") and
          rspTSntBefore(c:Conf,"dev1","dev0","putND","putNS") and
          hasRspTRcd(c:Conf,"dev0","dev1","putND")  .

There are 4 solutions, for example the attacker might delay the putNS request,
and drop the response to that request.

###  0.B.3 The Delay with Reordering Attack.

This scenario is based on Figure 4 of [4]. Here the door is initially locked.
The client requests unlock, possibly carries out some other interactions, and
then requests lock. The attacker captures the unlock request. Since the unlock
request is confirmable, the client resends it and the server sends a response
to the resent request. The following lock request is processed as expected.
Then the attacker releases the captured unlock request and drops the response.
Thus the client believes the door is locked when in fact it is unlocked.

            dev0        eve        dev1
            ----        ---        lock
             o -PUTCU->  @
             o -PUTCU->  -------->  o  --- retry
             o <----     <---2.04-- o
                      .. ... ..
             o -PUTNL->    ------>  o
             o <-------  <--2.04--  o
                         o -PUTCU-> o  --- release
                         X <-2.04-  o
                                  unlock
               Figure 4 scenario

This scenario is constructed by the function caFig4x giving the attack a drop
and a delay capability. The function is parameterized by the delay ammount
(n:Nat) and the usual congestion controls.

          op caFig4x : Nat Nat Nat -> Conf .
          eq caFig4x(n:Nat,mqd:Nat,w4b:Nat) =
             tCS2C(0,0,mkPutC("putC","dev1","door","unlock") ;
                      mkPutN("putN","dev1","door", "lock"),
                      mtR,mqd:Nat,w4b:Nat,
                 1,1,nilAM,rb("door","lock"),2,0,
                 drop delay(n:Nat)) .

#### Figure 4 Successful Attack

The attack is specified by requiring the server to send a response to a
request with token matching "putC" followed by a "putN" followed by another
"putC" with the door unlocked at the end. We require the client to have
received responses to "putC" and "putN" requests thus leading the client to
believe it succeeded.

          search {caFig4x(10,5,0)} =>!
          {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
          checkRsrc(c:Conf,"dev1","door","unlock") and
          hasRspTSnt(c:Conf,"dev1","dev0","putC") and
          hasRspTSnt(c:Conf,"dev1","dev0","putN") and
          rspTSntBefore(c:Conf,"dev1","dev0","putC","putN") and
          rspTSntBefore(c:Conf,"dev1","dev0","putN","putC") and
          hasRspTRcd(c:Conf,"dev0","dev1","putN") and
          hasRspTRcd(c:Conf,"dev0","dev1","putC") .

There are 8 solutions from 2600 states visited. In the dialected version there
are 16 solutions from 10167 states visited.

#### Figure 4 Failed Attack.

The attacker can fail even though both capabilities are used. In this case we
require the server response sequence to be simply putC then putN and the final
door state to be "lock" and requier the client state as for the successful
attack.

              search {caFig4x(10,5,0)} =>!
              {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
              checkRsrc(c:Conf,"dev1","door","lock") and
              hasRspTSnt(c:Conf,"dev1","dev0","putC") and
              hasRspTSnt(c:Conf,"dev1","dev0","putN") and
              rspTSntBefore(c:Conf,"dev1","dev0","putC","putN") and
              hasRspTRcd(c:Conf,"dev0","dev1","putN") and
              hasRspTRcd(c:Conf,"dev0","dev1","putC") .

There are 45 solutions from 2586 states visited.

###  0.B.4 The Response Delay and Mismatch Attack.

This scenario is based on Figure 5 of [4]. In this attack the client sends an
unlock request, the attacker captures the response, since the resquest is non-
confirmable the client doesn’t worry about the lack of response. Later the
client sends a lock request that is dropped by the attacker, who releases the
unlock response to trick the client into thinking the lock request succeeded,
when in fact the door remains unlocked.

This works for clients that reuse tokens. It fails using the Maude client
specification.

                dev0      eve       dev1
                ----      ---       lock
                 o -PUTNU-->   -----> o
                 |         @  <-2.04- o
                        ......
                 o -PUTNL->   X       |
                 o <-2.04-    o       |
                                   unlock
               Figure 5 scenario

This attack scenario is specified by the function caFig5x.

            op caFig5x : Nat Nat Nat -> Conf .
            eq caFig5x(d:Nat,mqd:Nat,w4b:Nat) =
               tCS2C(0,0,mkPutN("putNU","dev1","door","unlock") ;
                         mkPutN("putNL","dev1","door", "lock"),
                         mtR,mqd:Nat,w4b:Nat,
                     1,1,nilAM,rb("door","lock"),2,0,
                     drop delay(d:Nat)) .

#### Figure 5 intented attack fails

                search {caFig5x(10,5,0)} =>!
                {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
                hasRspTSnt(c:Conf,"dev1","dev0","putNU") and
                not(hasRspTSnt(c:Conf,"dev1","dev0","putNL")) and
                checkRsrc(c:Conf,"dev1","door","unlock") and
                hasRspTRcd(c:Conf,"dev0","dev1","putNL") .

There is no solution. Also no solution in the dialected case.

#### Figure 5 alternative attack

The result that the client believes the door is locked when it is not can be
realized by an attack where the unlock request is delayed and the unlock
response is dropped.

              search {caFig5x(10,5,0)} =>!
              {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
              hasRspTSnt(c:Conf,"dev1","dev0","putNU") and
              hasRspTSnt(c:Conf,"dev1","dev0","putNL") and
              rspTSntBefore(c:Conf,"dev1","dev0","putNL","putNU") and
              checkRsrc(c:Conf,"dev1","door","unlock") and
              hasRspTRcd(c:Conf,"dev0","dev1","putNL") .

There are 4 solution 4 among 330 states visited. In the dialected case there
are 4 solutions among 499 states visited.

###  0.B.5 Delaying and mismatching response to GET requests

This attack is based on Figure 6 of [4]. In this attack the attacker captures
the response to a GET request, drops a subsequent GET request and releases the
original response. Between GET requests the door state may have changed. A
vulnerable client will accept the delayed response to the first GET as
response to the second GET, and thus in the case where the door is locked
initially, and becomes unlocked, client incorrectly thinks the door is locked,
assuming the unlock request failed to arrive. The Maude client will accept the
delayed response, but as response to the first GET and will not have any
knowledge about the later state.

                dev0      eve        dev1
                ----      ---        lock
                 o -GETN->   ------>  o    getN0
                 |         @  <-lock- o
                 o -PUTNU-->  ----->  |    putNU
                 |         X  <-2.04- o
                 o -GETN-> X          |    getN1
                 o <-lock- o          |
                                   unlock
                Figure 6 scenario

This attack scenario is constructed by the function caFig6x.

            op caFig6x : Nat Nat Nat -> Conf .
            eq caFig6x(d:Nat,mqd:Nat,w4b:Nat) =
               tCS2C(0,0,mkGetN("getN0","dev1","door") ;
                         mkPutN("putNU","dev1","door","unlock") ;
                         mkGetN("getN1","dev1","door") ,
                         mtR,mqd:Nat,w4b:Nat,
                     1,1,nilAM,rb("door","lock"),2,0,
                     drop drop delay(d:Nat)) .

#### Figure 6 intended attack fails.

To specify the intended attack we require that the server sends a response to
"getN0" before sending a response to "putNU", at the end the door state is
"unlock", and the client has a response to "getN1" with value "lock".

                  search {caFig6x(10,5,0)} =>!
                  {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
                  hasRspTSnt(c:Conf,"dev1","dev0","getN0") and
                  hasRspTSnt(c:Conf,"dev1","dev0","putNU") and
                  rspTSntBefore(c:Conf,"dev1","dev0","getN0","putNU") and
                  checkRsrc(c:Conf,"dev1","door","unlock") and
                  not(hasRspTSnt(c:Conf,"dev1","dev0","getN1") ) and
                  hasGetRsp(c:Conf,"dev0","dev1","getN1","lock") .

There are no solutions, also no solutions in the dialected case.

#### Figure 6 alternate attack succeeds

In the alternate attack, the server requirement is the same as for the
intended attack, but the client has a response to "getN0" but no response to
either "putNU" or "getN1", thus the door is unlocked at the end, but the
client does not know the state.

                search {caFig6x(10,5,0)} =>!
                {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
                hasRspTSnt(c:Conf,"dev1","dev0","getN0") and
                hasRspTSnt(c:Conf,"dev1","dev0","putNU") and
                rspTSntBefore(c:Conf,"dev1","dev0","getN0","putNU") and
                checkRsrc(c:Conf,"dev1","door","unlock") and
                not(hasRspTSnt(c:Conf,"dev1","dev0","getN1") ) and
                hasGetRsp(c:Conf,"dev0","dev1","getN0","lock") and
                rspPend(c:Conf,"dev0","dev1","getN1") and
                rspPend(c:Conf,"dev0","dev1","putNU") .

There are 18 solutions in 2742 states visited. In the dialected case there are
18 solutions among 4675 states visited.

###  0.B.6 Delaying and mismatching response from other resource

This attack is based on Figure 7 of [4]. In the original attack the client
sends temperature requests to two resources (oven,room), and the attacker
switches responses, dropping the the room temperature response, making the
client think the room is on fire. We adapt this to the case of doors to two
rooms, to keep to the door theme.

                  dev0      eve        dev1
                  ---       ---     d1/lock d2/unlock
                   o  ----GETN(d1)--->   o  getN0
                   |             @ <-d1- o
                   o -GETN(p2)-> X       |  getN1
                   o <-d1-       o       |

                  Figure 7 scenario

With a vulnerable client the attack succeeds because the client uses same
token for both GETs and will accept the response to the first GET as a
response to the second GET request. The Maude client does not reuse tokens and
this attack fails.

The attack scenario is constructed by the function caFig7x.

              op caFig7x : Nat Nat Nat -> Conf .
              eq caFig7x(d:Nat,mqd:Nat,w4b:Nat) =
                 tCS2C(0,0,mkGetN("getN0","dev1","door1") ;
                           mkGetN("getN1","dev1","door2") ,
                           mtR,mqd:Nat,w4b:Nat,
                       1,1,nilAM,
                       rb("door1","lock") rb("door2","unlock"),2,0,
                       drop delay(d:Nat)) .

#### Figure 7 attack fails.

              search {caFig7x(10,5,0)} =>!
                {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
              hasRspTSnt(c:Conf,"dev1","dev0","getN0") and
              not(hasRspTSnt(c:Conf,"dev1","dev0","getN1")) and
              hasGetRsp(c:Conf,"dev0","dev1","getN1","lock") .

There is no solution. Also no solution in the dialected case.

###  0.B.7 Delaying and mismatching response from other resource variant

This attack is a variant of the attack based on Figure 7 of [4] using two
servers rather than one server with two resources.

                    dev0         eve      dev1    dev2
                    ----         ---     unlock   lock
                    o -GETN(1)--> #        |        |
                    |             >  ---GETN(2)-->  o
                    |             #  <---lock---    o
                    o <-1:lock-   <        |        |

The client asks for the door state at dev1. The attacker redirects the request
to dev2 and (un)redirects the response to appear to come from dev1. This
scenario is generated by the function caFig7mod.

                op caFig7mod : Nat  Nat -> Conf .
                eq caFig7mod(mqd:Nat,w4b:Nat) =
                     tCS3C(0,0,mkGetN("getN0","dev1","door"),
                               mtR,mqd:Nat,w4b:Nat,
                          1,1,nilAM,rb("door","unlock"),5,0,
                          2,2,nilAM,rb("door","lock"),5,0,
                          redirect("dev1","dev2")       --- change tgt
                          unredirect("dev1","dev2")) .  --- change src

#### Figure 7mod successful attack

We search for a final state in which dev0 has a response from dev1 that the
door is locked while in fact the door of dev1 is unlocked, dev1 sent no
response, and dev2 did send a response.

                  search {caFig7mod(5,0)} =>!
                  {c:Conf ["eve" | a:Attrs caps(mtC)]} such that
                  not(hasRspTSnt(c:Conf,"dev1","dev0","getN0")) and
                  hasRspTSnt(c:Conf,"dev2","dev0","getN0") and
                  checkRsrc(c:Conf,"dev1","door","unlock") and
                  hasGetRsp(c:Conf,"dev0","dev1","getN0","lock") .

There are 4 solutions out of 33 states visited. In the dialected case there
are no solutions among 21 states visited. This is because the GET request is
dialected using the secret shared by dev0 and dev1, and dev2 can not decode
the message, so it is dropped.

##  Appendix 0.C Bisimulation proofs

We consider CoAP system configurations sysC of the form

       { [eid-j | devatts-j ] | 0 <= j < k
         net(dmsgs0,dmsgs1)
         ["eve" | kb(dmsgs) caps(caps)]
         }

and dialected CoAP system configurations, dsysC, of the form

       { [eid-j | conf([eid-j | devatts’-j]
                       net(dmsgsO-j,dmsgsI-j))
                  ddevatts-j ]
         | 0 <= j < k
         net(ddmsgs0,ddmsgs1)
         [eve | kb(ddmsgs) caps(capsd)]
         }

In Section 7.3 we defined transforms relating initial CoAP system
configurations and dialected versions D(sysI) and UD(dsysC). We use these
transforms to define a simulation relation $\sim$ and prove two stuttering
bisimulation relations:

  * 1.

$\mathtt{sysI}\approx D(\mathtt{sysI})$ for initial sysI with attack
capabilities restricted to drop or delay.

  * 2.

$\mathtt{dsysI}\approx\mathtt{UDA(dsysI)}$ for initial dsysI with attack
capabilites drop, delay, replay, redirect where UDA extends UD to remove
replay and redirect capabilities.

Recall the notion of initial configuration is defined in Section 3.4
definition 1.

######  Definition 3 ($\sim$-bisimulation)

Given a simulation relation $\mathtt{sysC}\sim\mathtt{dsysC}$ between system
configurations and dialected system configurations, we say that
$\mathtt{iSys}$ is $\sim$-stuttering bisimilar to $\mathtt{iDSys}$ (
$\mathtt{iSys}\approx_{\sim}\mathtt{iDSys}$) iff the following hold:

  * 1.

$\mathtt{iSys}\sim\mathtt{iDSys}$

  * 2.

for reachable configurations such that $\mathtt{sysC}\sim\mathtt{dsysC}$

    * 2a.

if $\mathtt{sysC}\Rightarrow\mathtt{sysC1}$ then there is some
$\mathtt{dsysC1}$ with $\mathtt{sysC1}\sim\mathtt{dsysC1}$ such that
$\mathtt{dsysC}\Rightarrow^{*}\mathtt{dsysC1}$, and

    * 2b.

if $\mathtt{dsysC}\Rightarrow\mathtt{dsysC1}$ then there is some
$\mathtt{sysC1}$ with $\mathtt{dsysC1}\sim\mathtt{sysC1}$ such that
$\mathtt{sysC}\Rightarrow^{*}\mathtt{sysC1}$.

We say $\mathtt{iSys}\approx\mathtt{iDSys}$ if there is a simulation relation
$\sim$ such that $\mathtt{iSys}\approx_{\sim}\mathtt{iDSys}$.

In the no-attacker case, intuitively the simulation relation,
$\mathtt{sysC}\sim\mathtt{dsysC}$, holds if the two configurations differ only
in that in dsysC there are meta-level attributes and some messages are in the
global net and are dialected and some are in a local net while there is only
one net is sysC.

######  Definition 4 (UDX and simulation)

The simulation relation $\sim$ is defined by the property

$\mathtt{dsysC}\sim\mathtt{sysC}\equiv(\mathtt{UDX(dsysC)}=\mathtt{sysC})$

where, using the notation above, the function $\mathtt{UDX}$ extends
$\mathtt{UD}$ and the result is derived as follows.

      devatts-j = devatts’-j 0 <= j < k
      caps = capsd
      dmsgs0 = decode(ddmsgs0,U_{0<=j<k}ddevatts-j)
               U_{0<=j<k} dmsgsO-j
      dmsgs1 = decode(ddmsgs1,U_{0<=j<k}ddevatts-j)
                 U_{0<=j<k} dmsgsI-j

Note that dmsgsI-j has only delayed messages with target eid-j and delay 0,
and dmsgsO-j has only delayed messages with source eid-j.

######  Lemma 1 (Inverse relation)

The transformations D and UD are inverses. For initial (dialected) systems

$\mathtt{UD}(\mathtt{D}(\mathtt{sysI},\mathtt{ids}))=\mathtt{sysI}$

and

$\mathtt{D}(\mathtt{UD}(\mathtt{dsysI}))=\mathtt{dsysI}$

Theorem 0.C.1 tells us that dialecting preserves properties of the underlying
protocol, in this case CoAP, expressible in LTL (with out the next operator).
The corollary says that allowing drop and/or delay attack capabilities does
not change this. That is, dialecting does not protect against these attack
capabilities. Theorem 0.C.2 tells us that dialecting protects CoAP messaging
against replay an message redirection.

######  Theorem 0.C.1 (Stuttering bisimulation in the absence of attacks.)

For any initial system configuration sysI with empty attack capabilities, sysI
is $\sim$-stuttering bisimilar to D(sysI) written

$\mathtt{sysI}\approx\mathtt{D}(\mathtt{sysI})$

###### Proof

Let sysI be an initial system configuration with $\mathtt{caps}=\mathtt{mtC}$
and endpoint identifiers eids. Let dsysI be D(sysI). According to the
definition above, it suffices to show, $\mathtt{sysI}\approx\mathtt{dsysI}$
using the relation $\sim$ the following.

  * (1)

$\mathtt{sysI}\sim\mathtt{dsysI}$

  * (2)

If sysC is reachable from sysI, dsysC is reachable from dsysI, and
$\mathtt{sysC}\sim\mathtt{dsysC}$ then

    * (2.i) if $\mathtt{sysC}\Rightarrow\mathtt{sysC1}$ (application of one rewrite rule) then there is some dsysC1 such that $\mathtt{dsysC}\Rightarrow^{<3}\mathtt{dsysC1}$ and $\mathtt{sysC1}\sim\mathtt{dsysC1}$

    * (2.ii) if $\mathtt{dsysC}\Rightarrow\mathtt{dsysC1}$ then there is some sysC1 such that $\mathtt{sysC}\sim\mathtt{dsysC1}$ or $\mathtt{sysC}\Rightarrow\mathtt{sysC1}$ and $\mathtt{sysC1}\sim\mathtt{dsysC1}$.

(1) is by definition of $\sim$ and lemma 1. (2.i) is proved by cases on the
rule applied. Using the notation above, assume the rule applies to endpoint
eid-j.

  * crl[devsend]: By similarity, eid-j in dsysC has the same attributes and hence the same application message to send. Therefore the same rule applies to the wrapped eid-j with the same attribute updates and new delayed messages added to the local network.

  * crl[rcv]: The corresponding message in dsysC has the same delay and is either in the local net of eid-j or in the global net. In the former case, the rule applies in dsysC with $\mathtt{dsysC}\Rightarrow\mathtt{dsysC1}$. In the latter case, the rule sequence ddevrcv ; rcv applies with $\mathtt{dsysC}\Rightarrow^{2}\mathtt{dsysC2}$. In either case the new state is given by the function rcvMsg(epid,devatts,msg) in dsysC and sysC. Thus $\mathtt{dsysC1}=\mathtt{dsysC2}\sim\mathtt{sysC1}$.

  * crl[ackTimeout]: By $\sim$ this rule is enabled in endpoint eid-j in dsysC. Since the rule outcome depends only devatts-j we have $\mathtt{dsysC}\Rightarrow_{\mathtt{ackTimeout}}\mathtt{dsysC1}\sim\mathtt{sysC1}$.

  * crl[net]: If the corresponding message is in the global net then $\mathtt{dsysC}\Rightarrow_{\mathtt{net}}\mathtt{dsysC}\sim\mathtt{sysC}$. Otherwise the corresponding message is in the local net and $\mathtt{dsysC}\Rightarrow_{\mathtt{ddevsend;net}}\mathtt{dsysC1}\sim\mathtt{sysC1}$.

  * crl[tick]: By definition of mte, if tick is not enabled in dsysC then the local net stub is not empty, and by $\sim$ the only local messages are outgoing (incoming messages have delay 0). Thus

$\mathtt{dsysC}\Rightarrow_{\mathtt{tick;ddevsend+}}\mathtt{dsysC1}\sim\mathtt{sysC1}$

(2.ii) is also proved by cases on the rule applied.

  * crl[ddevsend]: A message is moved between a local net and the global net, thus $\mathtt{dsysC1}\sim\mathtt{sysC}$ by just revising the network message correspondence.

  * crl[ddevrcv]: A message is moved between the global net and a local net, thus $\mathtt{dsysC1}\sim\mathtt{sysC}$.

  * crl[devsend]: by similarity, the corresponding rule instance is enabled in sysC and the effect depends only on the base endpoint attributes and the message which are the same in sysC and dsysC. Thus $\mathtt{sysC}\Rightarrow_{\mathtt{devsnd}}\mathtt{sysC1}\sim\mathtt{dsysC1}$

  * crl[rcv]: similar to devsend and (2.i)

  * crl[ackTimeout]: similar to (2.1)

  * crl[net]: by $\sim$ the sysC net also has the message to move.

  * crl[tick]: if mte is a non-zero Nat in dsysC then the local stub networks are all empty and the mte for sysC has the same value. Thus $\mathtt{sysC}\Rightarrow_{\mathtt{tick}}\mathtt{sysC1}\sim\mathtt{dsysC1}$ since the function passTime has the same effect in both systems.

###### Corollary 1

The bisimulation result of Theorem 0.C.1 extends to the case that caps allows
delay and/or drop.

###### Proof

We only need to consider the rule attack. delay/drop attacks do not concern
the message content or the deliverability of dialected messages, thus an
attack rule application in sysC has a corresponding application in dsysC
(possible combined with a ddevsend instance) and vice-versa, with the result
being $\sim$ related configurations.

###### Theorem 0.C.2

Let DC(sysI,caps) be D(sysI) with caps added to the attacker capabilities of
the dialected system configuration for any initial system configuration sysI.
Then for sysI with attacker capabilities drop and delay and caps containing at
most replay,redirect capabilities

$\mathtt{sysI}\approx\mathtt{DC}(\mathtt{sysI},\mathtt{caps})$

###### Proof

Imagine execution of dialected systems annotates each message with the number
of the step that generated/sent it (the devsend rule). Copies of messages
generated by the attack rule using the replay capability are annotated by the
creation step of the original and the replay attack step that created the
copy; and redirected messages are annotated by the creation step and the
redirection step. The CoAP rules are unchanged. Define the function UDA to
adapt UD so that the annotation is dropped from single annotation messages and
for doubly annotated messages, only the original message (sans annotation) is
in the network image. Copies are dropped and redirected messages are dropped
from the network image. Furthermore, attacker capabilities are reduced to
delay,drop.

Now we show $\mathtt{dsysC}\sim\mathtt{UDA}(\mathtt{dsysC})$ is a stuttering
bisimulation on configurations reachable from D(sysI,dcaps) where dcaps
contains only replay,redirect capabilities and the attack capabilities of sysI
are among drop, delay.

1. For the $\mathtt{dsysC}\Rightarrow\mathtt{dsysC1}$ direction let $\mathtt{sysC}=\mathtt{UDA}(\mathtt{dsysC})$ and show $\mathtt{sysC}\Rightarrow^{*}\mathtt{sysC1}=\mathtt{UDA}(\mathtt{dsysC1})$ If the rule used is not the attack rule using replay or redirect capability or delivery of the target message of such an attack, this follows by the proof of Theorem 0.C.1 and its corollary. We consider the rules in remaining cases.

  * •

[attack(replay(n))] at step k. Let $\texttt{ddm}^{j}$ be the message being
replayed ($j<k$) and $\mathtt{ddm1}^{j,k}=delay(\mathtt{ddm},n)^{j.k}$ be the
copy. Then $\mathtt{UDA}(\mathtt{dsysC})=>\mathtt{UDA}\mathtt{(dsysC1)}$ by
the net rule since $\mathtt{ddm1}^{j,k}$ is not in the UDA image but the
attack moves the original from the first to the second network component.

  * •

[ddrcv] of a replayed message that is delivered to the wrapped endpoint. If
this is the original, then sysC can also receive the message. If this is the
copy (but the original has not been received, thus the copy was not further
delayed) then again sysC can receive the original.

  * •

[ddrcv] and drop a replayed message. Either the original or copy has already
been received and the replayed message will be discarded by UDA thus
$\mathtt{sysC}=\mathtt{sysC1}=\mathtt{UDA}(\mathtt{dsysC1})$.

  * •

[attack(redirect(epid0,epid1))]. Here
$\mathtt{sysC}\rightarrow_{\mathtt{drop}}\mathtt{sysC1}=\mathtt{UDA}(\mathtt{dsysC1})$
since redirected messages are dropped.

  * •

[ddrcv] of a redirected message. This has the effect of a drop. The redirected
message has already been dropped in sysC, and is not in the UDA image. Thus
$\mathtt{sysC}=\mathtt{UDA}(\mathtt{dsysC})=\mathtt{UDA}(\mathtt{dsysC1})=\mathtt{sysC1}$.

2. For the $\mathtt{sysC}\Rightarrow\mathtt{sysC1}$ direction, for any dsysC such that $\mathtt{UDA(dsysC)}=\mathtt{sysC}$ the argument that $\mathtt{dsysC}\Rightarrow^{<3}\mathtt{dsysC1}$ with $\mathtt{UDA}(\mathtt{dsysC1})=\mathtt{sysC1}$ is the same as the proof of Theorem 0.C.1 as the same rules are available for sysC.

###### Corollary 2

With notation as for Theorem 0.C.2 and letting _caps_ be a reactive attacker
capability set we have: $\mathtt{sysI}\approx\mathtt{DC}(\mathtt{sysI},caps)$

###### Proof

Reactive caps have the form mc(tpat,spat,false,acts) where acts is a set of
elements of the form act(tp,sp,n) with tpat,tp being message target patterns
and spat,sp being message source patterns. An attack using capability
mc(tpat,spat,false,acts) at step $k$ with matching target $M^{j}$ generated at
step $j<k$ is a set of messages $M^{j},M_{1}^{j,k}\ldots M_{l}^{j,k}$
($M_{i}^{j,k}$ is the result of action $i$ and behave the same as a delayed or
redirected message). Thus the bisimulation argument for reactive attacks is
the same as that used to prove Theorem 0.C.2.