Position size relationship to trade sizes?

It appears that the position size is not directly related to the size of the associated trades. When I update the set of trades associated with a position, I must manually update the new position size. Also, from the web UI I can update the size of the position to a value that’s clearly not consistent with the associated trade data. Is that intentional?

Yes, the design allows trades to have no correspondance to positions. This permits some possible scenarios:

  1. the trade data is unknown (we only know positions)
  2. the trade data is incomplete
  3. the aggregation of trades into positions is not simple (ie. we also allow the security to be different on each trade)

More generally, a decision was taken that it is not the responsibility of OpenGamma to force any kind of aggregation between trades and positions (other systems have lots of logic to manage that).

Now, i do think that there is potentially a role for “master helper” classes, that help with common use cases, like simple trade aggregation.

Just to expand on Stephen’s answer a bit: we are not enforcing any particular aggregation of trades into positions at the moment because it’ll often vary from organisational to organisation. For example, some people will want e.g. FX Option trades to be aggregated even if they weren’t executed at exactly the same underlying rates, but there will often be a point where they won’t want the options to drift too far from each other. In the future we’ll include some functionality to manage the basic trade workflow more automatically, in line with the ‘master helper’ classes that Stephen mentioned.