OriginProtocol / OriginProtocol/origin-dollar
OIP-3 Coin Ratios on Withdraw Should Exclude Curve
Nobody has claimed this yet.
- Dominant language
- Solidity
- Stars
- 152
- Forks
- 115
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 17
Description
When OUSD asked a curve based strategy for it's balance of a particular coin, the strategy responses with virtual price total number of stables / 3. This is because the actual ratios on curve could under control of an attacker, and the and that the ratios change over time. The curve strategies don't really hold exact specific stablecoins.
Our current system results in emptying out whatever coin we have the least of on withdraws, when we have a funds in curve. This is exactly what we don't want to be doing.
For example, let's say we have 100 million in 3pool, 10 million USDC, and 2 million DAI, and 1 million USDT. Roughly speaking a withdraw request for only 3 million coins is going to empty all the free USDT out.
Off the top of my head, we could either only use the ratios in the default strategies to withdraw from (allowing us to choose to some extent which coins are withdraw, and maximizing the OUSD able to be withdrawn for a given default allocation.)
Or we could just exclude curve based strategies from these calculations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by tracing how Curve strategy balances feed the withdrawal coin-ratio calculation, then compare the two alternatives described: using default-strategy ratios or excluding Curve strategies. Done means the chosen behavior no longer preferentially empties the least-held coin during withdrawals.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity
- Domain
- blockchain, fintech-quant
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100