A declaration of trust can be flexible and give effect to many different arrangements.  At its most simple, a declaration can simply provide for fixed percentage shares (for example 60%/ 40%) that will stay the same throughout ownership.
Alternatively, it can ‘ring fence’ an initial investment (the deposit) for the co-owner who paid it and thereafter split any remaining sale proceeds in fixed percentage shares. Under such an arrangement provision is made for prioritising payments upon sale.
At the more complicated end, a declaration can provide for shares to change over time to exactly reflect the money that each co-owner invests both at the outset and during the period of ownership.   This will allow an owner who puts less or no deposit payment down, to accrue an increasing interest over time by paying off the mortgage.