I believe the buy and sell prices for hats, robes, and boots are bugged.
When buying or selling an item at the bazaar, the price given depends on the amount of stock. From what I've observed, equipment items, housing, treasure cards, and snacks all use the same "price multipliers" to determine their final buy or sell price. If you consider the buy price of an item when there are 25 copies of it in the bazaar the "base price," then you get the following price multipliers:
This may seem like a small thing, but for items that cost thousands of gold, this issue becomes much more apparent. And given how big the discrepancy is, I can't chalk it up to a rounding error. I do not have enough gold to test that myself, however.
If this is somehow not a bug, then what is the correct formula? No matter which multipliers I choose, the buy and sell prices do not make sense across multiple items, which means there is either some bug messing the prices up or it is more complex than I'm assuming. Please, any help is appreciated.