Skip to main content

Estimating output & fees

Every flow has an estimate method. Estimates return the expected output, the minimum input, and a full fee breakdown.

MethodDirection
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

FieldMeaning
inputAmountBTC / inputAmountThe input amount (BTC, or token smallest unit)
outputAmount / outputAmountBTCThe expected output
minInputAmountBTCMinimum input the protocol will process
teleswapFeeFee breakdown (see below)
internalExchangeThe AMM route used
internalBridgeCross-chain bridge hop — may be undefined

Fee breakdown (teleswapFee)

ComponentDescription
networkFeeBTCBitcoin / gas network fee
protocolFeeBTCProtocol fee
lockerFeeBTCFee paid to the locker
thirdPartyFeeBTCIntegrator fee (if a thirdPartyId is set)
totalFeeBTCSum 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.