MCPcopy Index your code
hub / github.com/0xblackbot/rainbow-swap

github.com/0xblackbot/rainbow-swap @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
459 symbols 1,092 edges 238 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rainbow 🌈

An open source repository for the Rainbow Swap frontend interface and smart contracts maintained by Blackbot. Rainbow Swap is an aggregator on TON 💎.

main banner

Interfaces

Socials / Contact

Problem

TON DEXes have fragmented liquidity, each with its own set of liquid tokens. As the TON ecosystem grows, this uneven distribution worsens, leading to inefficient trades and arbitrage opportunities. Users often lose money due to the high price impact when swapping tokens on a single DEX.

Solution

Rainbow Swap aggregates liquidity from multiple TON DEXes, distributing trade volume across optimal routes to minimize price impact and slippage. This ensures users get the best possible prices in a single transaction.

Examples

Not example USDT example

Results

Our user-friendly interface allows seamless swaps with the most efficient routes, considering swap distribution and gas costs. Swap now with our bot @rainbow_swap_bot and share your thoughts and suggestions in Community Chat! 🌈🚀

Development info

Getting Started

  1. Clone repository
git clone https://github.com/0xblackbot/rainbow-swap.git && cd rainbow-swap
  1. Install dependencies
yarn
  1. Start the development server
yarn start

Instructions for running the development application as TMA

Before opening a pull request, ensure the code passes all pipeline checks. You can run:

yarn ts
yarn lint

Smart contract

Rainbow routing wallet smart contract acts as a middleman, enabling seamless swaps between two different decentralized exchanges (DEXes) in a single transaction.
To guard against asset loss (there have been no such cases yet), it also allows users to withdraw GRAM or jettons, similar to a Jetton Wallet contract.

Events diagram:

smart contract events diagram

Smart contracts are written using FunC.
All code can be found in the contracts folder.

To build Rainbow routing wallet smart contract run

yarn build:contract

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Extension points exported contracts — how you extend this code

LottieProps (Interface)
(no doc)
src/components/lottie/lottie.props.ts
Props (Interface)
(no doc)
src/tonconnect/TonConnectUIProvider.tsx
Props (Interface)
(no doc)
src/assets/icons/XIcon/XIcon.tsx
LoadableEntityState (Interface)
(no doc)
src/store/types.ts
Props (Interface)
(no doc)
src/shared/tooltip/tooltip-icon.tsx
IconProps (Interface)
(no doc)
src/interfaces/icon-props.interface.ts
ModalsContextValues (Interface)
(no doc)
src/contexts/modals/modals.context.ts
Props (Interface)
(no doc)
src/components/trading-competition-modal/competition-info/competition-info.tsx

Core symbols most depended-on inside this repo

receiveWebViewEvent
called by 48
public/scripts/telegram-web-app.js
versionAtLeast
called by 45
public/scripts/telegram-web-app.js
createEntity
called by 35
src/store/utils/create-entity.ts
getClassName
called by 23
src/utils/style.utils.ts
trackButtonClick
called by 15
src/hooks/use-analytics.hook.ts
checkVersion
called by 14
public/scripts/telegram-web-app.js
formatNumber
called by 14
src/utils/format-number.utils.ts
invokeStorageMethod
called by 13
public/scripts/telegram-web-app.js

Shape

Function 376
Interface 72
Enum 5
Class 4
Method 2

Languages

TypeScript100%

Modules by API surface

public/scripts/telegram-web-app.js111 symbols
src/store/wallet/wallet-selectors.ts9 symbols
src/components/header/wallet-menu/wallet-menu.tsx9 symbols
src/utils/api.utils.ts6 symbols
src/store/settings/settings-selectors.ts6 symbols
src/components/swap-form/custom-input/custom-input.tsx6 symbols
src/store/wallet/wallet-epics.ts5 symbols
src/shared/tooltip/tooltip-icon.tsx5 symbols
src/components/swap-form/swap-form.tsx5 symbols
src/components/countdown/countdown.tsx5 symbols
src/store/swap-routes/swap-routes-selectors.ts4 symbols
src/store/assets/assets-selectors.ts4 symbols

For agents

$ claude mcp add rainbow-swap \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page