working metadex matching algo (not balances are yet changed)