Skip to content
This repository was archived by the owner on Feb 25, 2023. It is now read-only.

Commit 8100a1d

Browse files
authored
Merge pull request #52 from CoinAlpha/development
release / v0.5.0 sync dev => master
2 parents 755e011 + bf7cc08 commit 8100a1d

21 files changed

+1971
-633
lines changed

.env.example

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ TERRA_CHAIN={testnet_chain_id}
2222
# Ethereum
2323
# - chain: mainnet, kovan, etc
2424
# - rpc url: infura or other rpc url
25+
# - token list: erc20 token list source (ref: https://tokenlists.org/)
2526
ETHEREUM_CHAIN={chain}
2627
ETHEREUM_RPC_URL=https://{chain}.infura.io/v3/{api_key}
28+
ETHEREUM_TOKEN_LIST_URL=https://wispy-bird-88a7.uniswap.workers.dev/?url=http://tokens.1inch.eth.link
2729

2830
# Balancer
2931
# subgraph_chain
@@ -41,7 +43,15 @@ EXCHANGE_PROXY={exchange_proxy}
4143

4244
# Uniswap
4345
# Reference: https://uniswap.org/docs/v2/smart-contracts/router02/
46+
# UniswapV2Router02 is deployed at 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D on the Ethereum mainnet, and the Ropsten, Rinkeby, Görli, and Kovan testnets.
47+
# It was built from commit 6961711.
4448
UNISWAP_ROUTER=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
49+
# allowed slippage for swap transactions
50+
UNISWAP_ALLOWED_SLIPPAGE=1.5
51+
# restrict updating pairs that have no reserves or failed for 5 minutes
52+
UNISWAP_NO_RESERVE_CHECK_INTERVAL=300000
53+
# cache info about pair for 1 second
54+
UNISWAP_PAIRS_CACHE_TIME=1000
4555

4656
# cert
4757
CERT_PATH={full_path_to_certs_folder}
@@ -51,5 +61,23 @@ CERT_PASSPHRASE={passphrase}
5161
# default to ./logs if path is not set
5262
LOG_PATH=/Users/hbot/hummingbot_files/hummingbot_logs
5363

54-
# GMT offset
55-
GMT_OFFSET=-0800
64+
# GMT offset for logging (alpine docker image default to UTC timezone)
65+
# -0800, -0500, +0200, +0800
66+
GMT_OFFSET=+0800
67+
68+
# EthGasStation
69+
# API key for defipulse.com gas station API
70+
# Gas level you want to use for Ethereum transactions (fast, fastest, safeLow, average)
71+
ENABLE_ETH_GAS_STATION=true
72+
ETH_GAS_STATION_API_KEY={apikey}
73+
ETH_GAS_STATION_GAS_LEVEL=fast
74+
ETH_GAS_STATION_REFRESH_TIME=60
75+
MANUAL_GAS_PRICE=100
76+
77+
# Balancer Config
78+
BALANCER_MAX_SWAPS=4
79+
80+
81+
# Perpetual Finance Provider URL
82+
# default: https://dai.poa.network , https://rpc.xdaichain.com, etc
83+
XDAI_PROVIDER={providerUrl}

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ RUN apk add --no-cache tzdata
55

66
# Set labels
77
LABEL application="gateway-api"
8+
LABEL branch=${BRANCH}
9+
LABEL commit=${COMMIT}
10+
LABEL date=${BUILD_DATE}
11+
12+
# Set ENV variables
13+
ENV COMMIT_BRANCH=${BRANCH}
14+
ENV COMMIT_SHA=${COMMIT}
15+
ENV BUILD_DATE=${DATE}
816

917
# app directory
1018
WORKDIR /usr/src/app

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@
1212
"test": "echo \"Error: no test specified\" && exit 1"
1313
},
1414
"dependencies": {
15-
"@perp/contract": "^1.0.6",
1615
"@balancer-labs/sor": "^0.3.3",
16+
"@perp/contract": "^1.0.6",
1717
"@terra-money/terra.js": "^0.5.8",
1818
"@uniswap/sdk": "^3.0.3",
1919
"app-root-path": "^3.0.0",
2020
"axios": "^0.21.1",
2121
"bignumber.js": "^9.0.0",
2222
"body-parser": "^1.19.0",
2323
"capture-console": "^1.0.1",
24+
"cross-fetch": "^3.0.6",
2425
"debug": "^4.2.0",
2526
"dotenv": "^8.2.0",
2627
"ethers": "^5.0.14",
@@ -29,11 +30,11 @@
2930
"helmet": "^4.1.1",
3031
"http-status-codes": "^2.1.3",
3132
"lodash": "^4.17.20",
33+
"mathjs": "^9.3.0",
3234
"moment": "^2.29.1",
3335
"util": "^0.12.3",
3436
"winston": "^3.3.3",
35-
"winston-daily-rotate-file": "^4.5.0",
36-
"cross-fetch": "^3.0.6"
37+
"winston-daily-rotate-file": "^4.5.0"
3738
},
3839
"devDependencies": {
3940
"@babel/core": "^7.11.6",
@@ -47,5 +48,8 @@
4748
"eslint-plugin-standard": "^4.0.1",
4849
"nodemon": "^2.0.4"
4950
},
51+
"engines": {
52+
"node": "10.x"
53+
},
5054
"type": "module"
5155
}

src/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ app.use(bodyParser.urlencoded({ extended: true }));
4040

4141
app.use(validateAccess)
4242

43-
// mount all routes to this path
44-
app.use('/uniswap', uniswapRoutes);
43+
// mount routes to specific path
4544
app.use('/api', apiRoutes);
4645
app.use('/eth', ethRoutes);
47-
// app.use('/celo', celoRoutes);
46+
app.use('/eth/uniswap', uniswapRoutes);
47+
app.use('/eth/balancer', balancerRoutes);
4848
app.use('/terra', terraRoutes);
49-
app.use('/balancer', balancerRoutes);
5049
app.use('/perpfi', perpFiRoutes);
50+
// app.use('/celo', celoRoutes);
5151

5252
app.get('/', (req, res, next) => {
5353
res.send('ok')

0 commit comments

Comments
 (0)