It appears that some powerful and influential people were aware of the currency ban coming
See following report, of BJP having deposited large amount of money ahead of the ublic announcement of the currency being demonetized
You can also see the reports appearing in certain section of media, see the newspaper clipping below and check the date of newspaper
Though overall the news of demonetization coming was kept as a guarded secret, it does not appear that it was not known to anyone. It appears that certain section of people might have made use of this information
Why not? After all every party has to survive and fight elections !