This challenge combines the most important ideas in the track.
Implement secure_swap_output.
If the pool is paused, return:
Err("pool paused")Use:
effective_input = x_in * 9_970 / 10_000Use:
k = x_reserve * y_reserve
new_x = x_reserve + effective_input
new_y = k / new_x
output = y_reserve - new_yIf output < min_out, return:
Err("slippage exceeded")Return:
Ok(output)For (Active, 1000, 2000, 100, 180), the correct result is:
181