##what asset classes are important to PB business

Prime brokers provide a wide range of services to hedge funds. What asset classes are important in the PB market? (Note this is subtly different from the question “what asset classes are important to hedge funds”)

#1 Equities
#2 FI

(In Eq and FI, clients get financing.)

#3 futures – no financing
FX is slightly less important

Financing is the most needed “service” and includes
* stock lending
* margin lending
* repo and reverse repo

The 2nd most valuable “service” might be technology
* low-latency direct-market-access (including FX)
* collocation in exchange data center

multicast – video streaming^live price feed

These are the 2 main usages of IP multicast. In both, Lost packets are considered lost forever. Resend would be “too late”.

I think some of the world’s most cutting-edge network services — live price feed, live event broadcast, VOD — rely on IP multicast.

Multicast is more intelligent data dissemination than broadcast, and faster than unicast. Intelligence is built into routers.

I believe JMS publish is unicast based, not broadcast based. The receivers don’t comprise an IP broadcast group. Therefore JMS broker must deliver to one receiver at a time.

wpf data template, basics

DT is mostly used with collections, though it can be used for standalone objects. Let’s suppose we have a list  box of  Persons.

DT is a chunk of xaml code. (Can it be done in c# code? I have not seen any.). The list box is another chunk of xaml. You could embed the DT chunk in the listbox chunk, but it’s more common to define a “reusable” DT inside a resource dictionary (another chunk of xaml) and give it a name like MyDT. To use this DT, we assign MyDT as the RHS to ItemTemplate property (LHS) of our list box.

In Smarty, a newsletter template would need $yourName, $yourAddress and other dummies. Similarly, our DT chunk includes things like “{Binding path=Address}”. This is a data field, presented within a bunch of container visual controls. Therefore, a DataTemplate precisely describes a (hierarchy of) container holding one (or more) data item.

The same template is repeatedly applied to the Address field (+ other fields) of each list item, to “present” each item on screen.

CommandBinding – is associated with command target

From http://msdn.microsoft.com/en-us/library/system.windows.input.commandbinding.aspx, I get the feeling that a command binding (CB) instance is associated with a command target. I’d say the CB instance is injected into the command target object, which is usually a visual control.

(This seems to echo the very common and essential data binding in xaml, where the binding object is injected into the target, not the source.)

I also get the feeling that CB is used only for routed command. If that’s the case, I feel this is a slightly advanced feature. For an initial grip on the commanding paradigm, some students should probably skip this CB topic. [[wpf succinctly]] doesn’t mention command binding or command target. My delegate command implementations don’t use CB either.

I understand command binding is crucial in routed commands, since the bubble or tunnel will scan the containment hierarchy stopping at a command binding. The builtin WPF commands are all RoutedCommands.

message fragmentation in Internet Protocol

IP layer handles fragmentation/defrag. UDP and TCP are one layer above IP and relies on this “service” of the IP layer.

UDP may (TCP is different) occasionally lose some “logical” packets, but never part of a logical packet.

When a logical packet is broken up at IP layer into physical packets, the constituent physical packets will either be delivered altogether or lost altogether. The frag/defrag IP service is transparent to upper layers so UDP/TCP don’t need to worry about basic data integrity.

Chicago/Sing HFT IV Aug 2012 (master copy in pearl)

Q1: pros and cons of vector vs linked list?

Q1b: Given a 100-element collection, compare performance of … (iteration? Lookup?)

Q: UDP vs TCP diff?
%%A: multicast needs UDP.

Q: How would you add reliability to multicast?

Q: How would you use tibco for trade messages vs pricing messages?

Q5: In your systems, how serious was data loss in non-CM multicast?
%%A: Usually not a big problem. During peak volatile periods, messaging rates could surge 500%. Data loss would deteriorate.

Q5b: how would you address the high data loss?
%%A: test with a target message rate. Beyond the target rate, we don’t feel confident.

Q7: how is order state managed in your OMS engine?
%%A: if an order is half-processed and pending the 3nd reply from ECN, the single thread would block.

Q7b: even if multiple orders (for the same security) are waiting in the queue?
%%A: yes. To allow multiple orders to enter the “stream” would be dangerous.

Now I think the single thread should pick up and process all new orders and keep all pending orders in cache. Any incoming exchange messages would join the same task queue (or a separate task queue) – the same single thread.

3 main infrastructure teams
* exchange connectivity – order submission
* exchange connectivity – pricing feed. I think this is incoming-only, probably higher volume. Probably similar to Zhen Hai’s role.
* risk infrastructure – no VaR mathematics.

dependency-property internals – educated guesses

The POCO property is implemented by a backing field. Now (Reason to become obvious) let’s suppose the backing field is in a base class B. Both subclasses C1 and C2 expose some property on that backing field. If there’re 33 C1 instances and 44 C2 instances, then we have 77 of this backing field in memory.

For a DProp “IsDefault” in a Button class, the backing store (there must be one) is in some base class, but there’s no field named anything like “_IsDefaultField”. Rather, I guess all DProp data for the Button class is consistently, generically stored (similar to javascript or perl objects) in some hash table, where

* value — probably nothing fancy — a bool if the DProp should be bool
* key — a combination of the actual class (Button in this case) + the value’s type + the DProp name + …

For a Button instance in memory, if there are 80 DProps, then the hash table in the base class has, logically, 80 key/value pairs.

For a Label instance in memory, if there are 70 DProps, then the hash table in the base class has, logically, 70 key/value pairs.

Given 22 Buttons and 33 Labels on a screen, we have 55 hash tables. Logically, we can safely assume one hashtable per DependencyObject.

Without going any further, let’s step back and ask “Is this design enough to implement basic POCO property?” Basically setter/getters. I would say yes.

In reality we achieve memory efficiency because the hash tables are sparse. Out of the 80 DProps in the 22 Buttons, most of the 1760 values are defaults. All the default values are “removed” from the hash tables. http://stackoverflow.com/questions/7137291/how-does-the-wpf-dependency-property-design-save-memory-consumption and
http://stackoverflow.com/questions/9463216/how-dependency-property-holds-value have concise explanations.

Now, in this design the getter/setter have power features when used in conjunction with the “Hollywood registry” — Each of the 80 DProps in a Button is registered with the “Hollywood”. Therefore when the getter/setter runs, the Hollywood intervenes. Most important power feature is change notification. Overall, this Hollywood is still a mystery to me.

VAR vs DYNAMIC in c# — first look

If you declare AND initialize a variableA of “var” type, compiler figures out the exact type of this variableA. Say it’s Account. This variableA will be this type forever. In fact, compiler must get enough info to infer the exact type of variableA. Otherwise compile time error.

If variableB is declared “dynamic” type, then you can declare it without initializing. Then at run time you can assign an Account object to it, subsequently assign an integer to it. The actual type of variableB is mutable at run time. This is a bold departure from c++/java, where every variable’s type is always immutable.

You can get run time error (not compile time) with variableB, if you reference a member of variableB and the member doesn’t exist at time of evaluation, which is run time. Put another way, Evaluation is NOT at compile time. See simple example at http://msdn.microsoft.com/en-us/library/dd264741.aspx. In this sense, dynamic type is more lenient than Object type as “evaluation” is postponed to the very last moment at run time.

Dynamic type was designed for COM objects.

Only local variables can be “var”, but dynamic can be fields, method params etc.

##most important EM asset classes

According to my own informal survey, “Emerging Market” desk covers

#1 FX
NDF – I think many EM currencies are NDF.

#2 IR and bonds of EM countries – mostly sovereign, also corp

#3a EM IRS — is the largest sub-sector within EM FixedIncomeDerivatives
#3b EM credit derivative — is mostly on sovereign bonds

In EM derivative space, equity derivative is less significant than FX and FI derivatives.

Equities, commodities, … are less significant to EM. I guess there’s no separate EM desk for eq/comm as there are specialized EM FX/FI desks.