STON.fi: The Ultimate Guide
  • How to use this guide and why stars
  • What is blockchain and cryptocurrency
  • What is DEX and how it works
  • What is a crypto wallet
  • How to create a TON wallet
  • Where to find your wallet address
  • How to connect your TON wallet to STON.fi
  • How to buy TON (Toncoin) in Telegram
  • How to swap (exchange) tokens on STON.fi
  • ★ Transaction parameters: what is price impact, exchange rate, blockchain fee, minimum received
  • ★ What is liquidity pool
  • ★ How to evaluate a liquidity pool (TVL, APR, trading volume)
  • ★ How to provide liquidity on STON.fi
  • ★ How to withdraw funds from a liquidity pool
  • ★ What is farming?
  • ★ How to farm on STON.fi
  • ★ How to withdraw funds from farming
  • ★ How to get referral fees from swaps?
  • ★★ Staking on STON.fi
  • ★★ Liquidity provision, farming, and staking — what's the difference?
  • ★★ Blockchain and DEX fees
  • ★★ Impermanent loss
  • ★★ How to create a new liquidity pool
  • ★★ How to add (import) your own token with a contract address
  • ★★ Liquidity pool types
  • ★★How to integrate Omniston into your React app
Powered by GitBook
On this page

★★How to integrate Omniston into your React app

Previous★★ Liquidity pool types

Last updated 3 days ago

Want to add powerful, decentralized swaps to your TON-based app? Omniston makes it surprisingly easy. This guide walks you through the essentials of integrating Omniston using the official React SDK.

What Is Omniston?

Omniston is a decentralized liquidity aggregation protocol built for the TON blockchain. It connects multiple DEXs and market makers into one unified system, ensuring your users always get the best possible price when swapping tokens. By routing trades through the most liquid paths using a Request-for-Quote (RFQ) mechanism, it handles the complexity of price discovery — so you don’t have to.

Who Should Integrate Omniston?

From wallets to DeFi platforms, Omniston unlocks functionality, efficiency, and new revenue streams:

  • Wallets & Portfolio Apps → Keep users in your app with in-wallet swaps and generate referral income.

  • Games & NFT Marketplaces → Let players convert tokens natively in the UI, driving more purchases and smoother UX.

  • DeFi dApps → Instantly aggregate liquidity and offer optimal prices — no need to manage multiple DEX APIs.

  • TON Startups → Accelerate development and offer DeFi-grade functionality from day one.

Now, let’s see how to bring it into your app.

🛠 Quick Start: 6 Steps to Integration

1. Install the SDK

Start by adding the SDK to your project:

pnpm install @ston-fi/omniston-sdk-react

This package includes all the React hooks and utilities you’ll need.

2. Wrap Your App with OmnistonProvider

In your app’s root component (e.g., _app.tsx or index.tsx), wrap your application with the provider:

import { OmnistonProvider } from "@ston-fi/omniston-sdk-react";

<OmnistonProvider apiUrl="wss://omni-ws.ston.fi">

{/* your app components */}

</OmnistonProvider>

This establishes the WebSocket connection to Omniston’s aggregation backend.

🧠 Pro Tip: No backend needed. The SDK handles blockchain comms and quote management via WebSocket — your integration stays lightweight and frontend-only.

3. Add TON Wallet Support

You can use TON Connect to integrate wallet connectivity:

pnpm install @tonconnect/ui-react

Then create a "Connect Wallet" button using TonConnect’s hooks. This allows users to approve transactions using familiar wallets like Tonkeeper or TON Space.

4. Request a Quote

Use Omniston’s hook useRfq to fetch swap quotes.

Omniston automatically routes through intermediate tokens if needed and returns the best available price.

🧠 Pro Tip: No pool for your token pair? No problem. Omniston uses smart routing to find paths through intermediary tokens — your users can swap any available tokens on TON.

5. Execute the Swap

Once the user confirms the quote, use the useOmniston hook to execute the transaction.

Omniston uses HTLC-based smart contracts to securely execute swaps on-chain.

🧠 Pro Tip: Omniston’s RFQ system locks in the rate before the user signs. No slippage surprises — users get exactly the rate they agreed to.

6. Track Swap Status (optional)

Use useTrackTrade to monitor the trade’s progress and update your UI accordingly. This is great for giving feedback to the user — for example, you might show a loading spinner until the trade is confirmed on-chain, then display a success message once tokens have swapped.

🔍 Want to Learn More?

You can fork the live Replit example and experiment instantly in the browser.


🧠 Pro Tip

Omniston supports revenue-sharing via referral fees. Set a referrer address in the swap request to earn a fee for each trade executed through your app.


Omniston abstracts away the complexity of blockchain-based token swaps and delivers a high-level SDK that feels just like any modern React library. Whether you're building a wallet, a game, or a full DeFi app — adding Omniston puts deep liquidity and smart routing in your hands with just a few lines of code.

🧠 Pro Tip: The SDK is fully open-source — if you want to dive deeper or customize the logic, the is a great place to start.

Demo App:

Quickstart Guide:

GitHub Repo:

GitHub repo
omniston.ston.fi
Omniston Guide
STON.fi Omniston SDK