---
# System prepended metadata

title: Moloch DAO Bookkeeping
tags: [Product]

---

---
tags: Product
---

# Moloch DAO Bookkeeping

Create a solution for moloch daos on [daohaus.club](https://daohaus.club/) to have a double entry style bookeeping solution.
- Track funds coming on and out of the dao
- Encompass main dao treasury and minion vaults
- Automatic importing of all transactions
- Enable categorization of expenses and income
- Enable ability to add a description to a line item
- Simple summary/reporting/filter feature for mvp to allow exporting filtered views
    - only expenses/income
    - only certain categories
    - timeframe searches/filters
    - vault filters (treasury vs. minion)
- Will need to work on all daohaus supported chains and future chain proof
- Probably need to display amounts in usd
    - coingecko api?
    - do we really need usd at time of transaction? ask an accountant.
- maybe include the transaction hash in all entries

## Technical areas to explore

Can we just integrate better with Llama?
https://llama.community/#/
- see some v1 moloch daos, would need to support v2/v2.1 and minion vaults in a single view

How will we store offchain data?
- categories and descriptions
- would prefer a less centralized/web2 approach
- can look into ipfs/ipns and ceramic here

## DAO vault details

Daoahus daos can have 2 types of vaults.

### Main Treasury
- Holds funds controlled by proposals
- This is the main moloch contract and it's balances are tracked internally to the contract - the guildbank balances are what we need to report on
    - https://github.com/HausDAO/Molochv2.1/blob/main/MolochSummoner.sol
- A passed proposal with tribute is inflow
- A passed proposal with payment is outflow
- Funds can be sent directly to this vault - and get added to the treasury when the collectTokens function is called - also inflow
- Only holds ERC20 tokens

### Minion Vaults
- Holds ERC20 and network tokens
- Funds can be sent directly to the contract - inflow
- Funds can only leave the minion through a proposal - outflow


Example dao with multiple minion vaults
https://app.daohaus.club/dao/0x64/0xef3d8c4fbb1860fceab16595db7e650cd5ad51c1/vaults


### Data sources

#### Treasury

Treasury inflow/outflow events can be seens in the subgraphs and queried as an api
https://daohaus.club/docs/devs/subgraphs

example:
https://thegraph.com/legacy-explorer/subgraph/odyssy-automaton/daohaus-xdai

- proposal entity holds data about wether the proposal passed, had tribute and/or payment

stats graph has a balance entity that tries to track all inflow/outflow and could be used:
https://thegraph.com/legacy-explorer/subgraph/odyssy-automaton/daohaus-stats-xdai
- tracks the processedProposal event and collectToken events


#### Minion

Will likely need to use web3.js/ether.js or block explorer apis to look at transaction history here.
- will want to look at erc20 and network token activity

https://etherscan.io/apis
https://blockscout.com/xdai/mainnet/api-docs
https://polygonscan.com/apis

## MVP

Can be found at https://daobooks.vercel.app

### Future improvements

Maybe a first step could be to ensure there aren't other features we want on the list and help prioritize?
- Meet with Daohaus UX/UI team to get feedback
- Can we find DAO members doing accounting to interview about thier usecases and let them try the tool?
    - can reach out in daohaus server 
    - not sure what we'll get 
    - might be more useful after addressing some of the things below? 

Then we can prioritize and spec it.
- create a rip proposal



Stab at larger categories-

Enhanced data on entries
1. Implement transaction explorer for each transaction in Treasury vault and minion vault
2. Improve the vault card to include the list of tokens like we have on the daohaus app.
3. Add icons of tokens wherever they are used.
4. Add proposal details to the treasury vault detail page (for ex. Applicant is missing)
5. Implement the ability to tag, categorize and add remarks to transactions off-chain
- we can do some thinking in this section on categorization
    - what can we automate to start
    - how can we enable manual categorization
    - Use heads from a balance sheet as a category

6. Add USD values at the time of transactions + also display current usd values. 
    - start with current usd value
    - wait on historical - ask daos

stuff to explore:
- https://www.textile.io/
- ceramic

Usability/tech updates
7. Server side pagination for Transactions as the max no. of transactions that can be fetched today is 1000. Idea is to iterate over and over till we have all the transactions before returing the response.
8. Better error handling on frontend when there is an error. 
9. Add global token filter on vault detail page so that a user can filter everything on the page for that token. 
10. Implement a date filter and add opening balance to the tables.
11. Check if Closing Balance = Total Inflow till date - Total Outflow till date - IMPORTANT
12. If 11 is true, then implement date filter and add opening balances to the table (Opening Balance = Closing Balance - (Inflow - Outflow))
13. If 11 is false, fix it and then do 17. 
14. Add Website Usage Metrics. 
    - https://plausible.io/
    - vercel
    - Manual events tracking

UX/UI Polish
11. UI is bare, it needs more flair.


Nice to have/future features
12. Add NFTs section to the Vault Detail page as some minions have NFTs (for ex. Raid Guild's Armory minion)


not sure
14. Link minion and vaults detail page in daohaus app for immediate access to transactions.


18. DAOs on pokemol are not working - Need to fix that.
19. Make sure that the bookkeeping app is compatible with all molochs. V1, V2, V2.1


20. Add as a Boost on daohaus
    - Link minion and vaults detail page in daohaus app for immediate access to transactions.
22. Ensure this works for Safe Minion


Maybe a review of web2 double entry system features for other future ideas?




### User feedback

```
this looks like a good start.  I think once the "description details" come through, it becomes more useful.
```
 - adding details from the proposal or inflow/outflow event


```
Still though, I would have to manually categorize the different outflows into categories manually.  Which is what I am already doing straight from DAOhaus. I guess what solves this is if you could add Tags to proposal in DAOhaus and these Tags feed through to this Tracker as well.

During a request for monthly distro to Magesmith circle, we want the proposal creator (or someone after) to put a "Magesmiths" tag on that proposal.

Now, you could see that it's going to the Magesmiths minion and identify it that way too.  But tags seem more flexible.
So some known Tags would be:

Magesmiths
Paladins
Alchemists
Rangers
Monthly Distro
Marketing 
Sponsorship
Audit
```
- Wanted you to see this - but this ask is more from the daohaus side on proposal creation and it would be different for each dao - so likely a bigger issue than we can handle in the bookkeeping app. But manual categorization in the bookkeeping app gets us some of the way there.


## RIP Proposal

### Major Elements of RIP

1. Verify the correctness of MVP 
2. Integrate MVP with DAOHaus
4. Inform DAOs about the feature.
5. Gather feedback from DAO accountants
6. Enrich transactions
7. Improve Visual Elements of MVP


### Verify the correctness of MVP

- Verify the closing balances for transactions. 
    - Closing Balance = Total Inflow - Total Outflow (8h)
- Display more than 1000 transactions on the page. (10h)
    - Keep making queries till transactions dont have any other page left. 


### Integrate MVP with DAOHaus

- Setup hosting for production (8h)
- Integrate with Boosts
    - Create a new boost (5h)
    - Link the vaults page of bookkeeping app to the Bank page of daohaus app (3h)
    - For each vault, link the respective page on the bookkeeping app (3h)
- Monitor usage of the app
    - Check whether it is okay to use analytics on a dapp as most dapps mention that they dont use trackers. (2h)
    - Check out Plausible (https://plausible.io/)
    - Implement tracking (15h) - Contingent on being able to track. 
        - Come up with the list of things to track in the analytics. for ex. No. of times filters were used
            - ..
            - ..
            - ..

### Inform DAOs about the feature.

Since its a big feature, we need some help to market it better so that the DAOs use it and we are able to gather feedback. (8h)

### Gather feedback from DAO accountants

- Find Accountants (2h)
- Prepare a list of additional questions to ask them(4h)
    - Do you need the USD value of the token at the time of the transaction?
    - How do you currently/plan to account for transactions in the treasury and the minions? 
    - How do you account for NFTs?
    - which heads do you use to tag each transaction?
    - Would a cash flow statement beneficial in this case?
- Conduct Interviews (1 * 4 = 4h) 

### Enrich transactions

- Create a global date filter and if that is applied also show the opening balance in the columns. (10h)
- Fix TX Explorer link
    - Add transaction hash to subgraph (4h)
- Add proposal details (and others rageQuit, tokensCollected) to the subgraph (this will also help with automated categorisation) (8h)
- Integrate proposal details in the data table (8h)
- Add Transaction info to minions API contingent of it containing something (highly unlikely) (-)
- Hook up query params with the transaction table for better sharability. (8h)
- Tagging Transactions
    - Explore options to store tags and create proof of concept (16h)
        - Ceramic 
        - textile.io 
        - Find someone in Raid Guild who already had experience with this. Otherwise drop this completely for next version.
    - Prepare the list of manual tags based on Accountant's feedback (1h)



### Improve Visual Elements of MVP

- Meet UI/UX team of DAOhaus and improve the UI of the app.(1h)
- Logo, Favicon and name of the app(4h)
- Update `<title>` tags for all pages
- Improve the vault card and include the token logos(4h)
- Add loading spinner when fetching data(4h)
- Also add token logos to the tables on the detail page.(3h)

### Other estimations

- Time spent scoping the project (8h)