update exchange logic