domestic markets end in gains