In this paper, we consider lattice codes for inter-pair interference cancellation in a multi-pair two-way relay network (TWRN) with amplify-and-compute relaying. We investigate a new method to separate the desired message from the interference signal by computing only two equations at the users. First, we formulate the sum rate for this lattice code based approach and find that it has better sum rate than the existing beamforming based approaches. Next, we analytically obtain the optimum power allocation coefficient for the users' and the relay's power to maximize the sum rate. We show that for larger number of user pairs, optimum power allocation allows more improvement compared to that for smaller number of user pairs.