rift_preview_exchange_rate
Preview offramp or onramp exchange rates and fee breakdowns to see fiat received or USDC needed before converting.
Instructions
Preview exchange rate. IMPORTANT: offramp and onramp rates are DIFFERENT — always set type correctly.
Rate fields explained:
buying_rate = OFFRAMP/withdrawal rate — fiat per USDC when cashing out. Multiply USDC × buying_rate to get fiat the user receives.
selling_rate = ONRAMP/deposit rate — fiat per USDC when buying crypto. User pays this much fiat per USDC.
To show a user's balance in local fiat: USDC balance × buying_rate. To show how much USDC they get for fiat: fiat amount / selling_rate.
Pass an amount to get feeBreakdown with exact fee, feePercentage, userReceivesFiat, and totalUsdcNeeded.
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": {
"currency": "<currency>",
"type": "<type>"
},
"name": "rift_preview_exchange_rate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | MUST match operation: 'offramp' = selling crypto, 'onramp' = buying crypto | |
| amount | No | Amount in USDC to preview | |
| currency | Yes | Fiat currency: KES, NGN, UGX, GHS, ETB, CDF, TZS, MWK, BRL |