Hi, I was curious if this feature would be possible for idle. Essentially say I want to borrow some amount of eth per 1k worth of USDC and have idle automatically move my lends and borrows between markets for the best rate.
Say ETH trades at 2k and USDC stays at 1 dollar.
So say I borrow 0.25 ETH per 1k USDC (so borrow fraction of 1/2).
Say currently the rates across the pools are
Pool A: 20% USD and 2% ETH.
Pool B: 22% USD and 4% ETH.
At the current rate, both pools are fine (weβre ignoring that pool b accrues more debt in ETH) as 20% - (1/2) * 2% = 22% - (1/2) * 4%.
Say we pick pool a.
Say later it becomes better to lend/borrow on pool B. (the rates for usd on pool B go to 25%, or eth goes down in price, or rates on USD go down on A, etc)
Then I would want idle to calculate that the current rate is better and in 1 transaction to just move my usd collateral to pool B and then borrow eth from pool B to pay back my loan from pool A .
Is this possible or too hard to implement?