Skip to main content

Instruments: stored vs ad-hoc

emrgex distinguishes stored instruments from ad-hoc ones by one thing: whether the bond is already in the catalog.

Where it's definedCashflow scheduleValuation
Storedin the catalog (reference by id)persisted (the issuer's schedule)recomputed every call
Ad-hocinline in your requestgenerated from the characteristicsrecomputed every call

Either way, prices, yields, durations, convexity and accrued are never stored — they are recomputed from the schedule on every request, against the instrument's convention.

Instrument fields

When you define an ad-hoc instrument (or inspect a stored one), these are the fields:

FieldRequiredNotes
idyes (ad-hoc)your reference for the instrument in the request
rate_typeyesNOMINAL / EFFECTIVE / AT_MATURITY / PRICE_QUANTITY
day_countyes¹FpML/ISDA name; not used for PRICE_QUANTITY
coupon_typenoFIXED (default) or ACCRUAL
frequencyyes²coupons per year
startyesissue / first-accrual date
maturityyes
coupon_ratenoannual coupon as a decimal (0.06 = 6%)
face_valueyesusually 100
unit_nominalnominimum tradeable denomination; rounds a derived nominal
eomnoend-of-month roll
ex_div_daysnoex-dividend days
amortizationsnoarray of { date, amount } — see below
callsnoarray of { date, price } — makes the bond callable

¹ Required except for PRICE_QUANTITY. ² AT_MATURITY / PRICE_QUANTITY force frequency to 1.

Amortizing bonds

Add an amortizations array of { date, amount } (principal repaid per date). Amortizing bonds are quoted on current outstanding face (the market standard): prices and DV01 scale to the outstanding fraction, while durations, convexity and yields are scale-invariant. A supplied amount_value is interpreted as the current outstanding nominal.

Callable bonds

Add a calls array of { date, price } (redemption price per 100 face). When you quote a callable bond by price, set options.yield_worst: true to also receive the yield-to-worst (min of yield-to-maturity and each yield-to-call). See Metrics.

Browsing the stored catalog

# list instruments (filterable, paginated)
curl "https://calc.dev.emrgex.com/v1/admin/instruments?issuer=Hacienda&limit=20"

Useful filters (all optional, AND-combined): rate_type, day_count, calculation_code, currency, issuer (substring), name (substring), q (searches id/nemo/isin/issuer/name), amortizing, callable, maturity_from / maturity_to, coupon_min / coupon_max, plus sort, order, limit, offset. limit=0 returns just the total count. See the API reference.