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.
- 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
- Node.js (v20 or higher)
- npm or yarn
- A Stacks wallet (Leather Wallet recommended)
- Access to Stacks testnet/devnet
- Clone the repository:
git clone https://github.com/yourusername/bitforward.git
cd bitforward- Install dependencies:
npm install- Create a
.envfile in the root directory with the following variables:
NETWORK=devnet
CONTRACT_ADDRESS=your_contract_address
CONTRACT_OWNER_KEY=your_contract_owner_key
PORT=3000- Start the development server:
npm run devPOST /api/position/add- add a positionGET /api/positions- Get all active positionsGET /api/positions/delete- delete a position
There are helper script in the bitforward-scripts directory to update the price
The application can be configured to run on either the Stacks testnet or devnet. Update the NETWORK environment variable accordingly:
NETWORK=devnetfor local developmentNETWORK=testnetfor testnet deployment
- Start the backend server:
npm run dev- Start the frontend development server:
npm run dev- Access the application at
http://localhost:3000
npm run buildThe built files will be available in the dist directory.
npm run testThis project is licensed under the MIT License - see the LICENSE file for details.
- Stacks blockchain team
- Hiro Wallet team
- shadcn/ui for UI components