A decentralized exchange (DEX) interface prioritizing seamless asset-to-bank conversions leveraging AI-assisted conversations and automated Soroban smart contracts on the Stellar network.
DEX-CHAT connects natural AI conversation flows with Stellar's fast blockchain technology to create an intuitive platform for cryptocurrency to fiat conversions. Users interact with an AI assistant that securely triggers smart contract interactions (utilizing Soroban) directly from the chat UI.
- AI-Powered Interface: Intelligent conversation flow with an AI assistant
- Fiat Offramp: Seamless conversions governed by Soroban smart contracts
- Real Bank Integration: Verification capabilities suited for fiat channels
- Mobile-Responsive Design: Optimized for all device sizes
- Stellar Wallet Integration: Connect via Freighter natively
- Real-time Portfolio: Live balance queries through the Stellar network
The project consists of two main components:
- Blockchain: Stellar (Soroban)
- Main Contract:
FiatBridge- Secure logic governing asset deposits/withdrawals - Language: Rust
- Framework: Soroban SDK
The FiatBridge contract exposes read-only views intended for operational dashboards.
-
get_accrued_fees(token: Address) -> i128Returns the total amount of fees currently accrued for the specified token that have not yet been withdrawn by the administrator. -
get_wq_depth() -> u64Returns the current number of withdrawal requests present in the withdrawal request queue. -
get_wq_oldest_queued_ledger() -> Option<u32>Returns the ledger sequence when the oldest currently-pending withdrawal request was queued. ReturnsNonewhen the queue is empty. -
get_wq_oldest_age_ledgers() -> Option<u32>Returns the age of the oldest currently-pending withdrawal request in units of ledgers, computed as:current_ledger_sequence - oldest_queued_ledger. ReturnsNonewhen the queue is empty.
- Framework: Next.js 15 with TypeScript
- Styling: Tailwind CSS
- Blockchain Integration:
@stellar/stellar-sdkand@stellar/freighter-api - Wallet Connection: Freighter extension integration
- AI Integration: AI assistant API
- Next.js 15.3.5 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Stellar SDK - Core Stellar network interaction
- Freighter API - Web3 Stellar wallet integration
- React Query - State management
- Rust - Smart contract implementation language
- Soroban SDK - Stellar's smart contract framework
- Cargo - Rust package manager
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- Rust & Cargo tooling +
wasm32-unknown-unknowntarget - Stellar CLI (for interacting with Soroban)
git clone https://github.com/leojay-net/DEX-CHAT.git
cd DEX-CHATcd stellar-contracts
# Build the smart contracts
cargo build --target wasm32-unknown-unknown --release
# Run tests
cargo testcd dex_with_fiat_frontend
# Install dependencies needed for Stellar connection
npm install
# Start the development server
npm run devThis repository uses Husky and lint-staged to run quick quality checks before each commit.
# from repository root
npm install
npm run prepare
# required once for Rust linting
rustup component add clippyWhat runs on pre-commit:
- Staged Rust files in
stellar-contracts/**/*.rs:cargo clippy --all-targets --all-features -- -D warnings - Staged TypeScript files in
dex_with_fiat_frontend/**/*.{ts,tsx}:eslint --max-warnings=0on staged files only
You can also run the same checks manually:
npm run precommit:clippy
npm run precommit:eslintContributions and feature reviews are welcome. Please open up an issue to raise bugs or feature requests!