-
Notifications
You must be signed in to change notification settings - Fork 0
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
research(contracts): reduce accounting overheads #6
Comments
In my view, it should be an accounting module and a single contract, to ensure that new processes / payouts could be added as the Protocol continues to expand its products. Solver bond - Would also see each individual solver bond being in a sub-address. This would first separate risk. It would allow for better reporting / accounting (e.g. what are actual DAO funds and what are "guarantees"). Would allow for transactions between the solver bond address and the settlement contract, making it easier to know what / why that transaction is being paid by the bond. Automatic payout - This would be interesting, but the main painpoint today is "ensuring that the calculations off chain / Dune are what we are transfering to the solvers". Hence, either the calculations are done onchain and then a "payout" function can be called, or don't see how this would improve the process. |
This is what the
Somewhat this is how it would work - there would be a "bonding pool factory", which allows users to create bonding pools - but these pools must be funded with a DAO-specified amount of collateral. Each of these pools then gets an address within the
I think automatic payout is fundamentally wrong. This is very expensive to do (transfer costs) and really does not scale. Instead, off-chain accounting mechanisms are fair so long as they can be verified, so we should provide the queries that are required to execute them, and then verify them. Then from this, the accounting script would generate a merkle root (summary of all the payments to be done), with this merkle root being set in a payment distributor module that is attached to the What's extremely clear is the process of maintaining multiple safes per network, and increasing complexity with fee structures is overly burdensome and error prone, requiring far too much human interaction. It simply just doesn't scale and should be avoided. |
If I understand @harisang correctly, the main burden of the current accounting is the slippage calculation, which is brittle and needs frequent corrections/outlier cleaning. For this I hope v2 will move to per-solver trade handler contracts, so that solvers will be responsible for their internal buffers (further reducing the necessity of a high bond). What remains is the accounting of how much rewards/protocol fees each solver is owed/owes. I agree that this computation should be off-chain (it may change relatively frequently and storing information on every settlement is gas inefficient). We already provide the queries for solvers to verify their rewards, but can probably package this up more nicely as part of general off-chain monitoring software. As to whether accounting should be unified to a single chain, I'm not so sure. Some solvers may only operate on the chain they are solving (e.g. some cheap L2) and might not want to bridge back and forth their rewards from mainnet. Also, given that payouts have to be manually sanity checked individually per chain anyways, sending out 1 tx per chain doesn't seem to me like the main bottleneck (this would also mean accounting issues on one chain hold back payouts across all chains). |
Multichain approach After talking with @mfw78 , I think there is an understanding that mechanism should be on a per chain approach - as we need to be able to calculate performance on a per chain level. Payment / calculation |
Potentially related to cowprotocol/contracts#85 |
Discussed this with @mfw78 1:1 last week, but I think any single accounting contract architecture can be translated to a multi contract architecture which may allow for easier integration into existing infrastructure (read etherscan, cryptio, etc.). I'd at least want us to explore the two isomorphic designs before making a decision on whether a single accounting contract is useful for our purposes. |
Problem
With the advent of fee collection, accounting is increasing in complexity and workload requirements. Accounting requirements are being handled off-chain, in opaque processes and require human intervention / fund transfers on multi-sig wallets, amplifying human labour cost.
Acceptance criteria
Details
Broadly the accounting requirements can be broken down into:
Possible Solutions
MakerDAO-style
vat
central accounting contract, adding accounting domain-specific contracts as authed on thevat
to manage accounting.Maintain current Safes.
Research track
The text was updated successfully, but these errors were encountered: