Basically, trade routes rates are based on the longest single direct route, including trips through wormholes and through other star systems. The game automatically calculates the longest route (without loopholes), then applies, it looks like, .1 credit/s per "planet" the route passes through (so this includes asteroid belts, wormholes and stars, etc, that are not even occupied by a controlled mineral processor, so long as it is not broken up by hostile or non-trade pact agreeing empires).
After this is calculated, every planet with a Trade port will have that figure, even planets that aren't on the path itself (and you can see that path by hovering your mouse cursor over the your Credit amount in the Resource bar (top right of the screen, in case someone didn't realize that)).
So, if you have a long trade route that covers 20 "planets" then your trade value is 2 credits/s. If you have 40 planets total, you have a total trade income of 80 credits/s, which, most likely, will actually exceed your tax income

Gotta love trade in large/huge maps