Futures Trade Flow
9 March 2011
Ian Bond Exchange Trade Derivatives Prime Services IT
QCon 2011
Futures Trade Flow Ian Bond Exchange Trade Derivatives Prime - - PowerPoint PPT Presentation
QCon 2011 Futures Trade Flow Ian Bond Exchange Trade Derivatives Prime Services IT 9 March 2011 bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt Introductions Who is Ian Bond ? Last
9 March 2011
QCon 2011
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
1
– Last 10 years working on client facing reporting & connectivity software – Part developer, part architect, part dev manager – Work here was done as a team.
– Client focused financial services firm of 65,000 people. – Wealth Management – Investment Banking – Asset Management – Retail Bank in Switzerland
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
2
Section 1
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
4
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
5
– is traded on an exchange – is based on the price of a commodity, stock, stock index, bond, or currency, referred to as the "underlying"
– Price, Time, Amount
– the delivery of the underlying – or settlement in cash
– S&P500 Index Future – Heating Degree Day Futures
– Index goes up as the temperature goes down, interest to businesses that supply heating oil for example.
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
6
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
7
Direct Memberships Agent Broker Relationships 55 15
The Americas
Asia/Pacific
Exchange
EMEA
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
8
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
9
Section 2
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
11
– New exchanges, new products, new regulations
– Inflexibility
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
12
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
13
– Reduce the complexity in the environment. – Better abstraction from exchange specifics.
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
14
– Understanding the domain and business processes
– when a change happens allow immediate relevant processing to follow – make trade flow extension points simple to add
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
15
through multiple component teams, sometimes up to 5.
component learning. Lean Thinking.
structure of the organization that built it.
Development
Development
from the old component teams.
spreadsheet for backlog
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
16
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
17
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
18
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
19
Eric Evans
Section 3
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
21
– FIX – FpML – Swift
– Standard topics – Standard approach
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
22
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
23
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
24
<ExecRpt OrdID=”123456" OrdID2="CMEORD123" ExecID2="CMEEXEC54321" ID="CLIORD_ABC1" ExecID=”123456_1_1" ExecTyp="F" Stat="1" Acct=“ABCDEF-2Z009" AcctIDSrc="100" Side="1" CustCpcty="4" LastMkt="XCME" LeavesQty="80" CumQty="20" TrdDt="2010-05-18" TxnTm="2010-05-18T15:08:00-00:00" MLegRptTyp="1"> <Hdr SSub="UBS:ETD:KES"/> <Pty R="1" Src="C" ID="UBS"/> <Pty R="4" Src="C" ID=”BCD"> <Sub Typ="10" ID="G Up Ref 123"/> </Pty> <Pty R="73" Src="g" ID="XCME"/> <Pty R="76" Src="d" ID=”PPM"/> <Pty R="10001" ID="2"/> <Instrmt Sym="ESU0" ID="90464079" Src="a" CFI="FFICS-" MMY="201009" MatDt="2010-09-17" Exch="XCME" Desc="S&P500 EMINI FUT Sep10"> <AID AltIDSrc="b" AltID="ES"/> </Instrmt> <OrdQty Qty="100"/> </ExecRpt>
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
25
<AllocInstrctn ID="58874451" TransTyp="0" Typ="2" ID2="pc_t63" NoOrdsTyp="0" Side="1" Qty="1" LastMkt="ICEU" TrdDt="2010-03-15" TxnTm="2010-03-23T08:23:00-00:00" MLegRptTyp="1"> <Instrmt Sym="COJ1P" ID=”1234567" Src="a" CFI="OPAFPS" MMY="201012" StrkPx="50" Exch="ICEU" Desc="CRUDE OIL OPT IPE Jan11C 50"> <AID AltIDSrc="b" AltID="BC"/> </Instrmt> <Alloc Acct=“ABCDEF-2E001" ActIDSrc="100" Px="163" Qty="1" IndAllocID=”2374682368687" IndAllocID2=“abc63" AllocPosEfct="O"> <Pty R="1" Src="C" ID="UBS"/> <Pty R="3" Src="a" ID="Clnt Shrtnm"/> <Pty R="16" Src="b" ID=“ABC"/> <Pty R="59" Src="c" ID="Algo"/> </Alloc> </AllocInstrctn>
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
26
– Tooling for parsing more mainstream
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
27
– to have a simple declarative base for our gateway components, encouraging loose coupling. – Uses the language of Enterprise Integration Patterns Book - Gregor Hohpe and Bobby Woolf
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
28
JMS message driven channel adapter transformer service activator router dead letter queue Includes a JAXB message converter JAXB to domain
Conversion failure routing
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
29
– The starting point receiving messages from a queue or topic and putting them on a channel. – Has a message-converter attribute that we use for JAXB unmarshalling
<jms:message-driven-channel-adapter auto-startup="false" container="allocationsTopicMessageListenerContainer“ channel="allocations-gateway.from-allocations-topic" message-converter="jms-converters.fixml-jaxb-message-converter"/>
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
30
– Converts the previously unmarshalled JAXB FIXML object to our true domain object – Conversion code is discretely testable as a standalone component
<si:transformer id="allocInstructionTransformer" ref="allocationInstructionTransformerBean" input-channel="allocations-gateway.from-allocations-topic" method="convertFIXAllocationInstructionToDomain"
<bean id="allocationInstructionTransformerBean“ class="com.ubs.etd.tma.gateway.allocation.AllocationInstructionTransformer" />
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
31
– Payload type routing – Use to redirect conversion failures to a dead letter queue
<si:payload-type-router input-channel="allocations-gateway.toRouter" default-output-channel="allocations-gateway.toPersistor"> <mapping type="com.ubs.etd.utils...DeadMessage“ channel="dealLetterChannel"/> </si:payload-type-router>
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
32
– The end point to connect a Spring-managed bean to an input channel – Used to pass the converted domain object to a persistence service.
<si:service-activator input-channel="allocations-gateway.toPersistor" ref="alloc-gateway.persistor" method="receive"/> <bean id="alloc-gateway.persistor" class="com.ubs.etd...AllocationInstructionPersistor"> <property name="nimbusDao" ref="tma.nimbus-dao"/> </bean>
Section 4
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
34
– Each processing unit should be responsible for doing just one thing
– Helped by the above, but each unit in the system should be easily testable
– It should be obvious when a new requirement for processing along the trade flow comes how to hook it in.
– Keep 2 days of trade data “online” – The maximum time a trade might be relevantly looked up – 300,000 cleared trades + Orders, Executions, Allocations per trading system. Transactions also back from the settlement systems. – Feeding a GUI blotter
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
35
– Data Grid – a distributed cache – Processing Grid – event processing components based on master/worker pattern (aka blackboard architecture) – A bit like the old JavaSpaces. – Gigaspaces
– MapListener / ContinousQueryCache – to get the event – Entry Processors (AbstractProcessor) – to save the result atomically – Less transactional support out of the box – Alternatively could use the Command Pattern
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
36
Inbound gateways Multiple workers supporting parallel processing Outbound gateway Continuous query for object in certain lifecycle state Write back to cache object state change
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
37
Section 5
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
39
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
40
– Protection on an instrument from a credit event (for example bankruptcy)
– Exchange of interest payments, most commonly
floating rate.
"Unless derivatives contracts are collateralized or guaranteed, their ultimate value also depends on the creditworthiness of the counterparties to them. In the meantime, though, before a contract is settled, the counterparties record profits and losses—often huge in amount—in their current earnings statements without so much as a penny changing hands. The range of derivatives contracts is limited only by the imagination of man (or sometimes, so it seems, madmen).“ Warren Buffet 2002
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
41
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
42
<swap> <productId productIdScheme="http://...product_id">USD3L1</productId> <swapStream id="fixedLeg"> <payerPartyReference href="clearing_service"/> <receiverPartyReference href="clearing_firm"/> <receiverAccountReference href="account1"/> <calculationPeriodDates id="fixedCalcPeriodDates"> <effectiveDate> <unadjustedDate>2010-10-20</unadjustedDate> <dateAdjustments> <businessDayConvention>NONE</businessDayConvention> </dateAdjustments> </effectiveDate> <terminationDate> <unadjustedDate>2011-10-20</unadjustedDate> <dateAdjustments> <businessDayConvention>MODFOLLOWING</businessDayConvention> <businessCentersReference href="fixedPrimaryBusinessCenters"/> </dateAdjustments> </terminationDate> … <calculationPeriodFrequency> <periodMultiplier>6</periodMultiplier> <period>M</period> <rollConvention>20</rollConvention> </calculationPeriodFrequency> </calculationPeriodDates>
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
43
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
44
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
45
– Save to the cache then would not need the service activator called persistence service – Or using the Spring Cache Abstraction in 3.1
– Writing a custom DSL combined with Spring Expression Language vs Drools
– Streaming out to an LCDS / Flex
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
46
– understanding the business process was important. Once we got that right a lot could follow.
– Got better cross team buy in, but encountering a different product area presented challenges
– But could do more to standardise – Investing time in the lifecycle model – I don’t think I will ever build a transactional system with a relational database
– Coupling, testability
– The concept was slow to get traction elsewhere in immediate department, but large benefit in terms of delivery speed.
bondia [printed: ____] [saved: March 8, 2011 7:09 PM] P:\QCon 2011\Futures Trade Flow QCon 2011.ppt
47