In this paper, we consider a perturbed compound Poisson risk model with two-sided jumps. The downward jumps represent the claims following an arbitrary distribution, while the upward jumps are also allowed to represent the random gains. Assuming that the density function of the upward jumps has a rational Laplace transform, the Laplace transforms and defective renewal equations for the discounted penalty functions are derived, and the asymptotic estimate for the probability of ruin is also studied for heavy-tailed downward jumps. Finally, some explicit expressions for the discounted penalty functions, as well as numerical examples, are given.