LogoLogo
  • Tally Docs
  • Tally Features
    • What is Tally?
    • Token Launch
      • Claim
      • Governance Smart Contracts
      • Token Wrapper
      • Delegate Registration & Claim-and-Delegate
    • Value Accrual with Staking
      • Features & Use Cases
      • FAQ
      • Glossary
    • Governance
      • Advanced Features
        • MultiGov
        • Advanced Voting
          • Flexible Voting Extension
          • Signal Voting
            • Snapshot
          • Private Voting
        • Partial Delegation
        • Security Council Elections
        • Chain Integration
        • Proposal Templates
        • Optimistic Governance
        • Gasless Voting and Delegation (Relay)
          • Gasless Voting
          • Gasless Delegation
        • Integrations
          • Karma - Delegate Scoring
          • Discourse
          • Safe
      • Standard Features
    • Tally API
    • Tally Zero
  • How to Use Tally
    • Navigate the Tally homepage
    • Set up a Tally Profile
    • Create Proposals
      • Custom Actions
        • Chain Deployment of Uniswap v3
        • Token Vesting with Hedgey
        • Token Grants with Hedgey
        • Streaming Payments with Sablier
        • Tuple Support
      • Swaps
        • Swaps: FAQs
      • Draft Proposals
      • Test Proposals
    • Execute Proposals
      • Advanced Execution
    • Delegate on Tally
      • Delegates Page
      • Delegate Voting Power
      • Create a Delegate Statement
    • Vote on Tally
    • Stake on Tally
    • Get Notifications on Tally
    • Use Tally with a Gnosis Safe
      • Vote with a Gnosis Safe
      • Zodiac Governor Module for SubDAOs and Grants Programs
      • Upgrade Gnosis Safe to Governor with Zodiac
    • Participate in Security Council Elections
    • Using Ledger with Solana
  • Set up & Technical Documentation
    • Tally Architecture
    • Deploy a Governor DAO
      • Deploy a Governor
        • Deploy a Governor with a new token
      • Add a Governor to an existing token
      • Check for Token Contract Compatibility
        • Network Support
        • OpenZeppelin Governor
        • Compound Governor Bravo
        • Tokens: ERC-20 and NFTs
      • Choose Governor parameters
    • Add a DAO to Tally
      • DAO Admins
      • DAO Settings
    • Use Governor with Gnosis Safe
      • Gnosis Safe Overview
      • Zodiac Governor Module for SubDAOs and Grants Programs
      • Upgrade Gnosis Safe to Governor with Zodiac
    • Staking Contracts
      • Get Started
      • How Staking Works
        • Liquid Staking Tokens
          • LST Auto delegates
      • DeFi Integration Guide
      • FAQ & Troubleshooting
    • Security
    • Chain Compatibility
  • Education
    • Intro to Governance
      • General Ecosystem Info
      • Participating in Governance
    • Governance Concepts
      • Decentralized Governance Overview
      • Onchain vs Offchain Voting
      • Application Layer vs. Base Layer Governance
      • Governance Execution Methods
      • Procedural Governance
      • Vote Delegation
    • Governance Frameworks
      • OpenZeppelin Governor
      • Curve Voting Escrow
      • Multisigs
      • Snapshot Polls
    • DAO Best Practices
      • Running an Onchain DAO Using OpenZeppelin Governor
    • Index of DAOs
      • DAOs on Tally
        • Aave (AAVE)
        • Ampleforth (FORTH)
        • Arbitrum (ARB)
        • Compound (COMP)
        • Gitcoin (GTC)
        • GMX
        • Idle Finance (IDLE)
        • Inverse Finance (INV)
        • PoolTogether (POOL)
        • Uniswap (UNI)
        • ZKsync
      • DAOs Not on Tally
        • Balancer (BAL)
        • Curve (CRV)
        • Index Coop (INDEX)
        • KyberDAO (KNC)
        • MakerDAO (MKR)
        • Sushi (SUSHI)
  • Resources
    • Tally Platform
    • Blog
    • DAO Talk Podcast
    • Newsletter
    • Twitter / X
  • Payment Addresses
Powered by GitBook
On this page
  • Where do the quotes come from?
  • What is a price checker?
  • What happens if the price checker doesn't see a good price?
  • How does the Uniswap price checker work?
  • How do I use a custom price checker?
  • What is in the Swap Recipe executable?
  • How do I read a swap peceipt?
  • How do I cancel an order?
  • Why is an order stuck in Pending execution?
  • Why is there so much slippage in small orders?

Was this helpful?

Export as PDF
  1. How to Use Tally
  2. Create Proposals
  3. Swaps

Swaps: FAQs

Common questions about Swaps, asked and answered.

PreviousSwapsNextDraft Proposals

Last updated 1 year ago

Was this helpful?

Where do the quotes come from?

The quotes come from, which estimates current prices from onchain sources. As the order executes in the future, prices may vary.

Quoted price is not guaranteed

Upon proposal creation, you will receive a quote from CoW based on current market conditions. However, market conditions may change by the time of proposal execution, and a new quote from CoW will be used to create your order.


What is a price checker?

ensures that your order only executes if the market price is close, using a price oracle and a slippage parameter.

The default price checker on Tally uses Uniswap v3 as a price oracle and sets a max slippage. Custom price checkers can implement any logic they want.

Milkman price checker

enables smart contracts, like Governor, to place CoW Swap market orders onchain. Milkman's price checker ensures that orders only fill at prices close to the market price.


What happens if the price checker doesn't see a good price?

If the price checker rejects fills with unfavorable prices, the assets to sell remain in the Milkman order contract. To return those funds to the DAO's treasury, the Milkman order needs to be canceled with another onchain proposal. See .


How does the Uniswap price checker work?

Tally's default price checker uses the Uniswap V3 oracle to get market prices.

If you select this price checker, Tally suggests a max slippage and picks the Uniswap pair(s) to use for the price oracle.

If there is not a direct path (e.g. COMP<>USDT), Tally will try to make a “bridge” with two pairs, e.g. COMP->WETH->USDT instead of COMP->USDT. If that doesn’t work, you’ll have to make a custom price checker route.

Example Using the Uniswap Price Checker

Note that steps 3-7 happen after the Governor proposal.

  1. You want to sell 5 COMP to buy USDT

  2. You create an order with Milkman. You set the price checker to use the Uniswap v3 oracle oracle and to accept 10% slippage.

  3. That milkman order goes onchain. Solvers compete to offer the best price for your order.

  4. The best offer from CoW solvers is 100 USDT for 5 COMP.

  5. The price checker uses the Uniswap v3 oracle. The Uni v3 price is 21 USDT for 1 COMP.

  6. The price checker confirms that the best offer is greater than the market price with slippage. Here’s the logic:

    The offer of

    100 USDT / 5 COMP = 20 USDT per COMP

    is greater than the price checker’s limit of

    21 USDT per COMP * 0.9 slippage = 18.9 COMP

  7. The price checker allows the order to execute on CoW protocol

If no solver comes up with a price greater than 90% of the oracle’s market price, then the order will sit unfilled until someone does. This order can also be canceled by whoever has the cancel role. In the context of a Governor proposal, that’s the DAO, as it is the entity that request the swap.


How do I use a custom price checker?

You will need to find the contract address of a price checker and encode the data it can use to determine if the order gets a good price, usually slippage and a swap path. You may need to find a custom price checker that Custom price checkers can do anything, though.


What is in the Swap Recipe executable?

A Swap Recipe usually includes two executable calls.

  1. approve Milkman to spend sell token

  2. requestSwapExactTokensForTokens on Milkman

  1. deposit ETH to WETH contract

  2. approve Milkman to spend WETH

  3. requestSwapExactTokensForTokens on Milkman


How do I read a swap peceipt?

When casting a vote for a swap, you should check the receipt for accuracy.

The quoted price provides a rough estimate of current market conditions before a swap is filled. The path and slippage show how the price checker will calculate the market price and how much slippage to accept.

After a swap is executed successfully, the Swap Receipt will link to the CoW order and to the order contract.


How do I cancel an order?

To cancel an order, the Governor must call cancel on Milkman via an onchain proposal. Only the governor has authority to cancel an order. Canceling the order returns the assets that were for sale to the treasury.


Why is an order stuck in Pending execution?

This means that the order isn’t placed yet. The governor proposal has not yet been executed. Once the proposal has been executed, it will create an order on CoW via Milkman.


Why is there so much slippage in small orders?

Solvers pay gas to take an order. If the gas costs are large compared to the size of the trade, you’ll need high slippage to ensure that the solvers can make a profit after gas costs.

If the trade sells ETH, the funds must first be deposited for , since swap pairs must be ERC20s.

WETH
CoW's price estimator API
A Milkman price checker
Milkman
How do I cancel an order?