Skip to content

amm.usePool ​

Gets the reserves for a liquidity pool.

Usage ​

ts
import { Hooks } from 'wagmi/tempo'

const { data: pool } = Hooks.amm.usePool({
  userToken: '0x20c0000000000000000000000000000000000000',
  validatorToken: '0x20c0000000000000000000000000000000000001',
})

console.log('User token reserve:', pool?.reserveUserToken)
// @log: User token reserve: 1000000000000000000000n
console.log('Validator token reserve:', pool?.reserveValidatorToken)
// @log: Validator token reserve: 1000000000000000000000n
console.log('Total supply:', pool?.totalSupply)
// @log: Total supply: 1000000000000000000000n
ts
import { createConfig, http } from 'wagmi'
import { tempo } from 'wagmi/chains'
import { tempoWallet } from 'wagmi/tempo'

export const config = createConfig({
  connectors: [tempoWallet()],
  chains: [tempo],
  multiInjectedProviderDiscovery: false,
  transports: {
    [tempo.id]: http(),
  },
})

Return Type ​

See TanStack Query query docs for more info hook return types.

data ​

See Wagmi Action amm.getPool Return Type

Parameters ​

See Wagmi Action amm.getPool Parameters

query ​

See the TanStack Query query docs for more info hook parameters.

Action ​

Released under the MIT License.