https://github.com/stevendev0822/tonswap
A decentralized exchange (DEX) and automated market maker (AMM) built on the TON blockchain. It uses the Uniswap V2 curve to create liquidity pairs and allow users to swap tokens and provide liquidity to earn rewards.
https://github.com/stevendev0822/tonswap
fsharp typescript uniswap
Last synced: about 1 year ago
JSON representation
A decentralized exchange (DEX) and automated market maker (AMM) built on the TON blockchain. It uses the Uniswap V2 curve to create liquidity pairs and allow users to swap tokens and provide liquidity to earn rewards.
- Host: GitHub
- URL: https://github.com/stevendev0822/tonswap
- Owner: stevendev0822
- License: mit
- Created: 2024-09-24T18:53:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-04T06:15:42.000Z (over 1 year ago)
- Last Synced: 2025-04-09T19:49:15.475Z (about 1 year ago)
- Topics: fsharp, typescript, uniswap
- Language: TypeScript
- Homepage:
- Size: 96.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Tonswap - FunC Smart Contracts
## TonSwap is live on TON mainnet.
TonSwap is live on TON mainnet. TonSwap is in Beta, use at your own risk
## Overview
TonSwap is a DEX/AMM using the Uniswap V2 curve (a financial model shared by many popular AMMs like PancakeSwap, QuickSwap, Sushi) to create liquidity pairs and allow traders to swap tokens and liquidity providers to supply liquidity and earn rewards.
The project depends on an Jetton standard implementation for [Jetton](https://github.com/ton-blockchain/token-contract/tree/jettons/ft).
## Develop
run `npm install`
### Compile contract and run tests
This project depends on the executables **fift**, **func** . You can build them from [source](https://ton.org/docs/#/howto/getting-started), or you can download the [pre compiled binaries](https://github.com/ton-defi-org/ton-binaries/releases).
### Func Compiler
This project is using the latest func features such as `#include` and `const` so please use the latest func compiler ,
If you want to set an explicit func path you may use the FUNC_PATH environment variable `export FUNC_PATH=/usr/local/bin/func`
### Run tests
the project uses [ton-contract-executor](https://github.com/tonwhales/ton-contract-executor) package to run Jest based tests.
Use `npm run test` to execute the test suite.
### Run TVM-BUS tests
run `npm run test-bus`
this tests are different then the tests in `/test/amm-minter.spec.ts`,
Because this tests are using [ton-tvm-bus](https://github.com/ton-defi-org/ton-tvm-bus) , each tests starts in a single message, and the message passing between contracts is done automatically, messages with statInit are auto deployed , messages find their receiver automatically unlike in the first test suite.
### Run end to end test on Mainnet or Testnet
`npm run e2e` (this process will generate a deploy wallet during it`s execution)
### build for web
`npm run build:web` - this process will generate json files with hex value for the contract, both for `amm-minter.fc` and `amm-wallet.fc`;