P
(PeteCresswell)
Bond trading system.
Every bond has a "Coupon", which is the percent of held value
that gets paid out to the owner.
The "Coupon" can change over time. For some bonds it changes
daily; others change monthly; still others change quarterly,
annually, or semi-annually.
The coupon changes are per some external reference rate.
The federal funds opening rate on the day in question, for
instance. That if a security's reference rate is fed funds open,
that index's rate on a particular day is added to something in
the security called a "Spread". If the fed funds opening rate
on 11/3 is 5 and Security.Spread is 2, the Security.Coupon for
that day is 7.
That bond also has a frequency of payment. Some pay daily,
others pay monthly, still others pay quarterly...and so-forth.
Now, here's the fun part:
The users want to know the daily accrued payments for all bonds.
If something only pays monthly - say on the first of the month,
they still want to know what fraction of that payment was accrued
for, say 9/5.
A bond's actual payment amount (the one that happens once a month
or whatever) is the sum of all the daily accruals since the last
payment amount.
One of the jokers in the deck is that those reference rates might
change retroactively. Maybe somebody will mis-type a Libor
3-month rate on 9/3 and discover it on 9/18. That would change
the daily accruals of all bonds whose coupons are tied to the
Libor 3-month index. Ditto any change to the security's
properties like reset frequency, payment frequency, spread, or
which index is tb used for the reference rate.
So far, this sounds like an argument for a 100% normalized
architecture.
I probably should try it first, but my instinct is that
representing those payment amounts on-the-fly in a timely manner
as a security is loaded onto a screen (there could be hundreds or
thousands of them) is going to be beyond the capabilities of the
user's PC. And they *do* want to see that payment stream.
With that in mind, the only alternative I can come up with is a
denormalized architecture in which we have a "tblAccrualDaily"
which has one record for each security/day.
The columns would be SecurityID, Date, EffectiveCoupon,
CurrentHoldings, and PaymentAccrual
We'd generate all a security's records at one time when the
security was created - populating only SecurityID and Date,
leaving the Coupon, Holdings, and Accrual tb filled in each time
the calendar rolls over and/or one of the properties that affects
it changes. e.g. Somebody changes or adds a reference rate, we
seek out all the affected records and update them. Somebody
sells some of a security, same thing.
Bottom Line: I'd beg somebody with experience to comment on this
strategy. I'm relatively weak on SQL and suspect that there
might be an SQL-based solution that could get around the
denormalization.
Every bond has a "Coupon", which is the percent of held value
that gets paid out to the owner.
The "Coupon" can change over time. For some bonds it changes
daily; others change monthly; still others change quarterly,
annually, or semi-annually.
The coupon changes are per some external reference rate.
The federal funds opening rate on the day in question, for
instance. That if a security's reference rate is fed funds open,
that index's rate on a particular day is added to something in
the security called a "Spread". If the fed funds opening rate
on 11/3 is 5 and Security.Spread is 2, the Security.Coupon for
that day is 7.
That bond also has a frequency of payment. Some pay daily,
others pay monthly, still others pay quarterly...and so-forth.
Now, here's the fun part:
The users want to know the daily accrued payments for all bonds.
If something only pays monthly - say on the first of the month,
they still want to know what fraction of that payment was accrued
for, say 9/5.
A bond's actual payment amount (the one that happens once a month
or whatever) is the sum of all the daily accruals since the last
payment amount.
One of the jokers in the deck is that those reference rates might
change retroactively. Maybe somebody will mis-type a Libor
3-month rate on 9/3 and discover it on 9/18. That would change
the daily accruals of all bonds whose coupons are tied to the
Libor 3-month index. Ditto any change to the security's
properties like reset frequency, payment frequency, spread, or
which index is tb used for the reference rate.
So far, this sounds like an argument for a 100% normalized
architecture.
I probably should try it first, but my instinct is that
representing those payment amounts on-the-fly in a timely manner
as a security is loaded onto a screen (there could be hundreds or
thousands of them) is going to be beyond the capabilities of the
user's PC. And they *do* want to see that payment stream.
With that in mind, the only alternative I can come up with is a
denormalized architecture in which we have a "tblAccrualDaily"
which has one record for each security/day.
The columns would be SecurityID, Date, EffectiveCoupon,
CurrentHoldings, and PaymentAccrual
We'd generate all a security's records at one time when the
security was created - populating only SecurityID and Date,
leaving the Coupon, Holdings, and Accrual tb filled in each time
the calendar rolls over and/or one of the properties that affects
it changes. e.g. Somebody changes or adds a reference rate, we
seek out all the affected records and update them. Somebody
sells some of a security, same thing.
Bottom Line: I'd beg somebody with experience to comment on this
strategy. I'm relatively weak on SQL and suspect that there
might be an SQL-based solution that could get around the
denormalization.