Wireless sensor network is dynamic and follows multi-hop based communication, it is essential to provide an IDS software to avoid malicious behavior and data loss. The existing software like packet sniffer can sniff all or just parts of the traffic from a single node in the network. A few methods were proposed to avoid traffic narrowing using switches to gain access to traffic from other systems on the network but it is taking more time and cost. This paper discussed an Optimized Trust Based Traffic Analyzer (OOTBTA) for wireless sensor networks in order to provide an efficient intrusion detection system where the optimum trusted traffic is obtained by Genetic Algorithm. OOTBTA used as optimal intrusion detection system where it focuses on the packet sniffing and its working only for best trusted nodes in the network. OOTBTA observe the working behavior, packet format, timing and mainly optimally whether the nodes are trusted nodes or not. The simulation of OOTBTA is carried out in Network Simulation software and the results are compared with the existing IDS such as LBIDS and DAD results to evaluate the performance.