Commit 8b6a7fcc by Amelin Konstantin

Add CommoditySwapTemplate

parent 4ab58a85
<?xml version='1.0' encoding='windows-1251'?>
<nonpublicExecutionReport xmlns="http://www.fpml.org/FpML-5/recordkeeping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fpmlext="http://www.fpml.org/FpML-5/ext" xmlns:nsdext="http://www.fpml.org/FpML-5/recordkeeping/nsd-ext" xsi:schemaLocation="http://www.fpml.org/FpML-5/recordkeeping fpml-recordkeeping-merged-schema.xsd http://www.fpml.org/FpML-5/recordkeeping/nsd-ext nsd-ext-merged-schema.xsd" fpmlVersion="5-4">
<header>
<messageId messageIdScheme="http://repository.nsd.ru/coding-scheme/messageid(nsdrus)">BCSN1C6ac72915743c2a9e65e00f315e8f2</messageId>
<sentBy>RP0058900001</sentBy>
<sendTo>NDC000000000</sendTo>
<creationTimestamp>2018-10-17T13:36:29.346115</creationTimestamp>
<implementationSpecification>
<version>4.4</version>
</implementationSpecification>
</header>
<isCorrection>false</isCorrection>
<correlationId correlationIdScheme="http://repository.nsd.ru/coding-scheme/correlationId(nsdrus)">[RP0058900001]-[2018]-[BCSN1C6ac72915743c2a9e65e00f315e8f2]</correlationId>
<asOfDate>2018-10-17</asOfDate>
<trade xsi:type="nsdext:TradeNsd">
<tradeHeader>
<partyTradeIdentifier>
<partyReference href="TradeRepository"/>
<tradeId>NONREF</tradeId>
<linkId linkIdScheme="http://repository.nsd.ru/coding-scheme/linkid(nsdrus)">MA0005996325</linkId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="Party1"/>
<tradeId>01/171018-sw-493552/18-</tradeId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="Party2"/>
<tradeId>01/171018-sw</tradeId>
</partyTradeIdentifier>
<partyTradeIdentifier>
<partyReference href="UTIGeneratingParty"/>
<tradeId>253400GRCV94X91GAW80TRGSS01171018SW49355218M</tradeId>
</partyTradeIdentifier>
<partyTradeInformation>
<partyReference href="TradeRepository"/>
<reportingRegime>
<name reportingRegimeNameScheme="http://www.fpml.org/coding-scheme/reporting-regime">RussianFederation</name>
</reportingRegime>
</partyTradeInformation>
<tradeDate>2018-10-17</tradeDate>
</tradeHeader>
<commoditySwap>
<productType productTypeScheme="http://www.fpml.org/coding-scheme/product-taxonomy">Commodity:Swap:Physical</productType>
<productId>SCFXNNN</productId>
<effectiveDate>
<adjustableDate>
<unadjustedDate>2018-10-17</unadjustedDate>
</adjustableDate>
</effectiveDate>
<terminationDate>
<adjustableDate>
<unadjustedDate>2018-12-10</unadjustedDate>
</adjustableDate>
</terminationDate>
<settlementCurrency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</settlementCurrency>
<fixedLeg>
<payerPartyReference href="Party2"/>
<receiverPartyReference href="Party1"/>
<calculationDates>
<unadjustedDate>2018-10-17</unadjustedDate>
</calculationDates>
<totalPrice>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<amount>8296000.0</amount>
</totalPrice>
<totalNotionalQuantity>200.0</totalNotionalQuantity>
<paymentDates>
<adjustableDates>
<unadjustedDate>2018-10-17</unadjustedDate>
</adjustableDates>
</paymentDates>
</fixedLeg>
<nsdext:commoditySwapPhysicalLeg>
<nsdext:commodity xsi:type="nsdext:CommodityBasket" id="Commodity1">
<instrumentId instrumentIdScheme="">Commodity:Energy:Oil </instrumentId>
<unit quantityUnitScheme="http://www.fpml.org/coding-scheme/price-quote-units">MT</unit>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
</nsdext:commodity>
<payerPartyReference href="Party1"/>
<receiverPartyReference href="Party2"/>
<nsdext:deliveryPeriods>
<periods>
<unadjustedDate>2018-12-08</unadjustedDate>
</periods>
</nsdext:deliveryPeriods>
<nsdext:deliveryQuantity>
<totalPhysicalQuantity>
<quantityUnit quantityUnitScheme="http://www.fpml.org/coding-scheme/price-quote-units">MT</quantityUnit>
<quantity>200.0</quantity>
</totalPhysicalQuantity>
</nsdext:deliveryQuantity>
</nsdext:commoditySwapPhysicalLeg>
<fixedLeg>
<payerPartyReference href="Party1"/>
<receiverPartyReference href="Party2"/>
<calculationDates>
<unadjustedDate>2018-12-09</unadjustedDate>
</calculationDates>
<totalPrice>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
<amount>8463249.21</amount>
</totalPrice>
<totalNotionalQuantity>200.0</totalNotionalQuantity>
<paymentDates>
<adjustableDates>
<unadjustedDate>2018-12-09</unadjustedDate>
</adjustableDates>
</paymentDates>
</fixedLeg>
<nsdext:commoditySwapPhysicalLeg>
<nsdext:commodity xsi:type="nsdext:CommodityBasket" id="Commodity2">
<instrumentId instrumentIdScheme="">Commodity:Energy:Oil </instrumentId>
<unit quantityUnitScheme="http://www.fpml.org/coding-scheme/price-quote-units">MT</unit>
<currency currencyScheme="http://www.fpml.org/ext/iso4217-2001-08-15">RUB</currency>
</nsdext:commodity>
<payerPartyReference href="Party2"/>
<receiverPartyReference href="Party1"/>
<nsdext:deliveryPeriods>
<periods>
<unadjustedDate>2018-12-10</unadjustedDate>
</periods>
</nsdext:deliveryPeriods>
<nsdext:deliveryQuantity>
<totalPhysicalQuantity>
<quantityUnit quantityUnitScheme="http://www.fpml.org/coding-scheme/price-quote-units">MT</quantityUnit>
<quantity>200.0</quantity>
</totalPhysicalQuantity>
</nsdext:deliveryQuantity>
</nsdext:commoditySwapPhysicalLeg>
</commoditySwap>
<nsdext:collateral>
<nsdext:marginType>U</nsdext:marginType>
<nsdext:collateralForm>U</nsdext:collateralForm>
</nsdext:collateral>
<nsdext:nsdSpecificTradeFields>
<nsdext:cleared>N</nsdext:cleared>
<nsdext:reconciliationType>GENF</nsdext:reconciliationType>
<nsdext:clearSettlementType clearSettlementTypeScheme="http://repository.nsd.ru/coding-scheme/clear-settlement-type">OTC</nsdext:clearSettlementType>
<nsdext:clearSettlementMethod clearSettlementMethodScheme="http://repository.nsd.ru/coding-scheme/clear-settlement-method">P</nsdext:clearSettlementMethod>
<nsdext:confirmationMethod>MXME</nsdext:confirmationMethod>
<nsdext:automaticExecution>N</nsdext:automaticExecution>
<nsdext:startAgreementDate>2018-10-17</nsdext:startAgreementDate>
<nsdext:endAgreementDate>2018-12-10</nsdext:endAgreementDate>
<nsdext:productSpecificCodes>
<nsdext:productGeneralCodes>
<nsdext:classificationCode>
<nsdext:specificCode>ProductRelation</nsdext:specificCode>
<nsdext:code>S</nsdext:code>
</nsdext:classificationCode>
</nsdext:productGeneralCodes>
</nsdext:productSpecificCodes>
<nsdext:clientDetails>
<nsdext:servicingParty href="Party1"/>
<nsdext:type>L</nsdext:type>
<nsdext:id>INN_7700956847</nsdext:id>
<nsdext:name> ""</nsdext:name>
<nsdext:country countryScheme="http://www.fpml.org/ext/iso3166">RU</nsdext:country>
</nsdext:clientDetails>
<nsdext:clientDetails>
<nsdext:servicingParty href="Party2"/>
<nsdext:ownTrade>true</nsdext:ownTrade>
</nsdext:clientDetails>
</nsdext:nsdSpecificTradeFields>
</trade>
<party id="TradeRepository">
<partyId>NDC000000000</partyId>
<partyId>LEI_253400M18U5TB02TW421</partyId>
<partyName> </partyName>
</party>
<party id="Party1">
<partyId>RP0058900001</partyId>
<partyId>LEI_253400GRCV94X91GAW80</partyId>
<partyName> " "</partyName>
<classification>B</classification>
<country>RU</country>
<organizationType>L</organizationType>
</party>
<party id="Party2">
<partyId>NONREF</partyId>
<partyId>INN_5407526491</partyId>
<partyName> " "</partyName>
<classification>Other</classification>
<country>RU</country>
<organizationType>L</organizationType>
</party>
<party id="Sender">
<partyId>RP0058900001</partyId>
<partyId>LEI_253400GRCV94X91GAW80</partyId>
<partyName> " "</partyName>
</party>
<party id="UTIGeneratingParty">
<partyId>RP0058900001</partyId>
<partyId>LEI_253400GRCV94X91GAW80</partyId>
<partyName> " "</partyName>
</party>
</nonpublicExecutionReport>
......@@ -34,6 +34,8 @@ object Main {
if (debugMode) new EquityForwardTemplate(source) with Logger else new EquityForwardTemplate(source)
case v if v == "commodityForward" =>
if (debugMode) new CommodityForwardTemplate(source) with Logger else new CommodityForwardTemplate(source)
case v if v == "commoditySwap" =>
if (debugMode) new CommoditySwapTemplate(source) with Logger else new CommoditySwapTemplate(source)
case v => throw new Exception("Undefined trade type")
}
}
......
......@@ -14,8 +14,8 @@ class CommodityForwardTemplate(source: Node) extends TradeTemplate(source) {
</fpml:adjustableDate>
</fpml:valueDate>
<fpml:fixedLeg>
<fpml:buyerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "buyerPartyReference", "href") }/>
<fpml:sellerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "sellerPartyReference", "href") }/>
<fpml:payerPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "payerPartyReference", "href") }/>
<fpml:receiverPartyReference href={ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "receiverPartyReference", "href") }/>
<fpml:fixedPrice>
<fpml:price>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "price") }</fpml:price>
<fpml:priceCurrency>{ get(source \ "trade" \ "commodityForward" \ "fixedLeg" \ "fixedPrice" \ "priceCurrency") }</fpml:priceCurrency>
......
package templates
import scala.xml.Node
class CommoditySwapTemplate(source: Node) extends TradeTemplate(source) {
protected[this] def templateTradeBody: Node = {
<fpml:commoditySwap>
{ /* <fpml:productType>{ get(source \ "trade" \ "commoditySwap" \ "productType") }</fpml:productType> */}
<fpml:productId>{ get(source \ "trade" \ "commoditySwap" \ "productId") }</fpml:productId>
<fpml:effectiveDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commoditySwap" \ "effectiveDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:effectiveDate>
<fpml:terminationDate>
<fpml:adjustableDate>
<fpml:unadjustedDate>{ get(source \ "trade" \ "commoditySwap" \ "terminationDate" \\ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:adjustableDate>
</fpml:terminationDate>
<fpml:settlementCurrency>{ get(source \ "trade" \ "commoditySwap" \ "settlementCurrency") }</fpml:settlementCurrency>
{ for (s <- source \ "trade" \ "commoditySwap" \ "fixedLeg") yield {
<fpml:fixedLeg>
<fpml:payerPartyReference href={get(s \ "payerPartyReference", "href")}/>
<fpml:receiverPartyReference href={get(s \ "receiverPartyReference", "href")}/>
<fpml:calculationDates>
<fpml:unadjustedDate>{ get(s \ "calculationDates" \ "unadjustedDate") }</fpml:unadjustedDate>
</fpml:calculationDates>
<fpml:fixedPrice>
<fpml:price>{ get(s \ "fixedPrice" \ "price") }</fpml:price>
<fpml:priceCurrency>{ get(s \ "fixedPrice" \ "priceCurrency") }</fpml:priceCurrency>
<fpml:priceUnit>{ get(s \ "fixedPrice" \ "priceUnit") }</fpml:priceUnit>
</fpml:fixedPrice>
<fpml:totalPrice>
<fpml:currency>{ get(s \ "totalPrice" \ "currency") }</fpml:currency>
<fpml:amount>{ get(s \ "totalPrice" \ "amount") }</fpml:amount>
</fpml:totalPrice>
<fpml:totalNotionalQuantity>{ get(s \ "totalNotionalQuantity") }</fpml:totalNotionalQuantity>
<fpml:paymentDates>
<fpml:adjustableDates>
<fpml:unadjustedDate>{ get(s \ "paymentDates" \\ "unadjustedDate") }
</fpml:unadjustedDate>
</fpml:adjustableDates>
</fpml:paymentDates>
</fpml:fixedLeg>
}
}
</fpml:commoditySwap>
}
def isStraight = true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment