Estimating output & fees
Every flow has an estimate method. Estimates return the expected output, the minimum input, and a full fee breakdown.
| Method | Direction |
|---|---|
wrapAndSwapEstimate(amountBTC, networkName, outputToken?) | BTC → EVM/TON |
swapAndUnwrapEstimate(exchangeInfo, networkName) | EVM → BTC |
swapAndUnwrapEstimateTon(exchangeInfo) | TON → BTC |
Example: BTC → EVM/TON
const estimate = await sdk.wrapAndSwapEstimate(0.001, 'optimism', undefined);
{
"minInputAmountBTC": "0.000015015",
"inputAmountBTC": "0.001",
"outputAmount": "96628248",
"teleswapFee": {
"networkFeeBTC": "0.00001000",
"protocolFeeBTC": "0.00000000",
"lockerFeeBTC": "0.00000100",
"thirdPartyFeeBTC": "0.00000000",
"totalFeeBTC": "0.00001100"
},
"internalExchange": {
"path": "BTC-TELEBTC(polygon)->0x3c49...(polygon)",
"inputAmount": "98900",
"outputAmount": "96647357"
},
"internalBridge": {
"path": "0x3c49...(polygon)->0x8335...(base)",
"fee": "19109"
}
}
Response fields
| Field | Meaning |
|---|---|
inputAmountBTC / inputAmount | The input amount (BTC, or token smallest unit) |
outputAmount / outputAmountBTC | The expected output |
minInputAmountBTC | Minimum input the protocol will process |
teleswapFee | Fee breakdown (see below) |
internalExchange | The AMM route used |
internalBridge | Cross-chain bridge hop — may be undefined |
Fee breakdown (teleswapFee)
| Component | Description |
|---|---|
networkFeeBTC | Bitcoin / gas network fee |
protocolFeeBTC | Protocol fee |
lockerFeeBTC | Fee paid to the locker |
thirdPartyFeeBTC | Integrator fee (if a thirdPartyId is set) |
totalFeeBTC | Sum of all fees |
REST equivalents
POST /api/v2/teleswap/utils/wrap-and-swap-estimate,
.../swap-and-unwrap-estimate, .../swap-and-unwrap-estimate-ton. See the
API reference.