Pure_mm HIP Order_amount_asymetric

Author : @Stelh

Original Post Date : 05/08/22

Category :
Dev Grants

Summary :
Add the possibility to choose the order_amount in quote

Current problem :
If we are in symetric order_amount (in base), if the market pump we are quickly out of inventory.

Solution :
We should leave the possibility to choose between an order_amount in BASE or in QUOTE .

There would be a secondary function, not obligatory , order_pct, which allows to sell more than what we buy, in %.

Example of parameter :

market : BTC-BUSD
asset_price : 100

bid_spread (in pct) : 1%
ask_spread (in pct) : 1%

order_amount_type : quote/base
order_amount : 10
order_pct : 0

Formula :

If “order_amount_type == quote” =>

buy_price = (asset_price - (asset_price * bid_spread) ) = 99
sell_price = (asset_price + (asset_price * ask_spread) ) = 101

buy_order_amount = order_amount / buy_price = 0.101

If “order_pct == 0” =>
sell_order_amount = order_amount / sell_price = 0.099

If “order_pct > 0” =>
sell_order_amount = (order_amount/ sell_price) + ( (order_amount/ sell_price)* order_pct ) = 0.1

This allows to buy 0.101 and sell 0.099, to accumulate for pumps

I can do a bounty and I would like to go through the foundation

Want to get some clarification on this improvement idea. I’m bit lost on the Formula section.

To implement “choose an order_amount in BASE or in QUOTE”, may be confusing.

Will it still work if the order amount be set separately at BID and ASK instead? Like say: ask_order_amount and bid_order_amount.

Asymmetric order_amount is useful feature that can allow us more flexibility in developing other strategies.

So, the above Formula section is actually like a strategy for accumulating for pumps, and will then be considered as use case for the feature.

If those assumptions above are correct, it may be better to do two separate improvement proposals. :clinking_glasses:

market : BTC (base) / BUSD (quote)

If we choose an order_amount_type in quote, then it will always put 10 BUSD, so the order_amount change with the price

Sorry, I misinterpreted the improvement feature. :thinking:

To summarize,

market : BTC/BUSD
asset_price : 100

bid_spread (in pct) : 0.01 (1%)
ask_spread (in pct) : 0.01 (1%)

order_amount_type : quote
order_amount : 10
order_pct : 0

In this case, the bot should always put 10 BUSD in order_amount.
To do this, we need to know the price of what we want to buy. To know the price, we need to know the bid_spread.

We also need to know the selling price, using the ask_spread.

Formula :

If “order_amount_type == quote” =>

buy_price = (asset_price - (asset_price * bid_spread) ) = 99
sell_price = (asset_price + (asset_price * ask_spread) ) = 101

buy_order_amount = order_amount / buy_price = 0.101

If “order_pct == 0” =>
sell_order_amount = order_amount / sell_price = 0.099

This allows to buy 0.101 and sell 0.099 , to accumulate for the upper range if it goes up.

order_pct is a function for advanced users only, which will allow to sell more (in %) than 10 BUSD (like IRA on Avellaneda)

If “order_pct > 0 ” =>
sell_order_amount = (order_amount/ sell_price) + ( (order_amount/ sell_price)* order_pct ) = 0.1

This allows to buy 0.101 and sell 0.1