Caplin FXIntegrationAPI Documentation - Version 3.51.0-3064-772a4c6

Message Builder Example - SwapSalesBlotterRecord

package com.caplin.examples.fxapi.generated.motif.fx.blotter.BlotterTypesDef; 

import java.math.BigInteger;

import com.caplin.generated.motif.fx.blotter.BlotterPartsDef;
import com.caplin.generated.motif.fx.blotter.BlotterTypesDef;
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 SwapSalesBlotterRecordExample {
    public static void main(String[] args) {
                    		
		BlotterTypesDef.SwapSalesBlotterRecord swapSalesBlotterRecord =
		BlotterTypesDef.SwapSalesBlotterRecord
			.newBuilder()
			.setCommonFields(
			BlotterPartsDef.CommonBlotterFields
				.newBuilder()
				.setBaseCurrency("USD")
				.setIsAmendable(true)
				.setIsCancellable(true)
				.setIsReversible(true)
				.setStatus("AWAITING-PRICE")
				.setTradingType("")
				.build())
			.setSwapSalesTradeConfirmation(
			TradeConfTypesDef.SwapSalesTradeConfirmation
				.newBuilder()
				.setFarSalesLegTradeConfirmation(
				TradeConfPartsDef.SalesLegTradeConfirmationFields
					.newBuilder()
					.setAllInMargin(BigDecimal.valueOf(0.0), true)
					.setAllInMarginEditable()
					.setFwdMargin("", true)
					.setFwdMarginEditable()
					.setTraderAllInRate("1.005390")
					.setTraderFwdPoints(BigDecimal.valueOf(0.005390))
					.build())
				.setNearSalesLegTradeConfirmation(
				TradeConfPartsDef.SalesLegTradeConfirmationFields
					.newBuilder()
					.build())
				.setSalesCommonFields(
				TradeConfPartsDef.SalesCommonTradeConfirmationFields
					.newBuilder()
					.setCompetition("")
					.setIsAdvised(true)
					.setProfit(BigDecimal.valueOf(1000))
					.setProfitCurrency("USD")
					.setProfitCurrencyDPS(5)
					.setProfitIsHouse("")
					.setProfitRate("1.091790")
					.setReasons("")
					.setSource("")
					.setSpotMargin(BigDecimal.valueOf(0.0), true)
					.setSpotMarginEditable()
					.setTraderRemarks("")
					.setTraderSpotRate(BigDecimal.valueOf(1.09174))
					.build())
				.setSalesSwapFields(
				TradeConfPartsDef.SalesSwapTradeConfirmationFields
					.newBuilder()
					.setSwapMargin("", true)
					.setSwapMarginEditable()
					.setTraderSwapPoints(BigDecimal.valueOf(0.004211))
					.build())
				.setSwapTradeConfirmation(
				TradeConfTypesDef.SwapTradeConfirmation
					.newBuilder()
					.setCommonFields(
					TradeConfPartsDef.CommonTradeConfirmationFields
						.newBuilder()
						.setAccount("", true)
						.setAccountEditable()
						.setAssetType("")
						.setCanAllocate("")
						.setClient("")
						.setCostAmount(BigDecimal.valueOf(12412891.31))
						.setCostCurrency("GBP")
						.setCostCurrencyDPS(2)
						.setCostPercentage(BigDecimal.valueOf(13.56))
						.setCurrencyPair("")
						.setDealtCurrency("", true, true)
						.setDealtCurrencyEditable()
						.setDealtCurrencyRisk()
						.setDigitsBeforePips("2")
						.setEntityDescription("Customer 1")
						.setEntityId("CUSTONE")
						.setExecutionDateTime("20160322123621")
						.setIsAllocated(true)
						.setIsAmendable("")
						.setIsCancellable("")
						.setIsReversible(true)
						.setNumberOfPips("2")
						.setOrderID("")
						.setRemarks("")
						.setSpotMidRate(BigDecimal.valueOf(1.08345))
						.setSpotRate(BigDecimal.valueOf(1.08341))
						.setSpotRateDPS(5)
						.setStreamingMode("MANUAL, STREAMING")
						.setTOBOUser("", true, true)
						.setTOBOUserEditable()
						.setTOBOUserRisk()
						.setTradeDate("20160314")
						.setTradeID("00001561")
						.setTraderSpotAskRate("1.08575")
						.setTraderSpotBidRate(BigDecimal.valueOf(1.08575))
						.setTraderUsername("sales_trader@novobank.co.za")
						.setTradingType("")
						.setWarningCode("001")
						.setWarningMessage("You do not have sufficient credit for EUR")
						.build())
					.setFarLegTradeConfirmation(
					TradeConfPartsDef.LegTradeConfirmationFields
						.newBuilder()
						.addRemarks(
						TradeConfPartsDef.RemarksEntry
							.newBuilder()
							.setRemarkDateTime(Instant.now())
							.setRemarkSource("")
							.build())
						.setAccount("Garfields|GARF")
						.setAllInMidRate(BigDecimal.valueOf(1.091790))
						.setAllInRate(BigDecimal.valueOf(1.091790))
						.setAllInRateDPS("5")
						.setAmount("", true, true)
						.setAmountEditable()
						.setAmountRisk()
						.setBuySell("")
						.setContraAmount(BigDecimal.valueOf(350))
						.setCostAmount("12412891.31")
						.setFwdMidPoints("0.005390")
						.setFwdPips("11.98")
						.setFwdPoints(BigDecimal.valueOf(0.001198))
						.setNostroAccountFields(
						SettlementInstructionsPartsDef.NostroAccount
							.newBuilder()
							.setNostroAccount("AE770090004000824676500")
							.setNostroBIC("ARABAEADABC")
							.setNostroName("GBP Nostro Account.")
							.build())
						.setProfit(BigDecimal.valueOf(1000))
						.setRemarks(
						TradeConfPartsDef.RemarksEntry
							.newBuilder()
							.build(), 0)
						.setSettlementDate("", true, true)
						.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("")
								.setNettingStatus("NETTED")
								.setSettlementAmount(BigDecimal.valueOf(0.0))
								.setSettlementCurrency("GBP")
								.setSettlementDetailsLine1("")
								.setSettlementDetailsLine2("")
								.setSettlementDetailsLine3("")
								.setSettlementDetailsLine4("")
								.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("2018-03-16T07:25:16+00:00")
							.setCanAdHoc("")
							.setCanAffirm(true)
							.setCanAutoConfirm("")
							.setCanCancel("")
							.setCanConfirm("")
							.setCanDispute(true)
							.setCanReplace(true)
							.setCanUnconfirm("")
							.setConfirmedBy("")
							.setConfirmedDateTime("2018-03-16T07:25:16+00:00")
							.setIsPayNetted(true)
							.setIsPayNettingRequired("")
							.setIsPaySplit("")
							.setIsReceiveNetted("")
							.setIsReceiveNettingRequired(true)
							.setIsReceiveSplit(true)
							.setNextActionDeadline(Instant.now())
							.setNextActionDeadlineDisplayTimezone("America/New_York")
							.setSettlementStatus("")
							.build())
						.setTenor("", true, true)
						.setTenorEditable()
						.setTenorRisk()
						.build())
					.setNearLegTradeConfirmation(
					TradeConfPartsDef.LegTradeConfirmationFields
						.newBuilder()
						.build())
					.setSwapFields(
					TradeConfPartsDef.SwapTradeConfirmationFields
						.newBuilder()
						.setSwapMidPoints("0.004553")
						.setSwapPips("53.90")
						.setSwapPoints(BigDecimal.valueOf(0.005390))
						.setSwapType("SPOTFWD")
						.build())
					.build())
				.build())
			.build();
            
    }
}