How do I calculate transaction fee for call to createpsbt()?
If you want to implement your coin selection, the only alternative to calculating the fee manually I can think of is the following:


You select which inputs you want to be used in your transaction based on your coin selection algorithm.
You then proceed to lock every input that is not the one you selected. You can get the list of all inputs through listunspent and you can lock an input with lockunspent false [{"txid":"hex", "vout":n}, ...].
Now you can use your walletcreatefundedpsbt without being afraid it will select any input that you don't want and you can pass the option {"feerate":your_feerate}.
After getting your raw transaction, you can unlock all previously locked inputs with lockunspent true