I know the standard xy = k model as popularized by Uniswap but I'm trying to implement a xyz = k pool with three tokens where the weight ratios are say 20/20/40.

Just wondering if anyone has a smart contract that could show me the implementation logic for such a tripool.

If it helps, then you can find the logic for a pool with only two tokens, but where the weights can be chosen freely (i.e., not restricted to equal weights) - here.