Skip to content

StelTade/swaptrade-contract

Repository files navigation

SwapTrade

License: MIT Built with Soroban Language: Rust Status

Secure, transparent, and decentralized trading powered by Soroban on the Stellar network.

SwapTrade is an open-source decentralized exchange (DEX) smart contract suite built with Soroban, the smart contract platform for the Stellar network. It provides the core building blocks for creating, managing, and settling token trades in a secure and trustless environment while leveraging Stellar's fast settlement and low transaction costs.

Designed with modularity and extensibility in mind, SwapTrade serves as a foundation for developers building decentralized finance (DeFi) applications on Stellar. The project emphasizes security, transparency, and developer experience, making it suitable for contributors, auditors, and ecosystem builders alike.


Table of Contents

  • Introduction
  • Features
  • Architecture
  • Installation
  • Project Structure
  • Building the Contract
  • Running Tests
  • Deployment
  • Usage
  • Contributing
  • Security
  • Roadmap
  • FAQ
  • License

Why SwapTrade?

Traditional exchanges depend on centralized operators to custody assets and execute trades. SwapTrade replaces that model with Soroban smart contracts that execute trading logic directly on-chain.

With SwapTrade:

  • Assets remain under users' control until execution.
  • Trading rules are enforced by immutable smart contracts.
  • Every transaction is transparent and verifiable.
  • Developers can extend the protocol for new DeFi applications.
  • Anyone can integrate the contracts into wallets, marketplaces, or trading interfaces.

Features

Feature Description
🔄 Decentralized Trading Execute token trades directly through Soroban smart contracts.
🔐 Secure Execution Contract logic validates every trade before settlement.
⚡ Fast Settlement Leverages Stellar's efficient consensus for quick confirmations.
💸 Low Fees Designed for cost-effective on-chain trading.
🧩 Modular Design Contracts are easy to extend and integrate into other protocols.
📜 Transparent Every trade is recorded on-chain for public verification.
🧪 Fully Tested Comprehensive Rust unit and integration tests.
🌍 Open Source Community-driven development under the MIT License.

Architecture

SwapTrade follows a modular architecture that separates business logic into reusable components.

swaptrade/
├── contracts/
│   ├── swap/
│   ├── token/
│   └── shared/
│
├── src/
│   ├── storage.rs
│   ├── events.rs
│   ├── errors.rs
│   ├── authorization.rs
│   └── lib.rs
│
├── tests/
├── scripts/
├── Cargo.toml
└── README.md

Each module has a single responsibility, making the project easier to maintain, audit, and extend.


Installation

Prerequisites

Before getting started, install the following tools:

  • Rust (latest stable)
  • Cargo
  • Soroban CLI
  • Stellar CLI
  • Git

Verify your installation:

rustc --version
cargo --version
soroban --version
stellar --version

Clone the Repository

git clone https://github.com/your-org/swaptrade.git

cd swaptrade

Build the Contract

Compile the project:

cargo build --release

To build the WebAssembly artifact used for deployment:

cargo build \
    --target wasm32v1-none \
    --release

Project Structure

contracts/
│
├── swap/
│     Trading contract
│
├── shared/
│     Shared utilities
│
├── interfaces/
│     Public contract interfaces
│
├── token/
│     Token interactions
│
└── tests/
      Integration tests

The project follows common Rust workspace conventions to make development familiar for contributors already working within the Stellar ecosystem.

About

This is a swaptrade repository for contract

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors