I think its calculated based on how many defenders you kill, How few stars you take, and what age the attacker is above/below you. The most I have seen is 4 crowns for a defense vs a GP age foe when I was in Medieval.
My average is is 2-3 crowns on same age bases. This usually adds up to about 20 crowns for a night of defending. This lets me build an entire army instantly so I have an edge when I raid.