I find it to be a pretty simple formula at its base

You have the cost of materials + your value of time to determine the price of something. That is it at its base. But then things get complicated if you want them too. Rate of sales is a big one. If I can under cut you by 25% and sell 5 full stacks within an hour, while gathering another 5 full stacks to replace what was just sold I would gladly do that then increase my profit margin but lower my revenue due to slower sales.

Nothing is as simple as placing the opportunity cost onto it or valuing your time (which everyone will do differently). Now selling at a loss is people either not paying attention, just paying for their xp thus they relist lowest to make some of it back. If you not looking to pay for xp and you are crafting for profits it is materials+time. Time is not a constant so everyone's value is different but since we can see everyone's we know the average value of time.

I tend to sell a lot of base materials way lower than everyone else because I can sell them at a much faster rate and while I may make 5k less per stack then them, I sell 10 more stacks per day. I have sold 10 stacks of ore for 50% of what the market average was and came back the next day to see a lot of the same stacks up. (Now they could be different stacks but factors made me think they were the same). I will continue to do this and make more money for my time because my stacks don't sit there. I have no issues making a smaller margin but bigger revenue.