-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conceptualise support of several callees per collateral #374
Comments
The only problem I have with this minimal proposal is that it doesn't reflect that different exchange paths/callees will have different transaction fees. And the algorithm to suggest the best callee would rather need to compare total prices minus transaction fee, not unit prices or profit numbers directly. But it's also a question how well we can estimate transaction fees for arbitrary paths/callees – I think some places (eg automatic router, 1inch callee, even provide this info, but some doesn't) |
Feedback on the mock itself:
I agree that the algorithm to determine best callee should rely on total prices minus tx fees. (Btw: Doesn't total prices minus transaction fees yield net profit?) V1:
V2:
|
Good point, let's name it to simply
No, as we learned the formula to compute actual profit is more complicated than that.
The problem is that automatic router already takes [exchange] fees into account (otherwise it will provide unrealistic routes with 10+ swaps). If we wouldn't account for the fees in all other callees we would also compare some callees with and some callees without fees. I think the solution is to separate current fee into two parts:
For the old callees hardcode the exchange fee if we can't get it generically. Next step is to outline the technical solution including this fee separation. |
Good one
True...
I like the idea of separating the fees. Thought about the same already.
Just to be clear. This type of fees we wouldn't explicitly show in the UI but include in the figure for market unit prices of the different callees? |
Yes, eg |
But wouldn't that lead to the situation of us neglecting the exchange fees in the comparison? In other words: A callee with very high fees could yield a lower (hence apparently more lucrative) net exchange price. However for the user a callee with higher net exchange price but lower fees would be more favourable... |
Sorry, I meant adding fees to the total quote. This will result in higher prices for callees that consume more gas. The only problem is to somehow fine-tune those hardcoded gas prices for the old callees. |
Technical proposalRefactor core
Modify UI elements
Final thoughtsWe might want to a little think a little bit ahead and consider partial swapping, in order to not completely redo this logic (although it will significantly affect the flow anyway). I think since we split markets on different objects it already prepares the ground on estimating the best size of the part to be taken (based on the available liquidity or multiple "probes") |
Thanks for the detailed proposal, really like it!
Can you elaborate on that point in the light of future partial liquidation? Is it that we are covering ground to decide in the future what's the best amount to swap on a certain market (aka via a certain callee)? Moving forward do you have a proposal on how to break the proposal down into issues. I expect that not each of the high level steps needs to be an issue on its own.
On the UI side I would bundle the following points into one issue:
|
what exactly stands behind the word "liquidation" here? The process of converting the underwater vault into the auction or purchasing just a part of the available collateral from the auction? |
Sorry confuse two terms, I meant partial swapping. Clipper contract allow users to bid on the collateral auctions "partially" based on the user desire (and some contract-based limitations). Currently we only allow this in
I don't want to plan both features at the same time, keeping the scope limited, but as they kind of interconnected, we have to account for the future. From my understanding, proposed changes doesn't contradict future partial swapping logic. I'm just raising it here, so you can think about potential edge cases as well. The main complexity of the partial swapping is that market price might be significantly different depending on the amount we're trying to swap, different for each callee. Eg if you try to swap 2000 ETH your unit price is X DAI, if you try to swap 10 ETH with the same callee, your unit price is X/2 DAI. I imagine we will end up with something like
Since it's described as a refactoring, I think it makes sense to do all core changes at once, then merge. For the same reason, ideally, the UI would need core functionality already in place to be merged (but can be started beforehand and also completed in one PR). Splitting it would create more additional work (eg creating temporary copies of types and fake functions instead of modifying existing ones, then cleaning it up). So my suggestion is to create two issues 🙂 |
ok, proposal seems good |
Makes sense. And agree that it's valuable to have these considerations as back thoughts already.
Fine for me. Will proceed and create these based on your detailed outline. |
Goal
Create a concept on how we will be able to support several callees per collateral (in the UI but also with the bot)
Context
Right now we support one callee per collateral type. However we envision a future state where there are several callees that can be used to execute a swap transaction for an active auction. Multi callee support is useful beacause a) it might allow to provide better market prices b) it adds redundancy (e.g. problem if there is only one callee based on 1inch and then 1inch is down)
Tasks
Assets
The text was updated successfully, but these errors were encountered: