I worked in a bank for a few years - doing credit risk in both consumer (cards, personal loans, etc) and investment banking (bonds). When it comes to consumer loans, like cards, mortgages, personal, etc, the basic formula is the cost of funds plus a margin that reflects the risk (i.e. card loans more risky than mortgages).
Cost of funds relates to how much it costs for the bank to obtain those funds - its an aggregate of various wholesale market rates, the composition of its deposit base, and a bunch of other things.
Inflation risk is something I never had to factor - but it could have just been because I wasn't working in a time with a major inflationary shock