Deductions & credits

"Cost averaging" is an accounting concept and is not used for income taxes or wash sales. Your broker should be keeping track of the basis for you.