digital-asset / contingent-claims

Apache License 2.0
5 stars 0 forks source link

Make `Until` consistent with PJ paper, change american option builder. Fixes 69 #87

Closed matteolimberto-da closed 2 years ago

matteolimberto-da commented 2 years ago

Fixes https://github.com/digital-asset/contingent-claims/issues/69

This is the PR where the dynamics of Until as well as the american option builder are changed. The problem and proposed solution are described in the related issue.

What I am not yet happy with is the fact that acquire' is now a very complex functions, as it

This can probably be split in different functions to make it a bit simpler. lifecycle would then be a composition of these simpler functions.

matteolimberto-da commented 2 years ago

The latest commits decompose the acquire' function in three components:

I think this makes the code easier to read.

I also got rid of expire as it is no longer needed.

An advantage of the decomposition is that now we can make exercise use only the non-effectful acquire' and thus address https://github.com/digital-asset/contingent-claims/issues/73

matteolimberto-da commented 2 years ago

As discussed in person this seems fine to me. The only thing I would think about is having clear combinators for distinguishing time =< >= and decimal. at and upTo sound fine though.

Thank you. Will open an issue to discuss the names within the team.