According to page C of this NIST document  httptsnistgovWeightsAndMeasuresPublicationsuploadhappencpdf  by custom  gallons comprise a barrel of crude oil or petroleum products for statistical purposes and this equivalent is recognized for liquids by four States  Based on the above it should be noted that a the definition of  gallons is by custom  not by law and b the definition of  gallons is for statistical purposes and does not mention for use in trade or commerce  This NIST document page  also states that a barrel of oil is  gallons approx  liters  httptsnistgovWeightsAndMeasuresMetricuploadfsbpdf   NYMEX does define the capacity of a barrel in terms of gallons according to this  httpwwwnymexcomCLspecaspx  Here we see that the trading unit for Light Sweet Crude Oil is specified as  barrels  gallons