Tracing the gravitational potential using cosmic voids