The Federation clearly had an economy of sorts. Joseph Sisko had a restaurant in high demand, the Picard family had a traditional vineyard, so luxury goods and services still attracted a premium, but I don't think they traded with money. Voyager was probably the best illustration of the economy of the Federation - replicator use was rationed because energy became a scarce resource due to the need to run the engines at full tilt without stopping to refuel with antimatter.
The economy would be based on energy, given that starship travel makes obtaining most previously rare materials a question of spending energy. Given the ubiquitous manufacturing capability combined with fusion generators as small as a trash can, it would be impossible to restrict the means of production to a ruling class of capitalists, so status becomes the main indicator of success. This is emphasised heavily within Star Trek plots - high status scientists, sportsmen, and of course, starship officers are plentiful. But none of them are notable for merely owning things - all of them are accomplished in some way.
In a starship economy, money as a means of exchange would be ridiculous - although the sequence of barter trades you mention from DS9 also seems ridiculous to me, because so many of the goods concerned just seem like something you'd just squeeze out of a replicator.
Energy would be cheap, because if you needed more of it, you'd just construct more generators / harvesters.
Your supply of material goods would only be limited by the supply of energy and mass. If you need uncommon or non-replicable elements (let's presume that using the replicator for transmutation is prohibitively expensive), you dispatch a starship to find some. This costs energy. See point 1.
It makes no sense to move any matter cargo that isn't a rare element via a starship, because common elements are everywhere, even if transmutation is expensive.
So money would be a bit pointless
* Because the price for anything common is "really cheap".
* You can't pay for rare things with common things, because everyone has the common things already.
* A common exchange rate is going to be impossible to keep stable because the only things worth trading are rare
I think the Ferengi economy is actually the curiosity in this setting ; it seems to depend on artificial scarcity (and repression of entire social groups, from the way they treat their women).