joystream
joystream copied to clipboard
JOY Arb Hummingbot
- [x] Adapt
amm_arb
to accomodate only taker order on Uniswap (first market) ~ 2hrs - [x] Parameters adjustment ~ 2 hr
- [x] Build Errors ~ 2 hrs
- [x] update parameters
- [x] Deployment consideration
Parameters
Property | Description | Type | Default |
---|---|---|---|
strategy | Strategy name | string | "amm_joy_arb" |
amm_connector | DEX connector | string | Uniswap on Base |
amm_market | Token trading pair for AMM | string | $JOY/$USDT |
cex_connector | CEX connector | string | MEXC |
cex_market | Token trading pair for CEX | string | $JOY/USDT |
pool_id | Pool ID to interact with on the DEX | string | "" |
order_amount | Amount of base asset per order | decimal | None |
min_profitability | Minimum profitability for trade (%) | decimal | 1% |
amm_slippage_buffer | Buffer for slippage on AMM orders (%) | decimal | 1% |
debug_price_shim | Enable debug price shim for tests | boolean | False |
gateway_transaction_cancel_interval | After what time should blockchain transactions be cancelled if they are not included in a block | integer | 600 secs = 10 mins |
rate_oracle_enabled | Use rate oracle | boolean | True |
quote_conversion_rate | Fixed rate to convert quote assets | decimal | 1 |
Notes
- To speed up implementation we deliberately choose MEXC as reference CEX for price data
Deployment consideration
Order size
A small order size at the beginning is necessary to mitigate operational risks. This is also what JSG is doing.
We will start the deployment with very low trade size. On uniswap v3 is possible to do an arbitrarely small size. The gas fees (on Base) are very low as well (https://basescan.org/chart/gasprice)
When you submit an order on Uniswap your total size in usd is partly eroded by pool fees and gas fees that have total cost
total_cost_usd = gas_fee_usd + pool_fee * order_value_usd
and your net profit is net_profit = order_value_usd - total_cost_usd
. Applying the constraint of net_profit = min_profitability * order_value_usd
, with pool_fee = 3%
, gas_fee_usd = 0.004 USD
and min_profitability = 1%
you get order_value_usd = 0.00417 USD
as a minimum baseline
Trade frequency
At most one trade every 30s, this frequency is copied from JSG deployment rules of thumb.