Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

provideLiquidity

Add liquidity to a passive pool. Unbalanced provision is equivalent to an internal swap to reach pool ratio, followed by a balanced provision.

Signature

function provideLiquidity(
  client: Client<Signer>,
  parameters: {
    sender: Address
    baseDenom: Denom
    quoteDenom: Denom
    funds: Coins
  },
): Promise<{ hash: Uint8Array } & TxData>

Example

import { createSignerClient, createTransport, testnet, PrivateKeySigner } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createSignerClient({
  chain: testnet,
  transport: createTransport(),
  signer: PrivateKeySigner.fromMnemonic(process.env.DANGO_MNEMONIC!),
})
const sender: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
await client.provideLiquidity({
  sender,
  baseDenom: "dango",
  quoteDenom: "bridge/usdc",
  funds: {
    dango: "1000000000",
    "bridge/usdc": "500000000",
  },
})

Parameters

senderAddress. The LP.

baseDenomDenom. Base asset of the pair.

quoteDenomDenom. Quote asset of the pair.

fundsCoins. Coins to deposit. May include only base, only quote, or both.

Returns

{ hash: Uint8Array } & TxData — see broadcastTxSync.

See also