Automatically Update New Opportunity Owner to Match Account Owner

Automatically Update New Opportunity Owner to Match Account Owner

I am in need of a custom function to accomplish the following scenario:

Our software runs on an annual subscription model. When customers are approaching 30 days of their subscription renewal, an opportunity is automatically created for the renewal. This is done through an integration with our software portal. Currently, it is set up such that the Opportunity Owner equals the developer who created the integration with our portal.

I would like to create a custom function so that, when these opportunities are automatically created, the owner is automatically assigned as the ACCOUNT Owner for the account associated with the opportunity.

Any help would be appreciated.