{"id":36684784,"url":"https://github.com/vitwit/cw-otc-dex","last_synced_at":"2026-01-12T11:11:56.409Z","repository":{"id":225307890,"uuid":"765544898","full_name":"vitwit/cw-otc-dex","owner":"vitwit","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-08T11:20:12.000Z","size":68517,"stargazers_count":0,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-08T11:27:39.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitwit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-01T06:05:38.000Z","updated_at":"2024-11-08T10:30:21.000Z","dependencies_parsed_at":"2024-04-17T10:47:06.042Z","dependency_job_id":"2b099578-5953-46fb-bcc2-30d3a86e08be","html_url":"https://github.com/vitwit/cw-otc-dex","commit_stats":null,"previous_names":["anilcse/dotc","vitwit/dotc","vitwit/cw-otc-dex"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vitwit/cw-otc-dex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitwit%2Fcw-otc-dex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitwit%2Fcw-otc-dex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitwit%2Fcw-otc-dex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitwit%2Fcw-otc-dex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitwit","download_url":"https://codeload.github.com/vitwit/cw-otc-dex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitwit%2Fcw-otc-dex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-12T11:11:53.131Z","updated_at":"2026-01-12T11:11:56.403Z","avatar_url":"https://github.com/vitwit.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# cosmos-otc-platform 🌟\n\nA decentralized Over-The-Counter (OTC) trading platform built with CosmWasm. This smart contract enables secure, transparent, and efficient OTC trading of tokens with customizable discount rates and bidding mechanisms.\n\n## Features 🚀\n\n- **Flexible Deal Creation**: Sellers can create OTC deals with:\n  - Custom token selection\n  - Configurable discount percentages\n  - Minimum price protection\n  - Minimum cap requirements\n  - Customizable bidding timeframes\n\n- **Advanced Bidding System**:\n  - Buyers can place bids with desired quantities\n  - Maximum price protection for buyers\n  - Real-time bid updates and withdrawals\n  - Automatic bid sorting by discount rates\n\n- **Secure Deal Settlement**:\n  - Automatic deal conclusion at specified time\n  - Fair distribution prioritizing lowest discount bids\n  - Automatic refunds for unsuccessful bids\n  - Platform fee management\n\n## Prerequisites 📋\n\n- Rust 1.63.0+\n- [wasmd](https://github.com/CosmWasm/wasmd) 0.30.0+\n- [cargo-generate](https://github.com/cargo-generate/cargo-generate)\n\n## Installation 🛠️\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/cosmos-otc-platform\ncd cosmos-otc-platform\n\n# Compile the contract\ncargo build\n\n# Run tests\ncargo test\n\n# Generate Wasm binary\ncargo wasm\n```\n\n## Usage 📝\n\n### Creating an OTC Deal\n\n```rust\nlet msg = ExecuteMsg::CreateDeal {\n    sell_token: \"token_address\",\n    total_amount: Uint128::new(1000000),\n    min_price: Uint128::new(100),\n    discount_percentage: 10,\n    min_cap: Uint128::new(500000),\n    bid_start_time: 1234567890,\n    bid_end_time: 1234657890,\n    conclude_time: 1234747890,\n};\n```\n\n### Placing a Bid\n\n```rust\nlet msg = ExecuteMsg::PlaceBid {\n    deal_id: 1,\n    amount: Uint128::new(100000),\n    discount_percentage: 5,\n    max_price: Some(Uint128::new(110)),\n};\n```\n\n## Contract Architecture 🏗️\n\n```\nsrc/\n├── lib.rs          # Entry point\n├── contract.rs     # Core contract logic\n├── msg.rs         # Message definitions\n├── state.rs       # State management\n├── error.rs       # Error handling\n└── helpers.rs     # Utility functions\n```\n\n## Testing 🧪\n\n```bash\n# Run all tests\ncargo test\n\n# Run specific test\ncargo test test_create_deal\n```\n\n## Security Considerations 🔒\n\n- All monetary operations are atomic\n- Time-based validations prevent premature or late actions\n- Minimum price protection for sellers\n- Maximum price protection for buyers\n- Automatic refund mechanism\n- Platform fee validation\n\n## Contributing 🤝\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## Contact 📧\n\nAnil - [@anilcse](https://twitter.com/anilcse_)\n\nProject Link: [https://github.com/vitwit/cw-otc-dex](https://github.com/vitwit/cw-otc-dex)\n\n## Acknowledgments 🙏\n\n- CosmWasm team for the amazing smart contract platform\n\n---\nMade with ❤️ for the Cosmos ecosystem","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitwit%2Fcw-otc-dex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitwit%2Fcw-otc-dex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitwit%2Fcw-otc-dex/lists"}