calculate_token_amount_from_dollars
Calculate the number of tokens you can purchase for a given dollar amount on a specified trading pair like BTC, ETH, or SOL, and retrieve the current price.
Instructions
Calculate how many tokens can be bought with a given dollar amount
Args: coin: Trading pair (e.g., "BTC", "ETH", "SOL") dollar_amount: Dollar amount to spend (e.g., 20.0 for $20)
Returns: Dictionary with token amount and current price
Example: calculate_token_amount_from_dollars("SOL", 20.0) → {"token_amount": 0.133, "current_price": 150.0, "dollar_amount": 20.0}
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"coin": "<coin>",
"dollar_amount": "<dollar_amount>"
},
"name": "calculate_token_amount_from_dollars"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | ||
| dollar_amount | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||