Example 7.1

Problem (a)

ft_71a = 300*(1+0.08)^(180/365)
ft_71a
## [1] 311.6048

Problem (b)

ft_71b = 308*(1+0.08)^(130/365)
ft_71b
## [1] 316.5593
margin = ft_71b - ft_71a
margin
## [1] 4.954448

Example 7.2

ft_72 = (230 - (10/1.09^(35/365)) - (12/1.09^(215/365)))*1.09^(250/365)
ft_72
## [1] 221.3643

Example 7.3

Problem (a)

gross = 97.71 - (105.67 * 0.923400)
gross
## [1] 0.134322

Problem (b)

accrued = 100 * 0.04 * (133/365)
accrued
## [1] 1.457534
cost_of_carry = 99.168 * 0.034625 * 82/360
cost_of_carry
## [1] 0.7821187
total.cost = 99.168 + 0.782
total.cost
## [1] 99.95
accrued.2 = 100 * 0.04 * (215/365)
accrued.2
## [1] 2.356164
settlement = 105.67 * 0.923400 + 2.356
settlement
## [1] 99.93168
net.basis = 99.932 - 99.950
net.basis
## [1] -0.018

Problem (c)

repo.rate = (99.932 - 99.168)/(99.168 * (82/360))
repo.rate
## [1] 0.03382287