2018 IPC states: (assuming you are under IPC code?)
SECTION 704 DRAINAGE PIPING INSTALLATION
704.1 Slope of horizontal drainage piping. Horizontal drainage piping shall be installed in uniform alignment at uniform slopes. The slope of a horizontal drainage pipe shall be not less than that indicated in Table 704.1 except that where the drainage piping is upstream of a grease interceptor, the slope of the piping shall be not less than 1/4 inch per foot (2-percent slope).
TABLE 704.1 SLOPE OF HORIZONTAL DRAINAGE PIPE
(<2.5": 1/4" per foot)
(3-6" pipe: 1/8" per foot)
(>=8": 1/16" per foot)
a. Slopes for piping draining to a grease interceptor shall comply with Section 704.1.
704.3 Connections to offsets and bases of stacks. Horizontal branches shall connect to the bases of stacks at a point located not less than 10 times the diameter of the drainage stack downstream from the stack. Horizontal branches shall connect to horizontal stack offsets at a point located not less than 10 times the diameter of the drainage stack downstream from the upper stack."
You can search the IPC for other details here: