Caplin FXIntegrationAPI Documentation - Version 8.2.0

Message Builder Example - CommonSwapTradeConfirmation

package com.caplin.examples.fxapi.generated.motif.fx.tradeconfirmation.TradeConfTypesDef; 

import java.math.BigInteger;
import static com.caplin.motif.fx.config.definitions.common.Tag;

import com.caplin.generated.motif.fx.settlementinstructions.SettlementInstructionsPartsDef;
import com.caplin.generated.motif.fx.tradeconfirmation.TradeConfPartsDef;
import com.caplin.generated.motif.fx.tradeconfirmation.TradeConfTypesDef;

public class CommonSwapTradeConfirmationExample {
    public static void main(String[] args) {
                    		
		TradeConfTypesDef.CommonSwapTradeConfirmation commonSwapTradeConfirmation =
		TradeConfTypesDef.CommonSwapTradeConfirmation
			.newBuilder()
			.setCommonFields(
			TradeConfPartsDef.CommonTradeConfirmationFields
				.newBuilder()
				.setAccount("", true)
				.setAccountEditable()
				.setAllocationSettlementDateOptions("ORIGINAL,EARLIER,LATER")
				.setAmountDPS("2")
				.setAssetType("")
				.setBackOfficeID("")
				.setCanAllocate("")
				.setCanDrawdown(true)
				.setClient("")
				.setClientAgreementDateTime("", true)
				.setClientAgreementDateTimeEditable()
				.setContraAmountDPS(2)
				.setContraCostAmount("")
				.setContraCostCurrency("GBP")
				.setContraCostCurrencyDPS(2)
				.setContraCostPercentage(BigDecimal.valueOf(13.56))
				.setCostAmount("12412891.31")
				.setCostCurrency("GBP")
				.setCostCurrencyDPS(2)
				.setCostPercentage("13.56")
				.setCurrencyPair("")
				.setDealtCurrency("GBP")
				.setDealtCurrencyEditable()
				.setDealtCurrencyRisk()
				.setDeliverableType("")
				.setDigitsBeforePips(2)
				.setEntityDescription("Customer 1")
				.setEntityId("CUSTONE")
				.setExecutionDateTime("20160322123621")
				.setFullName("")
				.setIsAllocated("")
				.setIsAmendable("")
				.setIsCancellable("")
				.setIsReversible(true)
				.setNumberOfPips("2")
				.setOrderID("")
				.setOriginalTradeID("")
				.setPostTradeType("")
				.setPriceSource("st1@caplin.com")
				.setPurpose("Commercial")
				.setRemarks("")
				.setServiceContraCostCurrencyDPS(2)
				.setServiceCostCurrencyDPS(2)
				.setSpotMidRate(BigDecimal.valueOf(1.08345))
				.setSpotRate(BigDecimal.valueOf(1.08341))
				.setSpotRateDPS("5")
				.setTOBOUser("", true, true)
				.setTOBOUserEditable()
				.setTOBOUserRisk()
				.setTags(Arrays.asList(/* ... */))
				.setTradeDate("20160314")
				.setTradeID("00001561")
				.setTraderUsername("sales_trader@novobank.co.za")
				.setTradingType("")
				.setUTI("")
				.setVenue("FX Sales")
				.setWarningCode("001")
				.setWarningMessage("You do not have sufficient credit for EUR")
				.build())
			.setFarLegTradeConfirmation(
			TradeConfPartsDef.LegTradeConfirmationFields
				.newBuilder()
				.addRemarks(
				TradeConfPartsDef.RemarksEntry
					.newBuilder()
					.setRemarkDateTime(Instant.now())
					.setRemarkOriginStatus("")
					.setRemarkSource("")
					.setRemarkTargetStatus("")
					.build())
				.setAccount("Garfields|GARF")
				.setAdjustedSwapPoints("")
				.setAllInMidRate(BigDecimal.valueOf(1.091790))
				.setAllInRate("1.091790")
				.setAllInRateDPS(5)
				.setAllocatableAmount(BigDecimal.valueOf(500))
				.setAllocatableContraAmount("500")
				.setAmount("0")
				.setAmountEditable()
				.setAmountRisk()
				.setBuySell("")
				.setContraAmount(BigDecimal.valueOf(500))
				.setContraCostAmount("")
				.setContraCostCurrency("GBP")
				.setContraCostPercentage("13.56")
				.setCostAmount("12412891.31")
				.setCostCurrency("GBP")
				.setCostPercentage("13.56")
				.setEntityDescription("Customer 1")
				.setEntityId("CUSTONE")
				.setFilledAmount(BigDecimal.valueOf(0))
				.setForwardPointsDecimalOffset("")
				.setFullName("")
				.setFwdMidPoints("0.005390")
				.setFwdPips("11.98")
				.setFwdPoints("0.001198")
				.setIsTimeOption("true")
				.setNostroAccountFields(
				SettlementInstructionsPartsDef.NostroAccount
					.newBuilder()
					.setNostroAccount("AE770090004000824676500")
					.setNostroBIC("ARABAEADABC")
					.setNostroName("GBP Nostro Account.")
					.build())
				.setOriginalRate("")
				.setProfit("1000")
				.setRemainingAmount(BigDecimal.valueOf(500))
				.setRemarks(
				TradeConfPartsDef.RemarksEntry
					.newBuilder()
					.build(), 0)
				.setRiskDate("20160314")
				.setRiskTenor("1W")
				.setServiceContraCostAmount(BigDecimal.valueOf(0.0))
				.setServiceContraCostCurrency("GBP")
				.setServiceCostAmount(BigDecimal.valueOf(0.0))
				.setServiceCostCurrency("GBP")
				.setSettlementDate("")
				.setSettlementDateEditable()
				.setSettlementDateRisk()
				.setSettlementTradeFields(
				SettlementInstructionsPartsDef.SettlementTradeFields
					.newBuilder()
					.addPay(
					SettlementInstructionsPartsDef.SettlementFields
						.newBuilder()
						.setBankAccount("12345678")
						.setBankAddress1("12 Capitol")
						.setBankAddress2("The City")
						.setBankAddress3("London")
						.setBankName("Bank Of Caplin")
						.setBankSwift("CAP123")
						.setIndividualAccount("87654321")
						.setIndividualAddress1("98 Lane")
						.setIndividualAddress2("Manchester")
						.setIndividualName("Susan Sellers")
						.setIndividualSwift("SOLD987")
						.setIsDefaultSettlementInstruction(true)
						.setNettingStatus("NETTED")
						.setSettlementAmount(BigDecimal.valueOf(0.0))
						.setSettlementCurrency("GBP")
						.setSettlementDetailsLine1("")
						.setSettlementDetailsLine2("")
						.setSettlementDetailsLine3("")
						.setSettlementDetailsLine4("")
						.setSettlementDetailsLine5("")
						.setSettlementDetailsLine6("")
						.setSettlementDirection("")
						.setSettlementDisplayName("[CCY] Account 1")
						.setSettlementId("")
						.setSettlementInstructionType("EXISTING")
						.setSettlementStatus("")
						.setSplitComponentId("")
						.build())
					.addPayNettingComponents(
					SettlementInstructionsPartsDef.NettingComponents
						.newBuilder()
						.setAmount("0")
						.setBuySell("")
						.setTradeID("00001561")
						.build())
					.addReceive(
					SettlementInstructionsPartsDef.SettlementFields
						.newBuilder()
						.build())
					.addReceiveNettingComponents(
					SettlementInstructionsPartsDef.NettingComponents
						.newBuilder()
						.build())
					.setAffirmedBy("")
					.setAffirmedDateTime(Instant.now())
					.setCanAdHoc(true)
					.setCanAffirm("")
					.setCanApproveInstructions(true)
					.setCanAutoConfirm(true)
					.setCanCancel("")
					.setCanConfirm("")
					.setCanDispute(true)
					.setCanRejectInstructions(true)
					.setCanRelease(true)
					.setCanReplace(true)
					.setCanUnconfirm(true)
					.setConfirmedBy("")
					.setConfirmedDateTime(Instant.now())
					.setIsPayNetted("")
					.setIsPayNettingRequired("")
					.setIsPaySplit("")
					.setIsReceiveNetted(true)
					.setIsReceiveNettingRequired(true)
					.setIsReceiveSplit("")
					.setNextActionDeadline(Instant.now())
					.setNextActionDeadlineDisplayTimezone("America/New_York")
					.setSettlementStatus("")
					.build())
				.setStartDate("20150620")
				.setStartDateRisk()
				.setStartTenor("", true)
				.setStartTenorRisk()
				.setTOBOUser("", true, true)
				.setTOBOUserEditable()
				.setTOBOUserRisk()
				.setTenor("1M")
				.setTenorEditable()
				.setTenorRisk()
				.setTradeID("00001561")
				.build())
			.setFarNdfLegTradeConfirmation(
			TradeConfPartsDef.NDFLegTradeConfirmationFields
				.newBuilder()
				.setFixingAmount(BigDecimal.valueOf(0.0))
				.setFixingCode("[CCY]1/1600/GBLO")
				.setFixingCurrency("USD")
				.setFixingDate("20150620")
				.setFixingDescription("WMR [CCY] 4pm London")
				.setReferenceAmount("")
				.setReferenceCurrency(BigDecimal.valueOf(0.0))
				.setSettlementAmount("")
				.build())
			.setNdfTradeConfirmation(
			TradeConfPartsDef.NDFTradeConfirmationFields
				.newBuilder()
				.setFixingSource("WMR 8am London Time")
				.setSettlementCurrency("GBP")
				.build())
			.setNearLegTradeConfirmation(
			TradeConfPartsDef.LegTradeConfirmationFields
				.newBuilder()
				.build())
			.setNearNdfLegTradeConfirmation(
			TradeConfPartsDef.NDFLegTradeConfirmationFields
				.newBuilder()
				.build())
			.setSwapFields(
			TradeConfPartsDef.SwapTradeConfirmationFields
				.newBuilder()
				.setSwapMidPoints(BigDecimal.valueOf(0.004553))
				.setSwapPips("53.90")
				.setSwapPoints("0.005390")
				.setSwapType("SPOTFWD")
				.build())
			.build();
            
    }
}