mirror of
https://github.com/corda/corda.git
synced 2025-04-13 14:13:26 +00:00
Calendars now linked to currency.
This commit is contained in:
parent
7e247a5fff
commit
bbfbce6656
@ -17,6 +17,12 @@ define(['viewmodel/FixedRate'], (fixedRateViewModel) => {
|
||||
"EUR": "EURIBOR"
|
||||
};
|
||||
|
||||
let calendarLookup = {
|
||||
"GBP": "London",
|
||||
"USD": "NewYork",
|
||||
"EUR": "London"
|
||||
};
|
||||
|
||||
let Deal = function(dealViewModel) {
|
||||
let now = new Date();
|
||||
let tradeId = `T${now.getUTCFullYear()}-${now.getUTCMonth()}-${now.getUTCDate()}.${now.getUTCHours()}:${now.getUTCMinutes()}:${now.getUTCSeconds()}:${now.getUTCMilliseconds()}`
|
||||
@ -37,6 +43,7 @@ define(['viewmodel/FixedRate'], (fixedRateViewModel) => {
|
||||
fixedLeg.fixedRate = { ratioUnit: { value: fixedLeg.fixedRate } };
|
||||
fixedLeg.dayCountBasisDay = fixedLeg.dayCountBasis.day;
|
||||
fixedLeg.dayCountBasisYear = fixedLeg.dayCountBasis.year;
|
||||
fixedLeg.paymentCalendar = calendarLookup[common.baseCurrency];
|
||||
delete fixedLeg.dayCountBasis;
|
||||
|
||||
floatingLeg.notional.token = common.baseCurrency;
|
||||
@ -45,6 +52,8 @@ define(['viewmodel/FixedRate'], (fixedRateViewModel) => {
|
||||
floatingLeg.dayCountBasisDay = floatingLeg.dayCountBasis.day;
|
||||
floatingLeg.dayCountBasisYear = floatingLeg.dayCountBasis.year;
|
||||
floatingLeg.index = indexLookup[common.baseCurrency];
|
||||
floatingLeg.fixingCalendar = [calendarLookup[common.baseCurrency]];
|
||||
floatingLeg.paymentCalendar = [calendarLookup[common.baseCurrency]];
|
||||
delete floatingLeg.dayCountBasis;
|
||||
|
||||
common.tradeID = tradeId;
|
||||
|
@ -13,7 +13,6 @@ define([
|
||||
|
||||
$scope.dayCountBasisLookup = dayCountBasisLookup;
|
||||
$scope.deal = nodeService.newDeal();
|
||||
console.log($scope.deal.fixedLeg.dayCountBasis);
|
||||
$scope.createDeal = () => {
|
||||
nodeService.createDeal(new Deal($scope.deal))
|
||||
.then((tradeId) => $location.path('#/deal/' + tradeId), (resp) => {
|
||||
|
@ -15,7 +15,6 @@ define(['utils/dayCountBasisLookup'], (dayCountBasisLookup) => {
|
||||
dayInMonth: 10,
|
||||
paymentRule: "InArrears",
|
||||
paymentDelay: "0",
|
||||
paymentCalendar: "London",
|
||||
interestPeriodAdjustment: "Adjusted"
|
||||
};
|
||||
});
|
@ -18,12 +18,10 @@ define(['utils/dayCountBasisLookup'], (dayCountBasisLookup) => {
|
||||
resetDayInMonth: 10,
|
||||
paymentRule: "InArrears",
|
||||
paymentDelay: "0",
|
||||
paymentCalendar: [ "London" ],
|
||||
interestPeriodAdjustment: "Adjusted",
|
||||
fixingPeriodOffset: 2,
|
||||
resetRule: "InAdvance",
|
||||
fixingsPerPayment: "Quarterly",
|
||||
fixingCalendar: [ "NewYork" ],
|
||||
indexSource: "Rates Service Provider",
|
||||
indexTenor: {
|
||||
name: "3M"
|
||||
|
Loading…
x
Reference in New Issue
Block a user