Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-instant-1· AnthropicHugging Face Arena Human Preference 55K

how to calculate amount to buy in an amm in order to bring a token price to a certain…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Ai2tulu-2-dpo-70b’s answer.
  1. User

    how to calculate amount to buy in an amm in order to bring a token price to a certain price give me the math If a token has a total supply of 10,000 and a treasury balance of 1,000 USDT, and you want to perform a buyback on Uniswap, assuming the pool has 100 USDT and 5,000 tokens with a current price of 0.02, the question is how much USDT from the treasury is needed to adjust the price to the desired (USDT in treasury / total supply) price.

  2. Claude Assistant

    Okay, here is the math to calculate how much USDT to add to an AMM pool like Uniswap in order to bring the token price to a desired price:

    • Current token price on Uniswap: $0.02

    • Total token supply: 10,000

    • Treasury balance: $1,000 USDT

    • Desired price: (Treasury USDT / Total Supply) = 1,000/10,000=1,000 / 10,000 = 0.10

    • Current pool amounts:

      • USDT: $100
      • Tokens: 5,000
    • Desired pool amounts after adding treasury funds:

      • USDT: $x (what we're calculating)
      • Tokens: 5,000 (remains the same)
    • Use the constant product formula for AMMs:

      • Current product: 100∗5,000=100 * 5,000 = 500,000
      • Desired product: x∗5,000=x * 5,000 = 500,000
    • Solve for x:

      • x∗5,000=x * 5,000 = 500,000
      • x=x = 500,000 / 5,000 = $100

    Therefore, the amount of USDT needed from the treasury to bring the token price to 0.10is0.10 is 100 - the current USDT in the pool of $100.

    So the amount to add is 100−100 - 100 = $0

    The treasury funds are already sufficient to reach the desired price given the current pool sizes. No additional funds need to be added.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.