Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

lending: Support borrow / lending between two non-quote reserves #989

Closed
jstarry opened this issue Dec 31, 2020 · 0 comments · Fixed by #1441
Closed

lending: Support borrow / lending between two non-quote reserves #989

jstarry opened this issue Dec 31, 2020 · 0 comments · Fixed by #1441
Milestone

Comments

@jstarry
Copy link
Contributor

jstarry commented Dec 31, 2020

Problem

When borrowing funds, one of the deposit / borrow reserves must be the quote currency reserve. This limits lending to pairs which always include the quote currency. For example, if the quote currency is USDC, then providing SRM collateral to borrow SOL is not supported.

Each non-quote reserve specifies a single dex market between its currency and the lending market quote currency. In order to discover the price between two non-quote currencies, token values must be converted to the common quote currency which requires traversing the order book from the dex markets specified by the two reserve.

Proposed Changes

Extend borrow / liquidate instructions to allow passing an additional pair of dex market / order book account. Then, discover exchange price by first determining the value of tokens in the quote currency.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant