Skip to content

Commit

Permalink
clean up README
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtality committed Feb 7, 2023
1 parent 9d58415 commit 465013c
Showing 1 changed file with 30 additions and 48 deletions.
78 changes: 30 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,31 @@

# Hummingbot Gateway

---

Hummingbot Gateway is a REST API that exposes connections to various blockchains (wallet, node & chain interaction) and decentralized exchanges (pricing, trading & liquidity provision). It is written in Typescript and takes advantage of existing blockchain and DEX SDKs. The advantage of using gateway is it provideds a programming language agnostic approach to interacting with blockchains and DEXs.

Gateway may be used alongside the main Hummingbot client to enable trading on DEXs, or as a standalone module by external developers.
Gateway may be used alongside the main [Hummingbot client](https://github.com/hummingbot/hummingbot) to enable trading on DEXs, or as a standalone module by external developers.

## Install and run locally

```bash
# Install dependencies
yarn

# Complile Typescript into JS
$ yarn build

# Generate the config files and edit as needed, especially server.yml
$ setup/generate_conf.sh

# Start the server using the passphrase you used to generate the certs in Hummingbot
$ yarn start --passphrase=<passphrase>
```

## Connectors
## Documentation

This is a list of DEX connections currently supported by Gateway.
See the [official Gateway docs](https://docs.hummingbot.org/gateway/).

| Connector | Blockchain | Trading Interface |
| ----------- | ------------------- | ----------------- |
| UniswapV2 | Ethereum | AMM |
| Sushiswap | Ethereum | AMM |
| UniswapV3 | Ethereum | EVM_Range_AMM |
| Pangolin | Avalanche | AMM |
| PancakeSwap | Binance Smart Chain | AMM |
| Traderjoe | Avalanche | AMM |
| Quickswap | Polygon | AMM |
| Perp | Ethereum | EVM_Perpetual |
| Mad Meerkat | Cronos | AMM |
| VVS | Cronos | AMM |
The API is documented using [Swagger](./docs/swagger). When Gateway is started, it also generates Swagger API docs at: https://localhost:8080


## Contributing
Expand All @@ -38,53 +41,32 @@ There are a number of ways to contribute to gateway.

- Vote on a [Snapshot proposal](https://snapshot.org/#/hbot.eth)

## Configuration

Before running gateway, you need to setup some configs. You can start by copying all of the yml files from [src/templates](./src/templates) to [conf](./conf). The format of this files are dictated by [src/services/config-manager-v2.ts](./src/services/config-manager-v2.ts) and the corresponding schema files in [src/services/schema](./src/services/schema) .
### Configuration

### Useful configuration options
- Edit `certs_path` in [conf/server.yml](./conf/server.yml) and enter the absolute path to the folder where Hummingbot stored the certificates it created with `gateway generate-certs`. You can also edit this config inside the Hummingbot client by running the command: `gateway config server.certs_path`.

- If you want to turn off `https`, set `unsafeDevModeWithHTTP` to `true` in [conf/server.yml](./conf/server.yml).

- If you gateway to log to standard out, set `logToStdOut` to `true` in [conf/server.yml](./conf/server.yml).

- Edit `certificatePath` in [conf/server.yml](./conf/server.yml). This can be generated by Hummingbot with `gateway generate-certs`.

The hummingbot client is also able to edit this config files.

## Install and run locally

Compile the Typescript code with `npm` or `yarn` .

```bash
yarn
yarn build
yarn dev --passphrase=<ssl-files-passphrase>
# the passphrase can be anything if unsafeDevModeWithHTTP is true
```

## Documentation

The API is documented using swagger: [gateway swagger docs](./docs/swagger). You can run the gateway swagger UI by starting gateway and visiting [localhost:8080](localhost:8080).
- If you want Gateway to log to standard out, set `logToStdOut` to `true` in [conf/server.yml](./conf/server.yml).

You can follow details about [trading interfaces](https://hummingbot.notion.site/Gateway-v2-Trading-Interfaces-482e2684d48c450ebcfff5401ba806aa)
- The format of configuration files are dictated by [src/services/config-manager-v2.ts](./src/services/config-manager-v2.ts) and the corresponding schema files in [src/services/schema](./src/services/schema).

Also, we maintain docs on the official website about gateway [here](https://hummingbot.org/protocols/gateway/).

### Files to read
### Architecture

Here are some files we recommend you look at in order to get familiar with the gateway code base.
Here are some files we recommend you look at in order to get familiar with the Gateway codebase:

- [src/services/ethereum-base.ts](./src/services/ethereum-base.ts) is a base class for EVM chains.
- [src/services/ethereum-base.ts](./src/services/ethereum-base.ts): base class for EVM chains.

- [src/connectors/uniswap/uniswap.ts](./src/connectors/uniswap/uniswap.ts) has functionality for interacting with Uniswap V2.
- [src/connectors/uniswap/uniswap.ts](./src/connectors/uniswap/uniswap.ts): functionality for interacting with Uniswap.

- [src/services/validator.ts](./src/services/validator.ts) defines functions for validating request payloads.
- [src/services/validator.ts](./src/services/validator.ts): defines functions for validating request payloads.


### Testing

When making a PR, there are unit test coverage requirements. Look at our [github workflow](../.github/workflows/workflow.yml) for the exact definition. There are some more
For a pull request merged into the codebase, it has to pass unit test coverage requirements. Take a look at [Workflow](../.github/workflows/workflow.yml) for more details.

#### Unit tests

Expand Down

0 comments on commit 465013c

Please sign in to comment.