{"action":"created","comment":{"url":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments/47508931","id":47508931,"diff_hunk":"@@ -0,0 +1,108 @@\n+/**\n+ * Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies\n+ *\n+ * Please see distribution for license.\n+ */\n+package com.opengamma.strata.pricer.impl.rate.swap;\n+\n+import java.time.LocalDate;\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import com.opengamma.strata.basics.PayReceive;\n+import com.opengamma.strata.basics.currency.CurrencyAmount;\n+import com.opengamma.strata.basics.currency.Payment;\n+import com.opengamma.strata.basics.index.IborIndex;\n+import com.opengamma.strata.basics.schedule.SchedulePeriod;\n+import com.opengamma.strata.collect.ArgChecker;\n+import com.opengamma.strata.pricer.rate.RatesProvider;\n+import com.opengamma.strata.pricer.swap.PaymentPeriodPricer;\n+import com.opengamma.strata.product.rate.FixedRateObservation;\n+import com.opengamma.strata.product.rate.IborRateObservation;\n+import com.opengamma.strata.product.swap.ExpandedSwap;\n+import com.opengamma.strata.product.swap.ExpandedSwapLeg;\n+import com.opengamma.strata.product.swap.FxReset;\n+import com.opengamma.strata.product.swap.KnownAmountPaymentPeriod;\n+import com.opengamma.strata.product.swap.PaymentPeriod;\n+import com.opengamma.strata.product.swap.RateAccrualPeriod;\n+import com.opengamma.strata.product.swap.RatePaymentPeriod;\n+import com.opengamma.strata.product.swap.SwapLegType;\n+import com.opengamma.strata.product.swap.SwapProduct;\n+\n+/**\n+ * Computes cash flow equivalent of products.\n+ * <p>\n+ * Reference: Henrard, M. The Irony in the derivatives discounting Part II: the crisis. Wilmott Journal, 2010, 2, 301-316. \n+ */\n+public final class CashFlowEquivalentCalculator {\n+\n+  /**\n+   * Computes cash flow equivalent of swap product. \n+   * <p>\n+   * The swap should be a fix-for-Ibor swap without compounding, and its swap legs should not involve {@code PaymentEvent}.","path":"modules/pricer/src/main/java/com/opengamma/strata/pricer/impl/rate/swap/CashFlowEquivalentCalculator.java","position":42,"original_position":42,"commit_id":"f0be6567fa3bb8ee663a5763e7e962a48a5b15be","original_commit_id":"f0be6567fa3bb8ee663a5763e7e962a48a5b15be","user":{"login":"marc-opengamma","id":644983,"avatar_url":"https://avatars.githubusercontent.com/u/644983?v=3","gravatar_id":"","url":"https://api.github.com/users/marc-opengamma","html_url":"https://github.com/marc-opengamma","followers_url":"https://api.github.com/users/marc-opengamma/followers","following_url":"https://api.github.com/users/marc-opengamma/following{/other_user}","gists_url":"https://api.github.com/users/marc-opengamma/gists{/gist_id}","starred_url":"https://api.github.com/users/marc-opengamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marc-opengamma/subscriptions","organizations_url":"https://api.github.com/users/marc-opengamma/orgs","repos_url":"https://api.github.com/users/marc-opengamma/repos","events_url":"https://api.github.com/users/marc-opengamma/events{/privacy}","received_events_url":"https://api.github.com/users/marc-opengamma/received_events","type":"User","site_admin":false},"body":"Maybe the calculator should act at the leg level first. Then the swap can combine several legs, as long as each of them is of the type FIXED or IBOR.","created_at":"2015-12-14T15:19:23Z","updated_at":"2015-12-14T15:19:23Z","html_url":"https://github.com/OpenGamma/Strata/pull/617#discussion_r47508931","pull_request_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/617","_links":{"self":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments/47508931"},"html":{"href":"https://github.com/OpenGamma/Strata/pull/617#discussion_r47508931"},"pull_request":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/617"}}},"pull_request":{"url":"https://api.github.com/repos/OpenGamma/Strata/pulls/617","id":52383601,"html_url":"https://github.com/OpenGamma/Strata/pull/617","diff_url":"https://github.com/OpenGamma/Strata/pull/617.diff","patch_url":"https://github.com/OpenGamma/Strata/pull/617.patch","issue_url":"https://api.github.com/repos/OpenGamma/Strata/issues/617","number":617,"state":"open","locked":false,"title":"Hull White model for swaption","user":{"login":"yukiiwashita","id":3006656,"avatar_url":"https://avatars.githubusercontent.com/u/3006656?v=3","gravatar_id":"","url":"https://api.github.com/users/yukiiwashita","html_url":"https://github.com/yukiiwashita","followers_url":"https://api.github.com/users/yukiiwashita/followers","following_url":"https://api.github.com/users/yukiiwashita/following{/other_user}","gists_url":"https://api.github.com/users/yukiiwashita/gists{/gist_id}","starred_url":"https://api.github.com/users/yukiiwashita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yukiiwashita/subscriptions","organizations_url":"https://api.github.com/users/yukiiwashita/orgs","repos_url":"https://api.github.com/users/yukiiwashita/repos","events_url":"https://api.github.com/users/yukiiwashita/events{/privacy}","received_events_url":"https://api.github.com/users/yukiiwashita/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-02T11:26:54Z","updated_at":"2015-12-14T15:19:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"baaf7d733d2591b80cca4e2b0d07c3d21518295b","assignee":{"login":"marc-opengamma","id":644983,"avatar_url":"https://avatars.githubusercontent.com/u/644983?v=3","gravatar_id":"","url":"https://api.github.com/users/marc-opengamma","html_url":"https://github.com/marc-opengamma","followers_url":"https://api.github.com/users/marc-opengamma/followers","following_url":"https://api.github.com/users/marc-opengamma/following{/other_user}","gists_url":"https://api.github.com/users/marc-opengamma/gists{/gist_id}","starred_url":"https://api.github.com/users/marc-opengamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marc-opengamma/subscriptions","organizations_url":"https://api.github.com/users/marc-opengamma/orgs","repos_url":"https://api.github.com/users/marc-opengamma/repos","events_url":"https://api.github.com/users/marc-opengamma/events{/privacy}","received_events_url":"https://api.github.com/users/marc-opengamma/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/617/commits","review_comments_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/617/comments","review_comment_url":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/issues/617/comments","statuses_url":"https://api.github.com/repos/OpenGamma/Strata/statuses/f0be6567fa3bb8ee663a5763e7e962a48a5b15be","head":{"label":"OpenGamma:topic/swaption-hull-white","ref":"topic/swaption-hull-white","sha":"f0be6567fa3bb8ee663a5763e7e962a48a5b15be","user":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"repo":{"id":20882897,"name":"Strata","full_name":"OpenGamma/Strata","owner":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGamma/Strata","description":"OpenGamma's next-generation market risk toolkit","fork":false,"url":"https://api.github.com/repos/OpenGamma/Strata","forks_url":"https://api.github.com/repos/OpenGamma/Strata/forks","keys_url":"https://api.github.com/repos/OpenGamma/Strata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGamma/Strata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGamma/Strata/teams","hooks_url":"https://api.github.com/repos/OpenGamma/Strata/hooks","issue_events_url":"https://api.github.com/repos/OpenGamma/Strata/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGamma/Strata/events","assignees_url":"https://api.github.com/repos/OpenGamma/Strata/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGamma/Strata/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGamma/Strata/tags","blobs_url":"https://api.github.com/repos/OpenGamma/Strata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGamma/Strata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGamma/Strata/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGamma/Strata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGamma/Strata/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGamma/Strata/languages","stargazers_url":"https://api.github.com/repos/OpenGamma/Strata/stargazers","contributors_url":"https://api.github.com/repos/OpenGamma/Strata/contributors","subscribers_url":"https://api.github.com/repos/OpenGamma/Strata/subscribers","subscription_url":"https://api.github.com/repos/OpenGamma/Strata/subscription","commits_url":"https://api.github.com/repos/OpenGamma/Strata/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGamma/Strata/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGamma/Strata/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenGamma/Strata/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGamma/Strata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGamma/Strata/merges","archive_url":"https://api.github.com/repos/OpenGamma/Strata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGamma/Strata/downloads","issues_url":"https://api.github.com/repos/OpenGamma/Strata/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGamma/Strata/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGamma/Strata/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGamma/Strata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGamma/Strata/labels{/name}","releases_url":"https://api.github.com/repos/OpenGamma/Strata/releases{/id}","created_at":"2014-06-16T11:45:55Z","updated_at":"2015-12-02T14:06:08Z","pushed_at":"2015-12-14T12:33:03Z","git_url":"git://github.com/OpenGamma/Strata.git","ssh_url":"git@github.com:OpenGamma/Strata.git","clone_url":"https://github.com/OpenGamma/Strata.git","svn_url":"https://github.com/OpenGamma/Strata","homepage":"http://opengamma.github.io/StrataDocs","size":22761,"stargazers_count":29,"watchers_count":29,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":64,"forks":17,"open_issues":64,"watchers":29,"default_branch":"master"}},"base":{"label":"OpenGamma:master","ref":"master","sha":"33476af591e6937183548ef288e1f4820980ed7b","user":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"repo":{"id":20882897,"name":"Strata","full_name":"OpenGamma/Strata","owner":{"login":"OpenGamma","id":120064,"avatar_url":"https://avatars.githubusercontent.com/u/120064?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenGamma","html_url":"https://github.com/OpenGamma","followers_url":"https://api.github.com/users/OpenGamma/followers","following_url":"https://api.github.com/users/OpenGamma/following{/other_user}","gists_url":"https://api.github.com/users/OpenGamma/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenGamma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenGamma/subscriptions","organizations_url":"https://api.github.com/users/OpenGamma/orgs","repos_url":"https://api.github.com/users/OpenGamma/repos","events_url":"https://api.github.com/users/OpenGamma/events{/privacy}","received_events_url":"https://api.github.com/users/OpenGamma/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenGamma/Strata","description":"OpenGamma's next-generation market risk toolkit","fork":false,"url":"https://api.github.com/repos/OpenGamma/Strata","forks_url":"https://api.github.com/repos/OpenGamma/Strata/forks","keys_url":"https://api.github.com/repos/OpenGamma/Strata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenGamma/Strata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenGamma/Strata/teams","hooks_url":"https://api.github.com/repos/OpenGamma/Strata/hooks","issue_events_url":"https://api.github.com/repos/OpenGamma/Strata/issues/events{/number}","events_url":"https://api.github.com/repos/OpenGamma/Strata/events","assignees_url":"https://api.github.com/repos/OpenGamma/Strata/assignees{/user}","branches_url":"https://api.github.com/repos/OpenGamma/Strata/branches{/branch}","tags_url":"https://api.github.com/repos/OpenGamma/Strata/tags","blobs_url":"https://api.github.com/repos/OpenGamma/Strata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenGamma/Strata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenGamma/Strata/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenGamma/Strata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenGamma/Strata/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenGamma/Strata/languages","stargazers_url":"https://api.github.com/repos/OpenGamma/Strata/stargazers","contributors_url":"https://api.github.com/repos/OpenGamma/Strata/contributors","subscribers_url":"https://api.github.com/repos/OpenGamma/Strata/subscribers","subscription_url":"https://api.github.com/repos/OpenGamma/Strata/subscription","commits_url":"https://api.github.com/repos/OpenGamma/Strata/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenGamma/Strata/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenGamma/Strata/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenGamma/Strata/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenGamma/Strata/contents/{+path}","compare_url":"https://api.github.com/repos/OpenGamma/Strata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenGamma/Strata/merges","archive_url":"https://api.github.com/repos/OpenGamma/Strata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenGamma/Strata/downloads","issues_url":"https://api.github.com/repos/OpenGamma/Strata/issues{/number}","pulls_url":"https://api.github.com/repos/OpenGamma/Strata/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenGamma/Strata/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenGamma/Strata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenGamma/Strata/labels{/name}","releases_url":"https://api.github.com/repos/OpenGamma/Strata/releases{/id}","created_at":"2014-06-16T11:45:55Z","updated_at":"2015-12-02T14:06:08Z","pushed_at":"2015-12-14T12:33:03Z","git_url":"git://github.com/OpenGamma/Strata.git","ssh_url":"git@github.com:OpenGamma/Strata.git","clone_url":"https://github.com/OpenGamma/Strata.git","svn_url":"https://github.com/OpenGamma/Strata","homepage":"http://opengamma.github.io/StrataDocs","size":22761,"stargazers_count":29,"watchers_count":29,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":64,"forks":17,"open_issues":64,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/617"},"html":{"href":"https://github.com/OpenGamma/Strata/pull/617"},"issue":{"href":"https://api.github.com/repos/OpenGamma/Strata/issues/617"},"comments":{"href":"https://api.github.com/repos/OpenGamma/Strata/issues/617/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/617/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenGamma/Strata/pulls/617/commits"},"statuses":{"href":"https://api.github.com/repos/OpenGamma/Strata/statuses/f0be6567fa3bb8ee663a5763e7e962a48a5b15be"}}}}