I heard there is a possibility to model a loan contract including a prepayment option with the help of a swap including a swaption? I know that it is possbile to construct a prepayment loan as a callable bond in a binomial tree, but I'm not sure if this relation is somehow related to a swap.
Honestly I did not get the intuition how loans can be modelled as swaps.
Thanks for your help,
K.S.