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}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coin | Yes | ||
| dollar_amount | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||