Automate pricing based on product availability source

Hello, here’s my scenario:

The same product is available from 2 different vendors. One vendor charges more, but has the product in stock more often.

Of course it’s not one product - it’s hundreds, and the availability changes daily. They provide inventory feeds and I have an app that syncs the inventory. But the price on the site stays the same.

How do I automate my pricing so that when it’s available from the cheaper vendor - the price is X, and when it’s only available from the more expensive vendor - the price on the site would be Y?

Thank you