You can use this tool to calculate wether the attacking troops can carry enough silver to capture your castle.
If they dont then you can safely remove your troops let them take your resources and leave.
If the troops cant hold enough silver to capture your castle then you can move your troops out and let the
attacker steal some of your resources. Warning! If reinforcments arrive then you must do this again