tapp_get_swap_estimate
Calculate the estimated input or output amount for a token swap on Tapp Exchange, specifying pool, token pair, direction, and amount type.
Instructions
Estimate the amount received or needed for a swap on Tapp Exchange
Input Schema
Name | Required | Description | Default |
---|---|---|---|
a2b | Yes | Swap direction - true for token at pair[0] to pair[1], false for pair[1] to pair[0] | |
amount | Yes | The amount for estimation (used as input or desired output depending on field) | |
field | No | Indicates if amount is an 'input' or 'output' amount (defaults to 'input') | |
pair | Yes | A tuple of token indexes to swap, e.g., [0, 1] means token at index 0 is being swapped for token at index 1 | |
poolId | Yes | The identifier of the pool |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"a2b": {
"description": "Swap direction - true for token at pair[0] to pair[1], false for pair[1] to pair[0]",
"type": "boolean"
},
"amount": {
"description": "The amount for estimation (used as input or desired output depending on field)",
"type": "number"
},
"field": {
"description": "Indicates if amount is an 'input' or 'output' amount (defaults to 'input')",
"enum": [
"input",
"output"
],
"type": "string"
},
"pair": {
"description": "A tuple of token indexes to swap, e.g., [0, 1] means token at index 0 is being swapped for token at index 1",
"items": {
"type": "number"
},
"type": "array"
},
"poolId": {
"description": "The identifier of the pool",
"type": "string"
}
},
"required": [
"amount",
"poolId",
"pair",
"a2b"
],
"type": "object"
}