Match money to a date

A refundable housing deposit may be needed in six weeks. A market investment could rise or fall before then.

What matters most for this sum?