Automated Liquidity Provision
We intended for the entire loan amount to be divided and allocated to the user's preferred liquidity pool. Ideally, there should be virtually nothing left because it complicates the way we record everything. So, if someone takes out a $1000 loan and subsequently selects the USDT: ETH pool, the entire $1,000 must be added as liquidity to this USDT: ETH pool.
Based on the problem statement above, we concluded that the following should provide us with what we seek.
get_amount_out(x) = quote(1000 - x) [JediSwap functions]
Opening this up results in a quadratic equation for x which then needs to be solved.