merged markets.js into sync.js