eyeOne is a lightweight trading API built with Go and Gin. It provides endpoints for creating and managing orders, retrieving balances, and accessing order books. This project is designed for developers seeking a simple and extensible trading backend.
- Create Orders: Place new buy or sell orders with specified parameters.
- Cancel Orders: Remove existing orders using their unique identifiers.
- Retrieve Balances: Check the balance of specific assets.
- Access Order Books: View the current order book for trading pairs.
- RESTful API: Built with Gin for efficient HTTP request handling.
-
Clone the Repository:
git clone https://github.com/erfuuan/eyeOne.git cd eyeOne -
Set Up Environment Variables:
Create a
.envfile in the root directory and configure your environment variables as needed. -
Install Dependencies:
go mod tidy
-
Run the Application:
go run cmd/main.go
The server will start on
http://localhost:8080.
To deploy eyeOne using Docker, follow these steps:
docker build -f build/Dockerfile -t eyeone .docker run -d -p 3000:3000 --name eyeOne eyeOne:latest- Description: Place a new order.
- Response: Returns the order ID upon successful creation.
- Endpoint:
DELETE /order-book/:id - Description: Cancel an existing order by its ID.
- Parameters:
id: The unique identifier of the order to cancel.
- Response: Confirmation of order cancellation.
- Description: Retrieve the balance for a specific asset.
- Response: Returns the balance amount for the specified asset.
- Description: Fetch the order book for a trading pair.
- Response: Returns the current order book data for the specified symbol.
To facilitate testing, you can use the following Postman collection:
-
Import the Collection:
Download the
eyeOne.postman_collection.jsonfile from the repository. -
Open Postman:
Launch Postman and click on Import.
-
Import the File:
Select the downloaded
eyeOne.postman_collection.jsonfile to import the collection. -
Use the Endpoints:
The collection includes pre-configured requests for all API endpoints. Modify the request parameters as needed and send the requests to test the API.
