this whole function should be moved to HQ since casexml no longer is supposed to know anything about `StockState`s