The "market value" is the base price - spell level x caster level x 50 gp.
Thus, for a potion of invisibility, the base price is 2 x 3 x 50, or 300gp.
The cost of materials to create the potion is half the base price, or 150gp in this example.
The creator also expends 1/25 of the base price in XP - in this example, 12XP.
If he goes on to sell the potion for the base price, essentially he makes a profit of 150gp, in exchange for his time, effort, and 12XP.
-Hyp.