get_toks_per_share
This on-chain view returns amount of token A and token B for the specified amount of LP tokens in a specific liquidity pool (pair). Also can return a list of responses for a list of requests.
Call parameters
Field | Type | Description |
---|---|---|
pair_id | token_id_t (nat) | Pair ID for which you need to get tokens amount per shares |
shares_amt | nat | Amount of shares to get info about tokens |
Return type
toks_per_shr_req_t
Field | Type | Description |
---|---|---|
pair_id | token_id_t (nat) | Pair ID for which you need to get tokens amount per shares |
shares_amt | nat | Amount of shares to get info about tokens |
toks_per_shr_t
Field | Type | Description |
---|---|---|
token_a_amt | nat | Amount of tokens A per shares |
token_b_amt | nat | Amount of tokens B per shares |
toks_per_shr_res_t
Field | Type | Description |
---|---|---|
request | Tokens per shares request | |
tokens_per_share | Tokens per shares response |
Usage
Errors
108
- pair (pool) with the specifiedtoken_id
not listed.109
- pair doesn't have a liquidity.
Last updated