Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/judevector/swap-dapp
This repository contains a Solana on-chain program, **Swap DApp**, implemented using the Anchor framework. The program facilitates secure token swapping through vault-based token handling and offer management.
https://github.com/judevector/swap-dapp
anchor escrow rust solana swap
Last synced: 30 days ago
JSON representation
This repository contains a Solana on-chain program, **Swap DApp**, implemented using the Anchor framework. The program facilitates secure token swapping through vault-based token handling and offer management.
- Host: GitHub
- URL: https://github.com/judevector/swap-dapp
- Owner: judeVector
- Created: 2024-12-08T15:12:41.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-08T15:20:02.000Z (about 1 month ago)
- Last Synced: 2024-12-08T16:20:36.775Z (about 1 month ago)
- Topics: anchor, escrow, rust, solana, swap
- Language: Rust
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Swap DApp
This repository contains a Solana on-chain program, **Swap DApp**, implemented using the Anchor framework. The program facilitates secure token swapping through vault-based token handling and offer management.
## Features
- **Make Offer**:
- Create a new token swap offer.
- Lock the offered tokens in a secure vault.- **Take Offer**:
- Accept and fulfill an existing token swap offer.
- Exchange tokens securely between the maker and taker.## Program Workflow
### 1. Make an Offer
The `MakeOffer` instruction allows a user (maker) to:
- Create a new swap offer with specific token requirements.
- Lock the offered tokens in a vault.**Key Functions:**
- `send_offered_tokens_to_vault`: Transfers tokens from the maker to the vault.
- `save_offer`: Stores offer details on-chain.### 2. Take an Offer
The `TakeOffer` instruction allows another user (taker) to:
- Accept and fulfill an existing swap offer.
- Exchange tokens and handle vault operations.**Key Functions:**
- `send_wanted_token_to_maker`: Transfers tokens from the taker to the maker.
- `withdraw_and_close_vault`: Withdraws tokens from the vault to the taker and closes the offer.## Technology Stack
- **Rust**: High-performance programming language for Solana smart contracts.
- **Anchor**: Framework for building efficient and secure Solana programs.
- **Token Program**: SPL token standard for token management.