Cost of Good Sold calculated with Valuation Rate or Selling Rate

Dear ERP Experts
Cost of Good Sold calculated with Valuation Rate or Selling Rate???
Please help me I am new user in ERP Next