GetReserves

Uniswap Action Plugin - GetReserves

Description

Given an output asset amount and an array of token addresses, calculates all preceding minimum input token amounts

Method

getReserves()

Input Parameters

NamePlugin TypeDescription

to

FctAddress

Uniswap V2 Pair

Method Parameters

No method parameters required

Returned Values

NamePlugin TypeDescription

reserve0

FctValue

First reserve in the pool

reserve1

FctValue

Second reserve in the pool

Example

Example with initParams

const getReserves = new Uniswap.getters.GetReserves({
 chainId: 1,
 initParams: {
   to: "0x..." // Uniswap V2 Pair
 }
})

Example without initParams

const getReserves = new Uniswap.getters.GetReserves({ 
  chainId: 1
})

getReserves.input.set({
   to: "0x..." // Uniswap V2 Pair
})

Learn more

Learn more about Uniswap get reserves function here

Last updated