From 5526f2995f2a4dfbd6f7aae5f721d5d2a274f945 Mon Sep 17 00:00:00 2001 From: AhmadYazdani Date: Sat, 3 Aug 2024 22:39:40 +0330 Subject: [PATCH] new [spectrum-ergo]: add documentation of ergo chain and spectrum connector --- docs/chains/ergo.md | 22 ++++++++++ docs/dex-connectors/index.md | 72 +++++++++++++++---------------- docs/exchanges/spectrum.md | 84 ++++++++++++++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 36 deletions(-) create mode 100644 docs/chains/ergo.md create mode 100644 docs/exchanges/spectrum.md diff --git a/docs/chains/ergo.md b/docs/chains/ergo.md new file mode 100644 index 00000000..8a034ad0 --- /dev/null +++ b/docs/chains/ergo.md @@ -0,0 +1,22 @@ +# `ergo` + +`ergo` is a [Chain](/chains) connector in Hummingbot Gateway that helps users connect to DEXs on various networks on the ergo blockchain. + +## πŸ“ Connector Info + +- Folder: [/gateway/src/chains/ergo](https://github.com/hummingbot/gateway/tree/main/src/chains/ergo) +- Configs: [/gateway/src/templates/ergo.yml](https://github.com/hummingbot/gateway/tree/main/src/templates/ergo.yml) + +## ℹ️ Chain Info + +- Website: https://ergoplatform.org/ +- Block Explorer: https://explorer.ergoplatform.com/ +- CoinMarketCap: https://coinmarketcap.com/currencies/ergo/ +- CoinGecko: https://www.coingecko.com/en/coins/ergo + +## πŸ•ΈοΈ Supported Networks + +| Network | ChainId | Type | +| --------- | --------- | ------- | +| `mainnet` | `mainnet` | mainnet | +| `testnet` | `testnet` | testnet | diff --git a/docs/dex-connectors/index.md b/docs/dex-connectors/index.md index 54da48b1..16b0440b 100644 --- a/docs/dex-connectors/index.md +++ b/docs/dex-connectors/index.md @@ -2,8 +2,8 @@ Decentralized exchange (DEX) connectors integrate into a decentralized or non-cu There are two types of DEX connectors in Hummingbot: -* **Client**: Connectors that integrate to a DEX's WebSocket/REST API directly from the Hummingbot client -* **Gateway**: Connectors that integrateto a DEX's smart contract or Javascript/Typescript SDK the [Gateway](/gateway) module (REST) +- **Client**: Connectors that integrate to a DEX's WebSocket/REST API directly from the Hummingbot client +- **Gateway**: Connectors that integrateto a DEX's smart contract or Javascript/Typescript SDK the [Gateway](/gateway) module (REST) We recommend that Central Limit Order Book (CLOB) exchanges utilize direct client connectors for improved speed and simplicity, while Automated Market Maker (AMM) exchanges should use Gateway as it is designed to interface with smart contracts. @@ -21,42 +21,42 @@ Client DEX connectors should conform to the latest `spot` and `perp` connector s For Gateway DEX connectors to be compatible with Hummingbot strategies, they need to support the API endpoints required by the connector classes listed in [`/hummingbot/hummingbot/connector/gateway`](https://github.com/hummingbot/hummingbot/tree/master/hummingbot/connector/gateway): -* `amm` -* `amm_lp` -* `amm_perpetual` -* `clob_perp` -* `clob_spot` +- `amm` +- `amm_lp` +- `amm_perpetual` +- `clob_perp` +- `clob_spot` ## List of DEX Connectors Here are the current DEX connectors in the codebase: -| Exchange | Type | Connection | Connector Guide | -|----------|------|------------|---| -| [dYdX](../exchanges/dydx.md) | CLOB | Client | -| [Hyperliquid](../exchanges/hyperliquid.md) | CLOB | Client | [Guide](/academy-content/using-hyperliquid-vaults-with-hummingbot) -| [Injective Helix](../exchanges/injective.md) | CLOB | Client | -| [Polkadex](../exchanges/polkadex.md) | CLOB | Client | [Guide](/academy-content/using-polkadex-with-hummingbot) -| [Vega](../exchanges/vega.md) | CLOB | Client | [Guide](/academy-content/using-vega-protocol-with-hummingbot) -| [Vertex](../exchanges/vertex.md) | CLOB | Client | -| [Dexalot](../exchanges/dexalot.md) | CLOB | Gateway | [Guide](/academy-content/using-dexalot-with-hummingbot) -| [XRP Ledger](../exchanges/xrpl.md) | CLOB | Gateway | -| [Curve](../exchanges/curve.md) | AMM | Gateway | -| [Balancer](../exchanges/balancer.md) | AMM | Gateway | -| [Mad Meerkat](../exchanges/mad-meerkat.md) | AMM | Gateway | -| [OpenOcean](../exchanges/openocean.md) | AMM | Gateway | -| [Osmosis](../exchanges/osmosis.md) | AMM | Gateway | [Guide](/academy-content/using-osmosis-with-hummingbot) -| [Pancakeswap](../exchanges/pancakeswap.md) | AMM | Gateway | -| [Pangolin](../exchanges/pangolin.md) | AMM | Gateway | -| [Plenty](../exchanges/plenty.md) | AMM | Gateway | -| [Perpetual Protocol](../exchanges/perp.md) | AMM | Gateway | -| [Quickswap](../exchanges/quickswap.md) | AMM | Gateway | -| [Ref Finance](../exchanges/ref.md) | AMM | Gateway | -| [Sushiswap](../exchanges/sushiswap.md) | AMM | Gateway | -| [Tinyman](../exchanges/tinyman.md) | AMM | Gateway | -| [TraderJoe](../exchanges/traderjoe.md) | AMM | Gateway | -| [Uniswap](../exchanges/uniswap.md) | AMM | Gateway | -| [VVS Finance](../exchanges/vvs.md) | AMM | Gateway | -| [XSwap](../exchanges/xswap.md) | AMM | Gateway | -| [Carbon](../exchanges/carbon.md) | AMM | Gateway | - +| Exchange | Type | Connection | Connector Guide | +| -------------------------------------------- | ---- | ---------- | ------------------------------------------------------------------ | +| [dYdX](../exchanges/dydx.md) | CLOB | Client | +| [Hyperliquid](../exchanges/hyperliquid.md) | CLOB | Client | [Guide](/academy-content/using-hyperliquid-vaults-with-hummingbot) | +| [Injective Helix](../exchanges/injective.md) | CLOB | Client | +| [Polkadex](../exchanges/polkadex.md) | CLOB | Client | [Guide](/academy-content/using-polkadex-with-hummingbot) | +| [Vega](../exchanges/vega.md) | CLOB | Client | [Guide](/academy-content/using-vega-protocol-with-hummingbot) | +| [Vertex](../exchanges/vertex.md) | CLOB | Client | +| [Dexalot](../exchanges/dexalot.md) | CLOB | Gateway | [Guide](/academy-content/using-dexalot-with-hummingbot) | +| [XRP Ledger](../exchanges/xrpl.md) | CLOB | Gateway | +| [Curve](../exchanges/curve.md) | AMM | Gateway | +| [Balancer](../exchanges/balancer.md) | AMM | Gateway | +| [Mad Meerkat](../exchanges/mad-meerkat.md) | AMM | Gateway | +| [OpenOcean](../exchanges/openocean.md) | AMM | Gateway | +| [Osmosis](../exchanges/osmosis.md) | AMM | Gateway | [Guide](/academy-content/using-osmosis-with-hummingbot) | +| [Pancakeswap](../exchanges/pancakeswap.md) | AMM | Gateway | +| [Pangolin](../exchanges/pangolin.md) | AMM | Gateway | +| [Plenty](../exchanges/plenty.md) | AMM | Gateway | +| [Perpetual Protocol](../exchanges/perp.md) | AMM | Gateway | +| [Quickswap](../exchanges/quickswap.md) | AMM | Gateway | +| [Ref Finance](../exchanges/ref.md) | AMM | Gateway | +| [Sushiswap](../exchanges/sushiswap.md) | AMM | Gateway | +| [Tinyman](../exchanges/tinyman.md) | AMM | Gateway | +| [TraderJoe](../exchanges/traderjoe.md) | AMM | Gateway | +| [Uniswap](../exchanges/uniswap.md) | AMM | Gateway | +| [VVS Finance](../exchanges/vvs.md) | AMM | Gateway | +| [XSwap](../exchanges/xswap.md) | AMM | Gateway | +| [Carbon](../exchanges/carbon.md) | AMM | Gateway | +| [Spectrum](../exchanges/spectrum.md) | AMM | Gateway | diff --git a/docs/exchanges/spectrum.md b/docs/exchanges/spectrum.md new file mode 100644 index 00000000..e5437fbb --- /dev/null +++ b/docs/exchanges/spectrum.md @@ -0,0 +1,84 @@ +## πŸ›  Connector Info + +- **Exchange Type**: Decentralized Exchange (DEX) +- **Market Type**: Automatic Market Maker (AMM) + +| Component | Status | Notes | +| ------------------------------------------------ | --------- | ----- | +| [2️⃣ AMM Connector](#2-amm-connector) | βœ… | +| [3️⃣ Range AMM Connector](#3-range-amm-connector) | Not built | +| [πŸ•― AMM Data Feed](#amm-data-feed) | βœ… | + +## ℹ️ Exchange Info + +- **Website**: +- **CoinMarketCap**: +- **CoinGecko**: + +## πŸ”‘ How to Connect + +add following environment variables to the hummingBot project before starting: + +``` +COINGECKO_URL=https://pro-api.coingecko.com/api/v3 + +COINGECKO_API_KEY=YOUR_API_KEY +``` + +Create a wallet on one of the supported networks below: + +| Chain | Networks | +| ------ | --------- | +| `ergo` | `mainnet` | +| `ergo` | `testnet` | + +From inside the Hummingbot client, run `gateway connect spectrum` in order to connect your wallet: + +``` +Which chain do you want spectrum to connect to? (ergo) >>> +Which network do you want spectrum to connect to? (mainnet) >>> +Do you want to continue to use node url 'http://213.239.193.208:9053/' for ergo-mainnet? (Yes/No) >>> +Enter your ergo-mainnet private key >>> +``` + +If connection is successful: + +``` +The spectrum connector now uses wallet [pubKey] on ergo-mainnet +``` + +## 2️⃣ AMM Connector + +_Integration to this DEX's swap pricing and execution endpoints_ + +- **ID**: `spectrum` +- **Connection Type**: REST via [Gateway](/gateway) +- **Folder**: +- **Default Configs**: + +### Endpoints + +- `/amm/price` +- `/amm/trade` +- `/amm/estimateGas` + +For more info, run Gateway and go to in your browser to see detailed documentation for each endpoint. + +## πŸ•― AMM Data Feed + +_Data feed of this exchange's real-time prices_ + +- **ID**: `spectrum_[CHAIN]_[NETWORK]` +- **Connection Type**: REST via [Gateway](/gateway) +- **Folder**: + +### Usage + +```python +from hummingbot.data_feed.amm_gateway_data_feed import AmmGatewayDataFeed +prices = AmmGatewayDataFeed( + connector_chain_network="spectrum_ergo_mainnet", + trading_pairs={"ERG-USDT", "ERG-SigUSD"}, + order_amount_in_base=Decimal("1"), + ) +```