Grant Application: Safe App for Stop-Loss Orders

Grant Title:

Safe App for Stop-Loss Orders


Author:

@bleu @yvesfracari @ribeirojose @mendesfabio


About You:

bleu collaborates with companies and DAOs as a web3 technology and user experience partner. We’re passionate about bridging the experience gap we see in blockchain and web3.

Our team has developed applications that give more visibility and make it easier to interact with Balancer’s smart contracts.

We’ve worked on a previous grant for CoW, Safe App for Milkman Orders, which enabled us to dip our toes in the protocol. We feel ready to take on the challenge to work with Composable CoW and we’re excited about exploring and innovating in CoW.


Additional Links:

We have already developed several tools for the Balancer protocol, among which a Pool Simulator, a Historical APR dashboard, and a Vault Internal Balances Manager.

With the CoW team we worked on the MilkmApp grant, another safe app that helps DAOs to create special orders on CoW Swap.


Grant Category:

User interface and user experience (UI/UX)


Grant Description:

As described in the RFP, stop-loss orders are conditional orders that are not executed until the strike price is met. To achieve that, the stop-loss contract uses an external price oracle and a strike, defined when the order is created.

We’re proposing to create a Safe app UI to allow for multisig wallets to fully manage stop-loss orders. We will utilize the contracts deployed by CoW, which support only Chainlink oracles by default. Given that restriction, only tokens that have a Chainlink oracle will be supported. In future iterations of this project, we see the opportunity to develop a contract that abstracts away Chainlink oracles to include any oracles, enhancing the app’s versatility.


Grant Goals and Impact:

The main goal of our project is to allow non-technical users access to implement their investment strategies on CoW by allowing them to manage stop-loss orders. Our aim is to help grow the protocol by attracting more users and thereby increasing trading volume.


Milestones:

Milestone Due Date Payment
UI design + basic infrastructure 1 week $2000 USD
Order Creation 3 weeks $6000 USD
Order history and cancelation 1 week $2000 USD
Batch Order Creation 1 week $2000 USD

UI design + basic infrastructure

Figma designs of the relevant components, pages, and user flows of the app. We plan to share our progress on Discord and get feedback as we go, much like we did with the Milkman grant. We see some UI overlap with Milkman and plan to build upon that app. A draft UI design can be found here (we also added some screenshots below).

In terms of basic infrastructure, we need some on-chain and off-chain tooling to help with project development, e.g. running the WatchTower towers, deploying mocked chainlink oracles to testnets, etc.

Order creation

Functional app with the ability to create Stop Loss orders with all relevant parameter definitions and checking. The checks will include:

  • Whether token in/out are supported by Chainlink oracles;
  • Detect/set the right fallback handler if isn’t the ExtensibleFallbackHandler;
  • Whether the connected address has the specified amount (we are considering implementing an advanced mode that may include or omit the check for whether the connected address has the specified amount);
  • Whether the selected Chainlink oracle is one of the active price feeds;
  • Whether both oracles are paired to the same token;

At this point, the app will connect to Safe multi-sigs and create stop-loss orders, which are tracked by the WatchTower and then posted on CoW’s API.

Order History and Cancellation

Allow users to track their past/current orders and set a status to each order (created, posted, completed, and canceled). We’ll work on an API (potentially Subgraph or similar) to track the creation of these orders in particular. We’ll use CoW’s own API to check when the order gets posted / executed. We’ll check against ComposableCoW contract for order cancelations since that cancelling orders doesn’t emit any events.

Each order will show relevant information, such as tokens, amounts, strike price, and links to CoW Explorer should the order already have been posted.

Until orders are final (e.g. completed/canceled), users will also be able to cancel them on the UI.

Batch Order Creation

Allow users to create multiple orders at once, decreasing gas cost and simplifying voting / signing process (more sensitive for DAOs).


Funding Request:

The funding will be divided as follows:

  • Upfront:
    • Criteria: Grant approval by snapshot voting
    • Payment: $6k USD-equivalent at the time of payment;
  • App production deployment:
    • Criteria: App approved by the grant committee
      • Payment: $6k USD-equivalent at the time of payment;
  • Volume Based Program:We request to participate in the Volume-based Partner Reward Program. With this, we can receive more COW if we achieve the program volume goals.

Budget Breakdown:

The budget includes the hourly rates of a developer during the execution, and a designer and project manager on a need-basis. It also includes the diluted maintenance costs for 6 months. It also covers the expenses incurred during any eventual deployments.


Gnosis Chain Address (to receive the grant):

0x554866e3654E8485928334e7F91B5AfC37D18e04


Other Information:

  • All the code will be open-source from day 0. We’re open to feedback during PRs as well;
  • This grant would also be our first step in making user-friendly tools related to Composable CoW orders, and we are particularly excited about eventually moving in the direction of allowing non-technical folks (i.e. non-developers) to create their own order types using Composable CoW, such as what @fleupold mentions here.
  • Needless to say, we’re happy to answer any questions and are open to feedback about this proposal;

Terms and Conditions:

By submitting this grant application, I acknowledge and agree to be bound by the CoW DAO Participation Agreement and the CoW Grant Terms and Conditions.

Order creation mockups



1 Like

This looks very interesting. I am in favour of this work package.

2 Likes

Very interesting proposal that will bring more use for the protocol, given your previous work on the Milkman App I’m willing to support this proposal.

1 Like

Dear Applicant,

Thank you for submitting your grant proposal. We are eager to review it. Please be aware that due to the recent renewal of our grants program and the holiday season, we are currently experiencing a delay in our review process. This may result in an extended timeline for the grants committee to establish their procedures and provide you with specific feedback. We appreciate your understanding and patience during this time.

We would like to propose the payment change to include COW tokens. For that, we would like to decrease the xDAI payment to 10k and add 12k COW. Do you guys agree with this change?

2 Likes

To be clear on this, I’d support the change, moving 2K XDAI to 12K COW, however with the caveat that:

  1. The 12K COW is vesting over 12 months, with vesting started at the time of completion of the project.
  2. Given that this at current market rates in effect is a price increase (though bleu is taking volatile token exposure), I would advocate that this includes 12 months maintenance as opposed to 6 months.
3 Likes

We agree with both points, here are our updated funding request and budget breakdown sections of the proposal:

Funding Request:

The funding will be divided as follows:

  • Upfront:
    • Criteria: Grant approval by snapshot voting
    • Payment: $5k USD-equivalent at the time of payment;
  • App production deployment:
    • Criteria: App approved by the grant committee
      • Payment: $5k USD-equivalent at the time of payment and 12k COW vested over 12 months;
  • Volume Based Program: We request to participate in the Volume-based Partner Reward Program . With this, we can receive more COW if we achieve the program volume goals.

Budget Breakdown:

The budget includes the hourly rates of a developer during the execution, and a designer and project manager on a need-basis. It also includes the diluted maintenance costs for 12 months. It also covers the expenses incurred during any eventual deployments.

2 Likes

Hey, this sounds great, did you want to move this to a snapshot vote?

1 Like

Yes! Here is the snapshot.

Thanks to the grant team for the trust again, we’re happy that our partnership is growing on each grant. We will update this post on each milestone completion.

Even though the snapshot was approved a few days ago, we already had started the development before it. Our progress can be followed on this repository. Until now our progress is:

  • Basic Infrastructure: Finished
  • UI Design: Created low-fi templates here.
  • Order creation: In progress, missing UX features.
  • Order history and cancelation: In progress, missing order details.
  • Batch Order Creation: Not started.

We’re open to questions/feedbacks as always!

3 Likes

I’m reaching out about a budget update for the Stop Loss App project. We started on March 7th with a 10k USD budget for a 6-week project, but it has evolved significantly:

  • March 7th: Project start with initial proposal.
  • April 24th: We delivered the first layout enabling various programmatic orders, similar to the hook store concept.
  • Late April - End of May: We worked and integrated the UI/UX feedbacks provided and started to work on the CoW AMM Extension.
  • June 17th: After working on another project (CoW AMM Extension), we decided to refactor the app UI to improve user intuitiveness and the hook store development by your frontend team.
  • July 9th: We sent the refactored UI for review.
  • July 26th: We worked on additional feedback, including smart contract refactoring to address bugs found during the review process.

We really appreciate all the feedback we’ve received, but we underestimated the extent of revisions needed based on our previous project experiences, investing double the hours originally quoted on this project. So we’d like to revise our budget to 18 xDAI and 21k COW vested. This will add 8k xDAI and 9k COW vested to the original amount, which should sum to approx 10k USD using last month’s rates and cover the development costs. We value our partnership with CoW and hope you understand this adjustment given the expanded scope. We’re committed to delivering a top-quality product and are open to any questions.

In addition, I would also like to share that this is one thing that shouldn’t happen in future grants. For that, bleu is committed to presenting better UX flows on grant applications and reporting more promptly if a project is taking longer than expected, to keep everyone aligned.

3 Likes

Given the increased scope that was requested by CoW DAO Grants that was not in the original proposal, I signal my support of this supplementary grant application. If there are no hesitations / rebuttals from the grants committee within a couple of days, please feel free to move this to snapshot.

2 Likes

With what Bleu has successfully delivered across multiple grants already and having followed how this specific grant evolved, I support this budget adjustment.

1 Like

Thanks for the support. The budget update was moved to snapshot here: Snapshot

I re-opened the snapshot since the last one didn’t had enough quorum because it happened over the weekend: Snapshot

1 Like