# OpenSquare treasury proposal for infrastructure new delivered features and developement plans
Beneficiary: OpenSquare(12sNU8BXivMj1xQmcd4T39ugCyHjmhir8jkPqfAw5ZDESrx4)
Date: 12/14/2022
Requested Allocation: $161,920(35,579 DOT by the EMA7 price of 12.25.2022 on subscan)
---
OpenSquare has been actively developing new features for infrastucture products including [subsquare](https://www.subsquare.io/) and [dotreasury](https://www.dotreasury.com/). This is a proposal for some delivered features and new development plans.
## Subsquare delivered
### OpenGov support
Please check [here](https://kusama.subsquare.io/referenda) for referenda support. Main user stories includes:
1. As a referenda user, I can see tracks and the referenda list with their status.
2. As a referendum proposer, I can edit the context for it.
3. As a community member, I can see the metadata, timeline, decision/confirmation chart, and I can also leave comments.
4. As a community member, I can see the tally with threshold chart on a referendum detail page.
5. As a community member, I can see all the votes to a referendum.
6. As a token holder, I can delegate my vote to others on a specific track.
7. As a token holder, I can vote for a specific referendum.
Please check [here](https://kusama.subsquare.io/fellowship) for fellowship business support. Main user stories includes:
- As a community member, I can see all fellowship members.
- Same user stories with referenda user story 1, 2, 3.
Generally our Work includes:
- Business study, test and scan scripts.
- Backend restful apis for referenda list, detail, comments, etc.
- Fronted pages and interfaces: Gov2 entrace interface, menu, list, detail page, deciding/confirming status, threshold visulization, votes, etc.
- Felloship support: we'd have to refactor most of upper work to support multiple referenda pallet instances.
Estimated development time:
| Development | Estimated hours | memo |
| ---- | ---- | ---- |
| Scan scripts | 112 | 2 FTE * 7 days |
| Server RESTful apis | 56 | 1 FTE * 7 days |
| Fronted | 360 | 3 FTE * 3 weeks |
| Design | 120 | 1 FTE * 3 weeks |
| Fellowship support | 120 | 3 FTE * 1 week |
| Total | 768 | |
### Other features
- Login account sign.
Before this feature, users have to choose the target account from extensions before signing a extrinsic. This featuer keep consistent with most dapps and help later features like proxy/multisig settings.
- Proxy account support.
Please check the [PR](https://github.com/opensquare-network/subsquare/pull/2410/files), and issues [#2201](https://github.com/opensquare-network/subsquare/issues/2201), [#2252](https://github.com/opensquare-network/subsquare/issues/2251) for context. We can use the proxy account to login and sign extrinsics on behalf of the proxied account. It will facilitate account operations in parity signer or cold wallet.
- Democracy delegation.
Similar with referenda delegation, we support it for democracy pallet.
Estimated development time:
| Development | Estimated hours | memo |
| ---- | ---- | ---- |
| Login account signing | 40 | 1 FTE * 1 week |
| Proxy support | 80 | 2 FTE * 1 week |
| Democracy delegation | 16 | 1 FTE * 2 days |
| Total | 136 | |
## Subsquare new features plan
### OpenGov curve chart
Though we have implemented decision/confirmation status and passing/support threshold visulization for a referendum, it's still difficult for a community member to understand how the referenda track passing curve works. Visual curve charts will help a lot. We will support following user stories to solve this situation.
- As a user, I can see the curve chart on the track panel page, so I can know the pass and support threshold at any given decision time point.
- As a user, I can see the current referendum threshold point on referendum deetail page, so I can know the gap between current votes and the minimum threshold requirement at current time point, and I can also get the approximate threshold trend as the decision time goes.

### Treasury workflowy through OpenGov
In Gov1, the workflow maybe:
1. `Treasury proposal/bounty` -> `Council motion` -> `Awarded`.
2. `Treasury proposal/bounty` -> `Democracy referendum` -> `Awarded`.
But in OpenGov, the new workflow maybe:
1. `Treasury proposal/bounty` -> `Referenda referendum` -> `Awarded`.
2. `Referenda referendum` with `treasury#spend` call -> `Treasury proposal` created and approved -> `Awarded`.
So to support treasury workfloy through OpenGov, the work will include:
1. Refactor scan scripts to bind referenda referendum with existed treasury proposals/bounties or the to be created treasury proposals.
2. Refactor backend apis/services to support OpenGov treasury process.
3. Fronted pages adjustment and components to show the corresponding context, timeline, threshold, etc.
### OpenGov split/abstain vote support and fellowship vote and threshold support
- Subsquare have supported standard vote for referenda/democracy vote, we propose to suppport split vote for both referenda and democracy, and abstain vote for referenda(conviction voting).
- Subsquare now supports basic info view and context edit for fellowship referendum, and we propose to implement the fellowship referendum vote(ranked-collective) and threshold visulization.
### OpenGov events subsription and notification
Subsquare has delivered the support for democracy, treasury, council and Tech. Comm. events subsciption and notification. Email notification is important to let users get the on chain events in time, so we'd propose to implement it for OpenGov too. The notification items will include most timeline items of a referendum, and we will support both referenda and fellowship.
### OpenGov user profile activities
Same as notification feature, subsquare support user profile feature. Taking [Raul's profile](https://polkadot.subsquare.io/user/1hCMdtRsaRA4ZTEKpPKPvEjK9rZpGhyFnRHSDhqFMCEayRL) as an example, we can see Gov1 activities. We propose to implement it for OpenGov.
### Delegation enhancement
Currently subsquare support set/view/remove my delegations feature. We propose to enhance this feature with supporting following user stories:
- As a delegatee, I want to see the total balance and support I have been delegated on each track page, so I can know my vote power for this track.
- As a delegatee, I want to see who has delegated their vote balance to me, and their balance, conviction on each track, so maybe I can know whose trust I have got.
- As a user, I want to see all my delegations on the referenda entrance page, so I don't have to check each track for my delegations.
- As a delegatee, I want to see who has delegated their vote to me on the referenda entrance page, so I don't have to check every track.

### Calendar
Calendar feature will help us know history and upcoming governance events in a calendar's view. Following events will be included in the calendar:
- Democracy events including timeline items of public/external proposal and referendum.
- Council/Tech. Comm. motion events.
- OpenGov referendum events.
- Scheduled execution in scheduler pallet.
- Admin set events. We will support admin setting and only admins can set customized events.
### `cmd+k` shortcut for better routes nativation
There are too many menus after OpenGov release and it's a problem for users to navigate between Gov1 and Gov2, and choose the right target route. `cmd+k` shortcut will provide a way for user to reach the target route quickly, and it will help future improment of menus layout because we can hide current menus in a popup way and use `cmd+k` as the primary navigation way. In general, this feature will provide a better user experience.

### Discussion post enhancement features
- Labels. This feature will help categorize posts as posts amount grow. We can pre-set labels for each deployment. Users can filter posts by clicking labels.
- Link a proposal with discussion post. Usually users create a post for discussions first before submit a proposal on chain, and then copy the content or add a link to the proposal context post. It's better if the proposal author can link the on-chain proposal to a pre-existed post, so the author don't have to edit the content again.
### A statistic summary panel
We propose a summary panel on the overview page to show current various active proposal numbers and users can see it at first when they open the home page. It's another way for users to quickly locate the ongoing business.

### Unfinalized proposals view enhancement
Subsquare now scan only the finalized blocks in case of blocks rollback handling. So there maybe cases that proposals are shown on the polkadot apps but not on subsquare. It's because polkadot apps show the latest unfinalized chain state. Subsquare show a 404 page if users visit these unfinalized proposals. We propose to solve this by implementing a pending page which will show a scanning status to users, and users can know what happens and the estimated time for the proposal showup.
### Off-chain discussion data decentralization
As OpenGov released, we think it's time to nudge the governance discussions data decentralization process. It's a very important step to implement `less trust, more verify`. The general implementation in our plan is:
1. Users login with their polkadot key.
2. Users have to sign every interaction including adding post context, leaving comment, thumbs up, etc.
3. Users' data is normalized and we can store them to decentralized storage vendors like arweave, crust.
4. Governance paltforms like subsquare, polkassembly, BrightTreasury, nova wallet sync the corresponding IPFS CID to dotsama chain with indicators in a `system#remark` extrinsic. Note: we don't have to wrap every user integration IPFS CID in a extrinsic, and we can make a batch sync in a 10 mins interval for example.
It's important for current platforms to reach consensus before one platform goes too far. So we propose to draft a specification first in this proposal and then we'd plan to draw attentions from community to have a discussion about it. The work includes:
- Drafting the specification.
- Creating post, promote it and call for community to discuss it.
- Write some scripts to help demostrate the feasibility of the spec including scripts to sync with `system#remark` extrinsic, IPFS handing, etc.
### Budget
| Development | Estimated hours | memo |
| ---- | ---- | ---- |
| OpenGov curve chart | 112 | 2 FTE * 7 days |
| Treasury workflowy through OpenGov | 80 | 2 FTE * 1 week |
| OpenGov split/abstain vote support, fellowship vote and threshold support | 56 | 1 FTE * 7 days |
| OpenGov events subsription and notification | 40 | 1 FTE * 1 week |
| OpenGov user profile activities | 24 | 1 FTE * 3 days |
| Delegation enhancement | 56 | 1 FTE * 7 days |
| Calendar | 360 | 3 FTE * 3 weeks |
| `cmd+k` shortcut for better routes nativation | 40 | 1 FTE * 1 week |
| Discussion post enhancement features | 40 | 1 FTE * 1 week |
| Statistic summary panel | 32 | 1 FTE * 4 days |
| Unfinalized proposals view enhancement | 16 | 1 FTE * 2 days |
| Off-chain discussion data decentralization first phase | 56 | 1 FTE * 7 days |
| Total | 912 | |
## Dotreasury OpenGov support
Dotreasury now serves as a popular treasury dashboard/dapp in the dotsama ecosystem. It shows various treasury proposal details and the workflow timeline through council motions or democracy. It also shows various statistics for expenses, income and paticipators. As Gov2 released and main treasury governance will go through with it, we propose to implement following user stories:
- As a community member, I want to see all treasury applications through OpenGov and their status.
- As a community member, I want to filter applications by tracks.
- As a treasury/bounty proposal propser, if my proposal is deciding/decided by OpenGov referendum, I want to see it in the proposal timeline, so everyone can know how my proposal is passed.
- As a community member, I want a way to separate treasury proposals through OpenGov and Gov1, because most OpenGov treasury proposals use `treasury#spend` call, and it can be used for different types(big/medium/small spende, tips).
The work will include:
1. Scan scripts for referenda referendum and tracks business. Extract treasury proposals related calls and bind them with target proposals. Note some work done in subsquare can be reused here.
2. Backend RESTful apis for treasury applications through OpenGov. Refactor existed treasury proposal/bounty apis to support referenda timeline.
3. Applications page which show ongoing/finished spend proposals by OpenGov referenda. We can filter them by tracks.
4. Show treasury proposals through `treasury#spend` on the proposals section, and we can separate it with Gov1 proposals.
Budget
| Development | Estimated hours | memo |
| ---- | ---- | ---- |
| Scan scripts | 56 | 1 FTE * 7 days |
| Backedn apis | 24 | 1 FTE * 3 days |
| Treasury applications section front page | 80 | 2 FTE * 1 week |
| OpenGov referendum timeline item in proposal | 24 | 1 FTE * 3 days |
| Treasury proposal list page refactor to support OpenGov | 24 | 1 FTE * 3 days |
| Total | 208 | |
## Total budget
Please check above sections for details of each item. Taking hour rate $80, please check following budget list.
| Development | Estimated hours | Fiat cost |
| ---- | ---- | ---- |
| Subsquare delivered new features | 904 | $72,320 |
| Subsquare new planned features | 912 | $72,960 |
| Dotreasury OpenGov support | 208 | 16,640 |
| Total | 2008 | 161,920 |
- Beneficiary: 12sNU8BXivMj1xQmcd4T39ugCyHjmhir8jkPqfAw5ZDESrx4(identity is OpenSquare)
- We will update the allocated DOT by the price of subscan on the submission date.
## Possible questions
### Do you have pending tasks for history proposals?
Our last proposal is [poladot #155](https://polkadot.subsquare.io/treasury/proposal/155), and we finished all promised features for subsquare and dotreasury. We comed back to subsquare when OpenGov released when we were working on off-chain voting featuers, but realized subsquare OpenGov support has a higher priority. We will definitely finish the promised features for off-chain voting, but we think some proposals on this proposal still have higher priorities than that, so we will work for these features in parallel.
### How can I know these 2 products are welcome by the community?
We're working hard to provide more features, make it more and more user friendly and we think the user numbers are growing by following cloudflare indicators.

### What's your roadmap?
The proposed features will cost us about 2 or 3 monthes. Long term(about half a year) direction will be:
- Subsquare off-chain discussion data should be decentralized. We will begin to push and implement it when the spec proposed in this proposal get some support.
- Dotreasury will focus more on statistics, by categories, time scope, roles, etc.
Of course we are continually getting feedback from the community and improving many details.