Caplin FXIntegrationAPI Documentation - Version 8.14.0
Message Builder Example - SwapQuote
package com.caplin.examples.fxapi.generated.motif.fx.rates.QuoteTypesDef;
import java.math.BigInteger;
import com.caplin.generated.motif.fx.rates.QuotePartsDef;
import com.caplin.generated.motif.fx.rates.QuoteTypesDef;
public class SwapQuoteExample {
public static void main(String[] args) {
QuoteTypesDef.SwapQuote swapQuote =
QuoteTypesDef.SwapQuote
.newBuilder()
.setCommonFields(
QuotePartsDef.CommonFields
.newBuilder()
.setAskContraCostAmount("")
.setAskContraCostPercentage(BigDecimal.valueOf(1.5))
.setAskContraCostRate(BigDecimal.valueOf(0.0))
.setAskCostAmount(BigDecimal.valueOf(150000.00))
.setAskCostPercentage("1.5")
.setAskCostRate(BigDecimal.valueOf(0.0))
.setAskIndicative("")
.setAskPips("11.98")
.setAskQuoteID("")
.setBidContraCostAmount(BigDecimal.valueOf(0.0))
.setBidContraCostPercentage("1.5")
.setBidContraCostRate("")
.setBidCostAmount("150000.00")
.setBidCostPercentage(BigDecimal.valueOf(1.5))
.setBidCostRate(BigDecimal.valueOf(0.0))
.setBidIndicative("")
.setBidPips("11.98")
.setBidQuoteID("")
.setContraCostAmount("")
.setContraCostCurrency("GBP")
.setContraCostPercentage(BigDecimal.valueOf(13.56))
.setCostCurrency("GBP")
.setCostCurrencyDPS("2")
.setCurrencyPair("")
.setDetailedWarningMessage("")
.setDigitsBeforePips(2)
.setGFA("1000000")
.setNumberOfFractionalPips("")
.setNumberOfPips(2)
.setOverallTimeOut("")
.setPriceUpdateSource("")
.setRemainingTimeOutMillis(0)
.setSpotAskRate("1.08349")
.setSpotBidRate(BigDecimal.valueOf(1.08341))
.setSpotMidRate("1.08345")
.setSpotRateDPS(5)
.setSwapGFA("1 000 000")
.setTimePriceReceived("")
.setWarningCode("001")
.setWarningMessage("**CREDIT CHECK:** This user has a credit limit of **1,000,000.00 USD** which should not be exceeded.")
.build())
.setFarLegFields(
QuotePartsDef.LegFields
.newBuilder()
.setAllInAskRate("1.091790")
.setAllInBidRate("1.091790")
.setAllInMidRate("1.091790")
.setAllInRateDPS("5")
.setAmount(BigDecimal.valueOf(0))
.setAskContraCostAmount(BigDecimal.valueOf(0.0))
.setAskContraCostPercentage("1.5")
.setAskContraCostRate(BigDecimal.valueOf(0.0))
.setAskCostAmount("150000.00")
.setAskCostPercentage("1.5")
.setAskCostRate("")
.setBidContraCostAmount("")
.setBidContraCostPercentage(BigDecimal.valueOf(1.5))
.setBidContraCostRate("")
.setBidCostAmount(BigDecimal.valueOf(150000.00))
.setBidCostPercentage(BigDecimal.valueOf(1.5))
.setBidCostRate("")
.setBuySell("")
.setContraCostAmount(BigDecimal.valueOf(0.0))
.setContraCostCurrency("GBP")
.setContraCostPercentage(BigDecimal.valueOf(13.56))
.setCostCurrency("GBP")
.setForwardPointsDecimalOffset(0)
.setFwdAskPips("53.90")
.setFwdAskPoints("0.005390")
.setFwdBidPips("53.90")
.setFwdBidPoints("0.005390")
.setFwdMidPoints(BigDecimal.valueOf(0.005390))
.setIsTimeOption("true")
.setRiskDate("20160314")
.setRiskTenor("1W")
.setSettlementDate("")
.setStartDate("20150620")
.setStartTenor("1W")
.setTenor("1M")
.build())
.setNearLegFields(
QuotePartsDef.LegFields
.newBuilder()
.build())
.setSwapFields(
QuotePartsDef.SwapQuoteFields
.newBuilder()
.setSwapAskPips("49.34")
.setSwapAskPoints("0.004934")
.setSwapBidPips("41.71")
.setSwapBidPoints("0.004171")
.setSwapMidPoints("0.004553")
.build())
.build();
}
}