Green’s Dictionary of Slang

fun n.2

[late 17C–19C] a cheat, a trick.