Quipuswap
Searchโ€ฆ
get_reserves
This on-chain view returns reserves (token A and token B) in a specific liquidity pool (pair). Also can return a list of responses for a list of requests.

Call parameters

type token_id_t is nat
โ€‹
type reserves_req_t is token_id_t
โ€‹
list(reserves_req_t)
Field
Type
Description
reserves_req_t
token_id_t (nat)
Pair ID for which you need to get reserves

Return type

type token_id_t is nat
โ€‹
type reserves_t is [@layout:comb] record [
token_a_pool : nat;
token_b_pool : nat;
]
โ€‹
type reserves_req_t is token_id_t
โ€‹
type reserves_res_t is [@layout:comb] record [
request : reserves_req_t;
reserves : reserves_t;
]
โ€‹
list(reserves_res_t)

reserves_t

Field
Type
Description
token_a_pool
nat
Amount of token A in the liquidity pool (pair)
token_b_pool
nat
Amount of token B in the liquidity pool (pair)

reserves_res_t

Field
Type
Description
request
reserves_req_t (nat)
Pair ID for which you need to get a reserves
reserves
โ€‹reserves_tโ€‹
Reserves of tokens in a liquidity pool (pair)

Usage

๐ŸŒฎ Taquito
const dexCoreAddress = "KT1...";
const params = [0, 1, 15];
const viewCaller = "tz1...";
const dexCore = await tezos.contract.at(dexCoreAddress);
const reserves = await dexCore.contract.contractViews.get_reserves(params).executeView({ viewCaller: viewCaller });

Errors

  • 108 - pair (pool) with the specified token_id not listed.
Copy link
On this page
Call parameters
Return type
Usage
Errors