
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
swap-router-sdk
Advanced tools
Library that helps you ti find most profitable way to swap tokens on Tezos ecosystem.
Library that helps you ti find most profitable way to swap tokens on Tezos ecosystem.
Supported DEXes:
yarn add swap-router-sdk
TEZOS_DEXES_API_URL: string - url to the WebSocket server that returns list of available pairs and their liquidity
inputAssetSlug: string - slug (address_id || tez) of input token
outputAssetSlug: string - slug (address_id || tez) of desired output token
inputMutezAmount: BigNumber - number of input token (1 TEZ = 1 000 000 mutez)
outputMutezAmount: BigNumber - number of output token (1 TEZ = 1 000 000 mutez)
slippageTolerance: number | undefined - slippage tolerance percent
maxDepth?: number - maximal depth of search, which is equal to maximal route length. Default value is 3
receiverPublicKeyHash?: string - public key hash of swap output receiver. Default value is sender's public key hash
referralAddress?: string - the address of referral fees receiver for QuipuSwap curve-like DEXes
const allRoutePairs = useAllRoutePairs(TEZOS_DEXES_API_URL);
const routePairsCombinations = useRoutePairsCombinations(
inputAssetSlug,
outputAssetSlug,
allRoutePairs.data,
maxDepth
);
...
const bestTradeExactIn = getBestTradeExactInput(inputMutezAmount, routePairsCombinations);
const bestTradeExactOutput = getBestTradeExactOutput(outputMutezAmount, routePairsCombinations);
...
const bestTradeWithSlippageTolerance = useTradeWithSlippageTolerance(
inputMutezAmount,
bestTrade,
slippageTolerance
);
...
const tradeTransferParams = await getTradeOpParams(bestTradeWithSlippageTolerance, account.publicKeyHash, tezos, referralAddress, receiverPublicKeyHash);
const walletParamsWithKind = tradeTransferParams.map(transferParams => parseTransferParamsToParamsWithKind(transferParams));
FAQs
Library that helps you ti find most profitable way to swap tokens on Tezos ecosystem.
The npm package swap-router-sdk receives a total of 20 weekly downloads. As such, swap-router-sdk popularity was classified as not popular.
We found that swap-router-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.