Polkassembly Logo

Head 1
Head 2
Head 3
Head 4
Create Pencil IconCreate
TRACKS
ORIGINS
Report an issueNeed help with something?
Foot 1
Foot 2
Foot 3
Foot 4
OpenGov
View All Discussion

Treasury Proposal by Centrifuge: On-Chain Automated Treasury Management (with TWAMM)

mustermeiszer
2 years ago

Proponent: 12wWLUd5qMzLFGqBsMnHLVFeTuYJwuo5ygMAxuSywrBX1XSF

Date: 2023.03.30

Requested DOT: $495,000 ~ TBD DOT

Contact: William Freudenberger ([email protected])


The ongoing discussion about automated market makers (AMMs) in the Statemint roadmap is mainly focused on improving the user and custodian experience by allowing small atomic swaps natively and making Statemint a central hub for asset deposits. This addresses important pain points by enabling transaction fees to be paid in non-native tokens and facilitating interaction with the entire asset variety of the ecosystem without requiring to run custom nodes or infrastructure.

However, we believe that one aspect has been overlooked: the slow swaps of large volumes, which can be easily front-run or sandwiched. This is particularly relevant in the context of trades proposed through governance for use cases such as

  1. Paying out treasury grants, bounties or even salaries in less volatile currencies (ie. stablecoins).
  2. Enabling parachains to build a DOT reserve which can be used to acquire a parachain lease, pay XCM fees, or increase availability cores during times of high demand (once supported).
  3. Governance deciding to invest part of the treasury into a token to diversify their treasury

What we need is the opposite of what a traditional AMM provides: atomic swaps with immediate execution, even in relatively illiquid assets. A governance vote is unable to time the market and is highly predictable. Therefore, executing such a transaction as a market order on an AMM is problematic, as it will be guaranteed to be front-run. A better solution is to "dollar-cost-average" over a long period of time making it harder for price manipulation to affect the purchase.

At Centrifuge, we have researched distinct approaches of how to achieve hard-to-front-run slower transactions. In our opinion, the most elegant solution is TWAMM (Time Weighted Automated Market Maker. We are of the firm conviction that the implementation of this model represents the most efficacious approach for executing token swaps in the context of slower and passive procedures, such as governance.

TWAMM (Time Weighted Automated Market Maker) eliminates front-running vulnerabilities of traditional AMMs when executing large orders, especially in the context of passive procedures, such as governance. The proposed solution will be executed as a seamless extension to pallet-asset-conversion, thereby enhancing its capabilities as an embedded AMM.

The deliverables of the proposal contain the TWAMM-pallet, associated runtime APIs, associated research for further optimizing and extending the pallet, a security audit of the pallet and a frontend.

The full proposal can be found here.

Comments (2)

2 years ago

$150/hr for frontend developer? What seriously? Where are these geniuses coming from that charge this exorbitant amount? $200/hr for substrate developers. Centrifuge team exploiting the treasury just because of the existing reputation?

2 years ago

Hello Team,

Thank you for submitting this proposal for review/discussion by the Community.
A few comments:

What we need is the opposite of what a traditional AMM provides: atomic swaps with immediate execution, even in relatively illiquid assets. A governance vote is unable to time the market and is highly predictable. Therefore, executing such a transaction as a market order on an AMM is problematic, as it will be guaranteed to be front-run. A better solution is to “dollar-cost-average” over a long period of time making it harder for price manipulation to affect the purchase.

Q: Can you please clarify whether you are seeking to provide a completely different alternative to the proposed Statemine/t DEX or adding extra functionalities for this future DEX?

This innovative solution offers an elegant means of executing large orders even in relatively illiquid markets. It is particularly well-suited for slow automated processes, such as governance-controlled treasury operations, that can effectively implement a dollar-cost averaging strategy over extended periods.

Q: Will this solution be available for integration by other existing parachain/DEXes? If so, how will you spread the word about your solution within the Polkadot ecosystem to expand the reach of your TWAMM?

Technically, the goal would be to make this work for a single Substrate chain that includes the asset-conversion and twamm pallets. Ideally we can make this work using XCM for retrieving asset data, but alternatively we look to making this work directly on orml-tokens and/or assets. If possible, this would use the same design system as the Staking Dashboard.

Q: Which timelines are you looking at for the completion of the milestones in this proposal, given that the Common-good DEX is not deployed yet?

Milestone 3 - Security Audit Security audit from SR Labs Budget: 120,000$

Q: The PAL bounty has been proposed by a collective of parachain teams to finance part of the audits conducted on Polkadot ecosystem protocols. Would you consider applying for this bounty to cover the cost of your audit when the time comes for your solution to be audited?

The grant is proposed to the Polkadot Treasury and as such, if granted, will be paid in DOT.
At the time of writing the total grant amount of $494,500 results in a total grant amount of 80,999 DOT, based on EMA7 March 30th, 2023 (source: Subscan).

S: Please consider breaking down the above budgeted milestones into separate Treasury proposals with their own costs and reporting requirements, so that the community can have the opportunity to track and review the proposal's progress in the medium term.

PleaseLogin to comment

Help Center

Report an Issue
Feedback
Terms and Conditions
Github

Our Services

Docs
Terms of Website
Privacy Policy

A House of Commons Initiative.

Polka Labs Private Limited 2025

All rights reserved.

Terms and ConditionsTerms of Website
Privacy Policy