Inventory Skew – Hummingbot Foundation



Updated as of v0.29.0

This feature lets you set and maintain a target inventory split between the base and quote assets. It prevents your overall inventory level from changing too much and may result in more stable performance in volatile markets.

inventory_skew_enabled

Allows the user to set and maintain a target inventory split between base and quote assets.

Prompt:

Would you like to enable inventory skew? (Yes/No)
>>> Yes

inventory_target_base_pct

Target amount held of the base asset, expressed as a percentage of the total base and quote asset value.

Prompt:

On [exchange], you have [base_asset_balance] and [quote_asset_balance]. By market value, your current inventory split is [base_%_ratio] and [quote_%_ratio]. Would you like to keep this ratio?
>>> Yes

inventory_range_multiplier

This expands the range of tolerable inventory level around your target base percent, as a multiple of your total order size. Larger values expand this range.

Prompt:

What is your tolerable range of inventory around the target, expressed in multiples of your total order size?
>>>

How it works

This function adjusts the bid and ask order amounts to limit the user’s trading exposure within a defined range. This prevents the user from being over-exposed from the risks of a single side of the trade when the market keeps hitting limit orders on one side only.

Note

Example: You are market making for the BTC-USDT pair and have 0.667 BTC and 6000 USDT. At $6000 BTC price, your total portfolio value is $10,000 and the base asset (BTC) accounts for 40% of total value. If your target base percent is 50%, your buy orders will be increased and your sell orders will be decreased until you reach the target percent.

The user specifies a target base asset percentage. Since the user’s outstanding orders may change this split if they are filled, the total order size is used to define an allowable range around this target percentage. The user may expand or contract this range via a multiplier parameter.

Note

Example: You are market making for the BTC-USDT pair and the total value of your BTC/USDT inventory is 10 BTC. Your target base percent is 50% and each set of orders you place is 1 BTC (10% of your total portfolio). With inventory_range_multiplier of 1.00, your target range is 40% to 60%. With inventory_range_multiplier of 2.00, your target range is 30% to 70%.

If the user’s base asset value goes above the upper limit, then no bid orders would be emitted. Conversely, if the user’s base asset value goes below the lower limit, then no ask orders would be emitted.

Sample configurations

The three bots below all share this base configuration:

- market: BTC-USDT
- bid_spread: 1
- ask_spread: 1
- order_amount: 0.002
- order_levels: 3
- order_level_amount: 0.002
- order_level_spread: 1

No inventory skew

- inventory_skew_enabled: False

inventory skew

Without inventory skew, order amounts are always symmetrical between buy (outlined in green) and sell orders (outlined in red).

Inventory skew, multiplier = 1

- inventory_skew_enabled: True
- inventory_target_base_pct: 50
- inventory_range_multiplier: 1.0

inventory skew

Since the current inventory range of each asset is within the target range (8.7% – 91.3%), both buy and sell orders are placed. However, more buy orders will be created with larger order amounts than the sell order amounts.

Inventory skew, multiplier = 0.5

- inventory_skew_enabled: True
- inventory_target_base_pct: 50
- inventory_range_multiplier: 0.5

inventory skew

By decreasing the range multiplier to 0.5, the target range tightens (29.4% to 70.6%). Since the current inventory percentage (25.0% and 75%) falls off the range, only buy orders are placed until the inventory split is within range.

Inventory skew with balance limit

Starting with version 0.30.0, a limit can be applied to the total balance to allocate how much the bot can access in an exchange or wallet. With inventory skew, Hummingbot will maintain a target balance with respect to the allowable asset.

- inventory_skew_enabled: True
- inventory_target_base_pct: 50
- inventory_range_multiplier: 1.0

Without balance limit

The image below shows our total balance is around $200. To maintain a 50-50 ratio based on inventory_target_base_pct, the target shows a value of around $100 for the base and quote asset.

inventory skew

With balance limit

binance:
      Asset       Amount        Limit
       USDC     105.6335      50.0000
       USDT     105.7188      50.0000

Let’s say we put a $50 limit on both USDC and USDT which makes our total usable assets to $100. Notice that the target amount is now at $50 for both sides which means, inventory skew works with respect to the total balance limit.

Order size calculation math

The input order_amount in single-order mode, or its equivalent in multiple-order mode, is adjusted linearly by comparing the percentage of the base asset in the overall trading portfolio vs. the target base asset ratio.

The mathematics operations is as follows.

inventory skew maths


Last update:
2021-12-15

This Post Has 41 Comments

  1. Reading your article helped me a lot and I agree with you. But I still have some doubts, can you clarify for me? I’ll keep an eye out for your answers.

  2. 20bet

    Your article gave me a lot of inspiration, I hope you can explain your point of view in more detail, because I have some doubts, thank you.

  3. Tree Mail

    I loved even more than you will get done right here. The picture is nice, and your writing is stylish, but you seem to be rushing through it, and I think you should give it again soon. I’ll probably do that again and again if you protect this walk.

  4. tvbrackets

    Hello Neat post Theres an issue together with your site in internet explorer would check this IE still is the marketplace chief and a large element of other folks will leave out your magnificent writing due to this problem

  5. best iptv in uk

    Wonderful web site Lots of useful info here Im sending it to a few friends ans additionally sharing in delicious And obviously thanks to your effort

  6. bestiptvireland

    Just wish to say your article is as surprising The clearness in your post is just cool and i could assume youre an expert on this subject Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post Thanks a million and please keep up the enjoyable work

  7. Szpiegowskie Telefonu

    Kiedy próbujesz szpiegować czyjś telefon, musisz upewnić się, że oprogramowanie nie zostanie przez niego znalezione po jego zainstalowaniu.

  8. Szpiegowskie Telefonu

    Możesz używać oprogramowania do zarządzania rodzicami, aby kierować i nadzorować zachowanie dzieci w Internecie. Za pomocą 10 najinteligentniejszych programów do zarządzania rodzicami możesz śledzić historię połączeń dziecka, historię przeglądania, dostęp do niebezpiecznych treści, instalowane przez nie aplikacje itp.

  9. Szpiegowskie telefonu – Ukryta aplikacja śledząca, która rejestruje lokalizację, SMS-y, dźwięk rozmów, WhatsApp, Facebook, zdjęcie, kamerę, aktywność w Internecie. Najlepsze do kontroli rodzicielskiej i monitorowania pracowników. Szpiegowskie Telefonu za Darmo – Oprogramowanie Monitorujące Online. https://www.xtmove.com/pl/

  10. pilllow

    Normally I do not read article on blogs however I would like to say that this writeup very forced me to try and do so Your writing style has been amazed me Thanks quite great post

  11. pilllow

    I do not even know how I ended up here but I thought this post was great I dont know who you are but definitely youre going to a famous blogger if you arent already Cheers

  12. flooring

    you are in reality a good webmaster The website loading velocity is amazing It sort of feels that youre doing any distinctive trick Also The contents are masterwork you have done a fantastic job in this topic

  13. discoverblog

    Nice blog here Also your site loads up fast What host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol

  14. I loved as much as youll receive carried out right here The sketch is tasteful your authored material stylish nonetheless you command get bought an nervousness over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike

  15. tivimatepremium

    Hello Neat post Theres an issue together with your site in internet explorer would check this IE still is the marketplace chief and a large element of other folks will leave out your magnificent writing due to this problem

  16. mycroxyproxy

    Wow amazing blog layout How long have you been blogging for you made blogging look easy The overall look of your web site is magnificent as well as the content

  17. youtube to mp3

    you are in reality a just right webmaster The site loading velocity is incredible It seems that you are doing any unique trick In addition The contents are masterwork you have performed a wonderful task on this topic

  18. theorangedip

    you are in reality a good webmaster The website loading velocity is amazing It sort of feels that youre doing any distinctive trick Also The contents are masterwork you have done a fantastic job in this topic

  19. floatswitchs

    Wow amazing blog layout How long have you been blogging for you made blogging look easy The overall look of your web site is magnificent as well as the content

  20. bestiptvireland

    I just could not leave your web site before suggesting that I really enjoyed the standard information a person supply to your visitors Is gonna be again steadily in order to check up on new posts

  21. kmtfirm

    Its like you read my mind You appear to know so much about this like you wrote the book in it or something I think that you can do with a few pics to drive the message home a little bit but instead of that this is excellent blog A fantastic read Ill certainly be back

  22. blogmedia

    Its like you read my mind You appear to know so much about this like you wrote the book in it or something I think that you can do with a few pics to drive the message home a little bit but other than that this is fantastic blog A great read Ill certainly be back

  23. cuddlechair

    Wow wonderful blog layout How long have you been blogging for you make blogging look easy The overall look of your site is great as well as the content

  24. Loteria online

    olá, gosto muito da sua escrita, tanto que mantemos uma correspondência extra sobre sua postagem na AOL. Preciso de um especialista neste espaço para desvendar meu problema. Talvez seja você. Estou ansioso para vê-lo

  25. ibomma

    Fantastic beat I would like to apprentice while you amend your web site how could i subscribe for a blog site The account helped me a acceptable deal I had been a little bit acquainted of this your broadcast offered bright clear concept

  26. wiresuk

    Meu primo me recomendou este site, não tenho certeza se este post foi escrito por ele, pois ninguém mais sabe tão detalhadamente sobre minha dificuldade. Você é maravilhoso, obrigado

  27. Temp Mail

    Your work has captivated me just as much as it has captivated you. The visual presentation is elegant, and the written content is sophisticated. However, you appear concerned about the possibility of presenting something that could be considered dubious. I’m confident you’ll be able to resolve this issue promptly.

  28. Ny weekly

    Ny weekly I am truly thankful to the owner of this web site who has shared this fantastic piece of writing at at this place.

  29. Ny weekly

    Ny weekly For the reason that the admin of this site is working, no uncertainty very quickly it will be renowned, due to its quality contents.

  30. kalorifer soba

    Magnificent beat I would like to apprentice while you amend your site how can i subscribe for a blog web site The account helped me a acceptable deal I had been a little bit acquainted of this your broadcast offered bright clear idea

  31. thefriskys

    Wonderful web site Lots of useful info here Im sending it to a few friends ans additionally sharing in delicious And obviously thanks to your effort

Leave a Reply