Skip to content

Robeartt/bitforward

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitForward

BitForward is a decentralized trading platform built on the Stacks blockchain that enables users to create and manage forward contracts using STX (With the aim to use sBTC in the future) tokens. The platform features a modern UI for position management, real-time price updates, and automated position settlement.

Features

  • Create and manage forward positions with sBTC tokens
  • Real-time position monitoring and automated settlement
  • Support for both long and short leveraged positions
  • Position tracking across multiple blocks
  • Persistent storage for position data
  • Modern, responsive UI built with React and Tailwind CSS
  • Integration with Stacks Leather wallet for secure transactions

Prerequisites

  • Node.js (v20 or higher)
  • npm or yarn
  • A Stacks wallet (Leather Wallet recommended)
  • Access to Stacks testnet/devnet

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/bitforward.git
cd bitforward
  1. Install dependencies:
npm install
  1. Create a .env file in the root directory with the following variables:
NETWORK=devnet
CONTRACT_ADDRESS=your_contract_address
CONTRACT_OWNER_KEY=your_contract_owner_key
PORT=3000
  1. Start the development server:
npm run dev

Key Components

API Endpoints

Positions

  • POST /api/position/add - add a position
  • GET /api/positions - Get all active positions
  • GET /api/positions/delete - delete a position

Price Management

There are helper script in the bitforward-scripts directory to update the price

Configuration

The application can be configured to run on either the Stacks testnet or devnet. Update the NETWORK environment variable accordingly:

  • NETWORK=devnet for local development
  • NETWORK=testnet for testnet deployment

Development

  1. Start the backend server:
npm run dev
  1. Start the frontend development server:
npm run dev
  1. Access the application at http://localhost:3000

Building for Production

npm run build

The built files will be available in the dist directory.

Testing

npm run test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Stacks blockchain team
  • Hiro Wallet team
  • shadcn/ui for UI components

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •