Calculate how much of the secondary token is required from the user when adding liquidity. We require that the deposited ratio of central to secondary match the current ratio of holdings in the pool.

  • Parameters

    • centralIn: any

      The value of central assets being deposited

    • centralPool: any

      The value of central assets in the pool

    • secondaryPool: any

      The value of secondary assets in the pool

    • secondaryIn: any

      The value of secondary assets provided. If the pool is empty, the entire amount will be accepted

    Returns bigint

    • the amount of secondary required