Defichain maxi - Scripts to optimize performance on defichain rewards

Overview

defichain_maxi

This script is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the script increases LM-exposure, if it falls it automatically decreases it.

If the reinvest is set in the settings, it will automatically reinvest DFI rewards from the address as soon as they go over that threshold.

The first version needs a full node with activated rpc to run. I might do a version using the Ocean API later on.

Disclaimer / WARNING

This is no beginners tool. I only recommend it for ppl who know what they are doing and have experience in running a 24/7 server. If you don't understand what the code does and what the risks are, you will probably loose money. Don't ever blame me for losing money yourself ;)

And of course, this is not financial advice!

Running it on a server

I have this script running on a server for 2 months now. I use DigitalOcean for it because of their simplicity. You need a server with at least 4GB of RAM (to run the defichain fullnode on it). Such a server costs around 20$/month on DigitalOcean. If you wanna check it out, feel free to use the reflink. You also get 100$ to test their service for 2 months, which lets you test everything you need without any cost basically.

donations

If this script or parts of it help you make more rewards, feel free to give something back:

DFI address: dLBqjysPVXYQX4dFSp5hMWdVfbdeY4aHVS BTC: bc1qfdm2z0xpe7lg70try8x3n3qytrjqzq5y2v6d5n

Comments
  • accounttoutxos should not be used for direct deposit

    accounttoutxos should not be used for direct deposit

    Reference: https://github.com/DeFiCh/ain/issues/1658

    This is to maximize the compatibility of DeFiChain with exchanges so that it's continues to maintain drop-in compatibility with Bitcoin.

    opened by uzyn 6
  • `send-dfi` bot to fix immature UTXOs issue

    `send-dfi` bot to fix immature UTXOs issue

    It's a workaround bot for https://github.com/kuegi/defichain_maxi/issues/100.

    It looks for DFI (and UTXO) which it tries to send to toAddress.

    Another possibility use case is moving funds from a maxi to any other wallet, like a reinvest to DFX Staking or another Maxi etc.

    Build

    npm run build:send-dfi
    

    Setup

    Add following paramters to the AWS Parameter Store

    • defichain-maxi/wallet-send/toAddress
    • defichain-maxi/wallet-send/fromAddress

    Optional you can add:

    • defichain-maxi/settings-send/threshold (Default: 1)
      • Threshold until it tries to send funds
    • defichain-maxi/settings-send/sendall (Default: false)
      • should I send all DFI and UTXO
    opened by mrgrauel 6
  • Error with an empty Vault

    Error with an empty Vault

    I created a Vault and put there a few DFI Tokens, than i start the Script python3 DFIVaultMaxi.py after this i get an error

    2022-03-01 11:45:37,454 - INFO:SafeVault_ - starting to monitor. with pair PLTR-DUSD. Vault currently at -1, will increase LM above 305 and decrease below 300, will reinvest when balance goes above 1 DFI
    2022-03-01 11:45:37,462 - ERROR:SafeVault_ - uncaught exception: '>' not supported between instances of 'int' and 'str'
    

    can somebody help / fix this issue ? Many THX

    opened by goofy79 6
  • ERROR while starting node-rpc bot

    ERROR while starting node-rpc bot

    Hey folks, i get the following error when i try to start the node-rpc bot:

    2022-12-05T21:36:40Z ERROR: Reject messages larger than max deserialization size: (1936672778 > 134217728)
    

    this error shows up in the defi logs and not in defichain_maxi. but i wonder why this happens?

    I tried the develop branch as well as tagged v2.4.1 commit

    opened by mroxso 4
  • separate Telegram Bots

    separate Telegram Bots

    I like the logs every 10 Minutes in telegram. Maybe you could add some more figures to it: Size of Collateral and size of loans; both in DUSD. However you stop looking at the logs carefully after some days. My suggestion:

    Two Telegram Bots: Log Bot: Gives Logs and additional figures, every time when VaultMaxi runs Error Bot: Only critical messages

    wontfix ocean-client 
    opened by BenTStark 4
  • single mint might take too much main collateral, so ratio goes below 50%

    single mint might take too much main collateral, so ratio goes below 50%

    maxi should not take the collateral and then fail on the take loan, but handle this case gracefully: recognize it, only take as much as possible and warn user that 50% is reached.

    enhancement ocean-client 
    opened by kuegi 3
  • [Log] added motivational log for users

    [Log] added motivational log for users

    @Krysh90 was thinking if we want to show it on every reinvest or with a random filter only ever other or once every 4 or something like that. what do you think?

    opened by kuegi 2
  • Additional info about vault safety

    Additional info about vault safety

    I've deployed the cloud formation template and set up to monitor the GS-DUSD LM Pair.

    But I keep getting the following message:

    vault ratio not safe but either no lpTokens or no loans in vault.
    Did you change the LMToken? Your vault is NOT safe!
    

    I definitely have LP-Tokens for dGS-DUSD and tokens for DUSD and dGS as well. Can I ignore this message or is there an issue that I need to investigate?

    opened by hhoechtl 1
  • Add LM reinvest to command center

    Add LM reinvest to command center

    Allow commands to change LM reinvest parameters.

    We need to decide on a functionality.

    1. create new commands
      • /setLMReinvest
    2. add possibility to existing commands to decide which bot should be changed
      • /setReinvest 10 lm-reinvest
      • /setReinvest 10 vault-maxi
    3. save and persist on which the command center is currently working on
      • /attachTo lm-reinvest
      • /setReinvest 10
      • /attachTo vault-maxi
      • /setReinvest 10
    enhancement command center 
    opened by Krysh90 1
  • clean up script from version 1.0 produce a lot of transactions with zero dfi

    clean up script from version 1.0 produce a lot of transactions with zero dfi

    clean up script from version 1.0 produce a lot of transactions with minimal dusd amounts

    [Maxi v1.0] executed clean-up part of script successfull. vault ratio after clean-up 221

    trans

    image

    opened by marcelkb 1
  • Error Handling if not enough DFI/DUSD to get loan

    Error Handling if not enough DFI/DUSD to get loan

    Since yesterday my collateral ratio is above the trigger level for vault-maxi. But because the dfi ratio is less 50% through the sharp decline in price, the bot cant take out a loan. Instead of giving a clear error warning like not enough loan token available in other cases it failed, tidies up after error and tries it again, failed...

    Log:

    2022-06-21T10:10:40.661+02:00
    2022-06-21T08:10:40.661Z 04848f6f-4be7-4609-bd57-2739708bfcde INFO failed to send tx even after after multiple retries (TakeLoanTx: At least 50% of the minimum required collateral must be in DFI or DUSD when taking a loan. (code 16))
    20
    2022-06-21T10:10:35.648+02:00
    2022-06-21T08:10:35.648Z 04848f6f-4be7-4609-bd57-2739708bfcde INFO error sending tx (TakeLoanTx: At least 50% of the minimum required collateral must be in DFI or DUSD when taking a loan. (code 16)). retrying after 5 seconds
    

    Telegram:

    [Maxi v1.0] Successfully cleaned up after some error happened
    [Maxi v1.0] There was an unexpected error in the script. please check the logs
    [Maxi v1.0] Successfully cleaned up after some error happened
    [Maxi v1.0] There was an unexpected error in the script. please check the logs
    [Maxi v1.0] Successfully cleaned up after some error happened
    [Maxi v1.0] There was an unexpected error in the script. please check the logs
    ....
    

    It would be great if the vault-maxi bot gets an Error-Handling for this case with concrete message, remind it in fix intervals and not trying it again and again spamming telegram.

    opened by marcelkb 1
  • 🐛 Masternode Rewards cannot be reinvest until these are trusted

    🐛 Masternode Rewards cannot be reinvest until these are trusted

    What did happen

    Vault Maxi tries to reinvest the masternode block reward, but this is not possible because these token are not fungible directly after the block was minted. It takes up to 2h until these are fungible.

    What should happen

    Vault Maxis waits until the token is fungible to reinvest.

    
    2022-10-14T21:15:14.714+02:00	INFO	vault maxi v2.3.3
    2022-10-14T21:15:14.714+02:00	INFO	starting with 889984ms available
    2022-10-14T21:15:15.634+02:00	INFO	initial state: idle|none||2322427|v2.3.3
    2022-10-14T21:15:15.634+02:00	INFO	received event { xxx }
    2022-10-14T21:15:15.634+02:00	INFO	using ocean at https://ocean.defichain.com on mainnet
    2022-10-14T21:15:16.854+02:00	ERROR	(node:9) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
                                 	(Use `node --trace-deprecation ...` to show where the warning was created)
    2022-10-14T21:15:18.956+02:00	INFO	initialized at block 2322464  dusd CollValue is 1.200
    2022-10-14T21:15:19.035+02:00	INFO	starting at block 2322464
    2022-10-14T21:15:19.417+02:00	INFO	working with vault xxx state: ACTIVE current Ratio 156(155.88479203) collValue: 13692.18190003 loanValue: 8783.52642449
    2022-10-14T21:15:19.417+02:00	INFO	collaterals:  | DFI: [email protected]>0.64808430 x 1 | BTC: [email protected]>19275.97152519 x 1
    2022-10-14T21:15:19.417+02:00	INFO	loans:  | DUSD: 4456.53580342@1->1 | MSFT: [email protected]>229.43948142
    2022-10-14T21:15:19.515+02:00	INFO	DUSD currently has a total interest of -10.2400 = 5 + -15.24 vs APR of 23.4660
    2022-10-14T21:15:19.516+02:00	INFO	starting with 156 (next: 155) in vault, target 154 - 156 (155) pair MSFT-DUSD, minting both
    2022-10-14T21:15:19.516+02:00	INFO	doing consistency checks
    2022-10-14T21:15:19.516+02:00	INFO	calculated values: collValue: 13692.18190004 loanValue: 8783.52642469 ratio: 155.88479203
    2022-10-14T21:15:19.516+02:00	INFO	doing consistency checks
    2022-10-14T21:15:19.517+02:00	INFO	calculated values: collValue: 13692.18190004 loanValue: 8783.52642469 ratio: 155.88479203
    2022-10-14T21:15:20.094+02:00	INFO	checking for reinvest: 65.7827133 from UTXOs, 1.0313217 tokens. total 66.814035 vs 50
    2022-10-14T21:15:20.094+02:00	INFO	converting 65.7827133 UTXOs to token 
    2022-10-14T21:15:22.294+02:00	INFO	Sending txId: next with input: prev:1
    2022-10-14T21:15:22.394+02:00	INFO	error sending tx (bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)). retrying after 10 seconds
    2022-10-14T21:15:32.361+02:00	INFO	error sending tx (bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)). retrying after 10 seconds
    2022-10-14T21:15:42.355+02:00	INFO	error sending tx (bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)). retrying after 10 seconds
    2022-10-14T21:15:52.355+02:00	INFO	error sending tx (bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)). retrying after 10 seconds
    2022-10-14T21:16:02.394+02:00	INFO	error sending tx (bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)). retrying after 10 seconds
    2022-10-14T21:16:12.394+02:00	INFO	failed to send tx even after after multiple retries (bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16))
    2022-10-14T21:16:12.394+02:00	ERROR	Error in script
    2022-10-14T21:16:12.434+02:00	ERROR	WhaleApiException [Error]: 400 - BadRequest (/v0/mainnet/rawtx/send): bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)
                                 	    at Object.raiseIfError (/var/task/index.js:1:243806)
                                 	    at WhaleApiClient.<anonymous> (/var/task/index.js:1:247710)
                                 	    at Generator.next (<anonymous>)
                                 	    at fulfilled (/var/task/index.js:1:245314)
                                 	    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
                                 	  error: {
                                 	    code: 400,
                                 	    type: 'BadRequest',
                                 	    at: 1665774972361,
                                 	    message: 'bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 1 (code 16)',
                                 	    url: '/v0/mainnet/rawtx/send'
                                 	  }
                                 	}
    
    
    opened by mrgrauel 1
  • make parameterPostfix configurable using Event

    make parameterPostfix configurable using Event

    Hey there, What do you think about making the Config postfix configurable via the incoming Event? I am using an in this way adjusted version of vault-maxi already for a couple of days.

    Reason for this is, when running on Lambda i can simply use the same lambda function with multiple Triggers and parameters.

    Any suggestions? If this works for you, I would be more than happy to create a PR for this.

    opened by Shogoki 1
Releases(v2.5.0)
  • v2.5.0(Dec 21, 2022)

    this is a recommend optional update with improvements to logging and reinvest pattern

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    release hashes

    windows / debian:

    sha256 hash base64: uOGXRoa/S1RgqTNIYXIbAhoAPG/HNV0R1H9vzNaLS80=
    sha256 hash hex: b8e1974686bf4b5460a9334861721b021a003c6fc7355d11d47f6fccd68b4bcd
    

    macOS: sha256 hash base64: - sha256 hash hex: -

    Changes

    • improved safety-level message
    • reinvest: threshold now blocks complete reinvest, not only auto donation
    • added loglevels, you can now define what part of the messages should go to the notifications channel and which to the log level. Default is "INFO and above goes to notifications, verbose out to logs". possible log levels are error, warning, info, verbose
    • additional safety check in case of onchain troubles
    • increase exposure as much as possible if 50% rule prevents full increase
    • reinvest: switch sending of DFI to "clean UTXOs" (not directly from AccountToUTXOs, but with extra step) to have full bitcoin compatibility on exchanges. Now reinvest directly to cake address also works

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    Reinvest

    Reinvest is based on the vault-maxi code but only the reinvest without managing of any vault, It also got updated and now uses exactly the same reinvest logic as vault-maxi.

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Reinvest Guide

    release hashes

    windows / debian:

    sha256 hash base64: srvwfDNMmtYeqT4HgQbO0+gfFonvzYMa7W6VZIcfhMI=
    sha256 hash hex: b2bbf07c334c9ad61ea93e078106ced3e81f1689efcd831aed6e9564871f84c2
    

    macOS: sha256 hash base64: - sha256 hash hex: -

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • Feature/vault analysis by @kuegi in https://github.com/kuegi/defichain_maxi/pull/121
    • maxi: improved safety-level message by @kuegi in https://github.com/kuegi/defichain_maxi/pull/122
    • reinvest: threshold now blocks complete reinvest, not only auto donation by @kuegi in https://github.com/kuegi/defichain_maxi/pull/123
    • reinvest-threshold-override only applies to reinvest, not donation guard by @kuegi in https://github.com/kuegi/defichain_maxi/pull/125
    • improved vault-analysis by @kuegi in https://github.com/kuegi/defichain_maxi/pull/128
    • Feature/loglevel by @kuegi in https://github.com/kuegi/defichain_maxi/pull/126
    • maxi: additional safety check in case of onchain troubles by @kuegi in https://github.com/kuegi/defichain_maxi/pull/127
    • Feature/increase whats possible by @kuegi in https://github.com/kuegi/defichain_maxi/pull/130
    • reinvest: extra step to send as clean UTXOs by @kuegi in https://github.com/kuegi/defichain_maxi/pull/133
    • version bump 2.5.0 by @kuegi in https://github.com/kuegi/defichain_maxi/pull/131

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.4.1...v2.5.0

    Source code(tar.gz)
    Source code(zip)
    lm-reinvest-2-1-0.zip(401.75 KB)
    vault-maxi-2-5-0.zip(413.47 KB)
  • v2.4.1(Nov 22, 2022)

    this is a optional update with minor improvements to logging and small fixes

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    release hashes

    windows / debian:

    sha256 hash base64: kIq8VYCvB7uUTbFwpIPWJSJ2RQvrXPZ9IYnJT7AXmvY=
    sha256 hash hex: 908abc5580af07bb944db170a483d6252276450beb5cf67d2189c94fb0179af6
    

    macOS: sha256 hash base64: - sha256 hash hex: -

    Changes

    • fixed heartbeat
    • improved telegram messages (warnings and infos)
    • improved handling of errors during cleanup

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    Reinvest

    Reinvest is based on the vault-maxi code but only the reinvest without managing of any vault, It also got updated and now uses exactly the same reinvest logic as vault-maxi.

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Reinvest Guide

    release hashes

    windows / debian:

    sha256 hash base64: GvM5x8lTRlxkUbZwEqopj5lKQPKc2W8bcRZMgepjVSc=
    sha256 hash hex: 1af339c7c953465c6451b67012aa298f994a40f29cd96f1b71164c81ea635527
    

    macOS: sha256 hash base64: - sha256 hash hex: -

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • VM template: added condition to reinvestPattern creation by @kuegi in https://github.com/kuegi/defichain_maxi/pull/113
    • reinvest: improve message (add LP token parts) by @kuegi in https://github.com/kuegi/defichain_maxi/pull/116
    • Fix/heartbeat by @kuegi in https://github.com/kuegi/defichain_maxi/pull/115
    • Feature/improve messages by @kuegi in https://github.com/kuegi/defichain_maxi/pull/117
    • maxi: improved errorhandling by @kuegi in https://github.com/kuegi/defichain_maxi/pull/119

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.4.0...v2.4.1

    Source code(tar.gz)
    Source code(zip)
    lm-reinvest-2-0-1.zip(396.29 KB)
    vault-maxi-2-4-1.zip(405.88 KB)
  • v2.4.0(Nov 7, 2022)

    this is a optional update including major improvements in the reinvest logic

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    new reinvest logic

    With the new reinvest logic, you can highly customize how vault-maxi (and also lm-reinvest) uses the DFI rewards that come into your wallet.

    Everything is defined via a reinvest-pattern which is a string of (comma or space) separated reinvest-targets. each target can contain 3 parts:

    • the target token (can be any token with a possible swap path from DFI, or any LM-token)
    • the percentage (0-100) from the reinvested amount that should be used for this target
    • a target address or vaultId (vaultId is only valid if the token is a collateralToken). you can use wallet and vault as shortcut for your own address and vault

    if you leave the percentage empty (for all or some targets) the remaining percentage (after filling all defined percentage targets) is split equally over all targets without a specified percentage.

    if you leave the address/vaultId empty, collateralTokens are deposited to your own vault. All other tokens stay in your address.

    If the whole parameter is empty, it falls back to the pattern <mainCollateralAsset> which effectively deposits the amount as DFI or DUSD into your vault. so exactly the same behavior as before (means no action needed if you do not want to use the new functionality)

    examples

    this pattern can be super simple in the usage, but is extremly powerful for those who need it. here are some examples:

    • just reinvest the DFI into the vault: DFI (1 target: coin = DFI, no percentage = split equally over targets, no address/vault= reinvest to own vault cause collateral Token
    • split equally between DFI and DUSD and reinvest: DFI,DUSD
    • swap 20% to USDT and keep in wallet, split remaining to DFI and BTC, send the BTC to df1address1: USDT:20:wallet,DFI,BTC::df1address1
    • swap 10% to BTC-DFI, 15% to SPY-DUSD, 10% reinvest in other vault as DFI, 20% send as TLT-DUSD to address2, rest as DFI in own vault: BTC-DFI:10,SPY-DUSD:15,DFI:10:vaultIdOfOther,TLT-DUSD:20:address2,DFI

    release hashes

    windows / debian: sha256 hash base64: AKgKuawMMndViyHYhZARDPPf6akruZU4rLYJ4YXJ1pY= sha256 hash hex: 00a80ab9ac0c3277558b21d88590110cf3dfe9a92bb99538acb609e185c9d696 macOS: sha256 hash base64: BF0XhYlqgAU/0by/Q7watAy2eGl8d0/SI1OgLPO01ZM= sha256 hash hex: 045d1785896a80053fd1bcbf43bc1ab40cb678697c774fd22353a02cf3b4d593

    Changes

    • major upgrade to reinvest functionality
    • moved main used environmentVariables to parameters (envVars are still overriding parameter values)
    • auto-donation now splits the donation directly between kuegi and krysh (till now we had to rebalance manually). Nothing changes in the amounts etc. Also still done in one transaction.

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    Reinvest

    Reinvest is based on the vault-maxi code but only the reinvest without managing of any vault, It also got updated and now uses exactly the same reinvest logic as vault-maxi.

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Reinvest Guide

    release hashes

    windows / debian: sha256 hash base64: V9p7yNOW5taSekJfK6tMlNuEdNLgP0bwAwF4IyuCs9I= sha256 hash hex: 57da7bc8d396e6d6927a425f2bab4c94db8474d2e03f46f0030178232b82b3d2 macOS: sha256 hash base64: EMuN5pu+9NdLBjD0NCJcmLJxW/Z8w81Mi2+HBeaKf+o= sha256 hash hex: 10cb8de69bbef4d74b0630f434225c98b2715bf67cc3cd4c8b6f8705e68a7fea

    Command Center

    It is an optional addon, which can be installed to receive more functionality for your vault-maxi or lm-reinvest via Telegram. You can send commands to change existing parameters without the need of logging into AWS.

    What it does

    • it executes certain commands to ease usage of vault-maxi without the need of logging into your AWS account and change some settings
    • it is being achieved by using your vault-maxis’ telegram bot to exchange information. This makes it secure, as you are not directly communicating via an API, which could be an additional attack vector for a hacker
    • it will check every minute through polling of new chat commands from you. Therefore chat id and your username are needed to make sure, the message which command center receives is from you and from nobody else
    • /help is your best friend. It will show you all commands, which the command center is able to execute
    • the command center has no access to your private key/seed. It can only change settings of vault-maxi.

    Guide

    We wrote a guide for the whole setup process in AWS. If you just want to install the addon, follow this guide and make sure to read the risk-warnings carefully. Command-Center Guide

    release hashes

    windows / debian: sha256 hash base64: vhvdwGDYSlPbvLq0cggK2JBjS5WOx1JVDOcGu603ThI= sha256 hash hex: be1bddc060d84a53dbbcbab472080ad890634b958ec752550ce706bbad374e12 macOS: sha256 hash base64: 2Sf0JVtg6OKnDJkPco9aS8hksBCSmLpowstsHRQJN04= sha256 hash hex: d927f4255b60e8e2a70c990f728f5a4bc864b0109298ba68c2cb6c1d1409374e

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • Feature/heart beat by @kuegi in https://github.com/kuegi/defichain_maxi/pull/94
    • Feature/improved safety by @kuegi in https://github.com/kuegi/defichain_maxi/pull/97
    • Fixes by @kuegi in https://github.com/kuegi/defichain_maxi/pull/98
    • Reformat by @kuegi in https://github.com/kuegi/defichain_maxi/pull/99
    • Feature/improved reinvest by @kuegi in https://github.com/kuegi/defichain_maxi/pull/104
    • Refactor/store by @kuegi in https://github.com/kuegi/defichain_maxi/pull/106
    • Feature/more parameters by @kuegi in https://github.com/kuegi/defichain_maxi/pull/107
    • Feature/extract reinvest by @kuegi in https://github.com/kuegi/defichain_maxi/pull/108
    • Finalreleasechanges by @kuegi in https://github.com/kuegi/defichain_maxi/pull/109
    • [command-center] added bot to update parameters by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/110
    • [command-center] reinvest pattern by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/111

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.3.2...v2.4.0

    Source code(tar.gz)
    Source code(zip)
    command-center-1-1.zip(930.16 KB)
    lm-reinvest-2-0.zip(396.24 KB)
    vault-maxi-2-4-0.zip(405.38 KB)
  • command-center/v1.0(Oct 29, 2022)

    It is an optional addon, which can be installed to receive more functionality for your vault-maxi or lm-reinvest via Telegram. You can send commands to change existing parameters without the need of logging into AWS.

    What it does

    • it executes certain commands to ease usage of vault-maxi without the need of logging into your AWS account and change some settings
    • it is being achieved by using your vault-maxis’ telegram bot to exchange information. This makes it secure, as you are not directly communicating via an API, which could be an additional attack vector for a hacker
    • it will check every minute through polling of new chat commands from you. Therefore chat id and your username are needed to make sure, the message which command center receives is from you and from nobody else
    • /help is your best friend. It will show you all commands, which the command center is able to execute
    • the command center has no access to your private key/seed. It can only change settings of vault-maxi.

    Guide

    We wrote a guide for the whole setup process in AWS. If you just want to install the addon, follow this guide and make sure to read the risk-warnings carefully. Command-Center Guide

    release hashes

    windows / debian: sha256 hash base64: - sha256 hash hex: - macOS: sha256 hash base64: QE3kN1GUSSVD6wc6mRHVImrVARnml/L33IVsfRQx8bs= sha256 hash hex: 404de4375194492543eb073a9911d5226ad50119e697f2f7dc856c7d1431f1bb

    Tag

    command-center/v1.0-rc

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • [command-center] feedback by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/95
    • Reformat by @kuegi in https://github.com/kuegi/defichain_maxi/pull/99
    • [command-center] release prep by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/103

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.3.2...command-center/v1.0

    Source code(tar.gz)
    Source code(zip)
    command-center-1-0.zip(929.92 KB)
  • v2.3.2(Sep 24, 2022)

    this is a optional update including additional safety measure to prevent errors due to ocean inconsistencies.

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    release hashes

    windows / debian: sha256 hash base64: OZCjItHmddyOmZe5qK1XHzofFibHm5nB/wiaJankXBs= sha256 hash hex: 3990a322d1e675dc8e9997b9a8ad571f3a1f1626c79b99c1ff089a25a9e45c1b macOS: sha256 hash base64: - sha256 hash hex: -

    Changes

    • added consistency checks
    • always remove exposure if chain thinks the vault may liquidate, but maxi doesn't reduce exposure

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    Addon command-center

    It is an optional addon, which can be installed to receive more functionality for your vault-maxi or lm-reinvest via Telegram. You can send commands to change existing parameters without the need of logging into AWS.

    What it does

    • it executes certain commands to ease usage of vault-maxi without the need of logging into your AWS account and change some settings
    • it is being achieved by using your vault-maxis’ telegram bot to exchange information. This makes it secure, as you are not directly communicating via an API, which could be an additional attack vector for a hacker
    • it will check every minute through polling of new chat commands from you. Therefore chat id and your username are needed to make sure, the message which command center receives is from you and from nobody else
    • /help is your best friend. It will show you all commands, which the command center is able to execute
    • the command center has no access to your private key/seed. It can only change settings of vault-maxi.

    Guide

    We wrote a guide for the whole setup process in AWS. If you just want to install the addon, follow this guide and make sure to read the risk-warnings carefully. Command-Center Guide

    release hashes

    windows / debian: sha256 hash base64: - sha256 hash hex: - macOS: sha256 hash base64: 9jvAhWGO8Ed1SBrrR5z9xAH0n4g9DXgBgzfZJaub5sM= sha256 hash hex: f63bc085618ef04775481aeb479cfdc401f49f883d0d78018337d925ab9be6c3

    Tag

    command-center/v1.0-rc

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • Feature/command center fixes by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/73
    • [command-center] added set pair command for lm-reinvest by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/83
    • maxi: added logs for state of vault and consistency checks @kuegi in https://github.com/kuegi/defichain_maxi/pull/84
    • [command-center] version bump by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/85
    • Fix/reduced cleanup and betterconsistency buffer by @kuegi in https://github.com/kuegi/defichain_maxi/pull/86
    • [command center] feedback by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/87
    • command-center rc update by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/88
    • Fix/consistency on empty vault by @kuegi in https://github.com/kuegi/defichain_maxi/pull/89
    • pump template version by @kuegi in https://github.com/kuegi/defichain_maxi/pull/91

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.3...v2.3.2

    Source code(tar.gz)
    Source code(zip)
    command-center-1-0-rc.zip(929.95 KB)
    vault-maxi-2-3-2.zip(401.68 KB)
  • v2.3(Sep 16, 2022)

    this is a recommended update to remove the workaround for defichain 2.10 bug. This version includes a check to disable the workaround after the FCE fork which will fix the bug.

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    release hashes

    windows / debian: sha256 hash base64: GEtY9K1zZGbr0PbfyGId2qOH7WzhGMyrtfMKTxPEuW4= sha256 hash hex: 184b58f4ad736466ebd0f6dfc8621ddaa387ed6ce118ccabb5f30a4f13c4b96e macOS: sha256 hash base64: - sha256 hash hex: -

    Changes

    • added blockheight check when to activate the payback-bug workaround
    • made testnet possible
    • made use of collFactor everywhere to correctly handle the upcoming change of the DUSD value
    • added envVar VAULTMAXI_SWAP_REWARDS_TO_MAIN to prevent swapping to main collateral asset on reinvest

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • maxi: added VAULTMAXI_SWAP_REWARDS_TO_MAIN by @kuegi in https://github.com/kuegi/defichain_maxi/pull/78
    • vaultMaxi: allow testnet based on address by @kuegi in https://github.com/kuegi/defichain_maxi/pull/79
    • Fix/dusd coll value by @kuegi in https://github.com/kuegi/defichain_maxi/pull/80
    • Feature/testnet bot by @kuegi in https://github.com/kuegi/defichain_maxi/pull/81
    • Feature/use coll factor everywhere by @kuegi in https://github.com/kuegi/defichain_maxi/pull/82

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.2...v2.3

    Source code(tar.gz)
    Source code(zip)
    vault-maxi-2-3.zip(401.25 KB)
  • v2.2(Sep 9, 2022)

    Vault Maxi via Ocean API

    this is a mandatory update for vault-maxi to workaround the defichain bug in version 2.10.0

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    release hashes

    windows / debian: sha256 hash base64: dcfGE/b5LikaOqRKfsELCx0S5pFe3l46yXR2FQY0yzQ= sha256 hash hex: - macOS: sha256 hash base64: - sha256 hash hex: -

    Changes

    • added workaround for protocol version 70030 (2.10.0)
    • added safety-mode to cleanup (if cleanup fails, try again with reduced sizes)
    • switched to node v16, if you do not use the template, please switch your lambda runtime to Node.js 16.x yourself.

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • vaultmaxi: added workaround for 2.10 bug and safetymode by @kuegi in https://github.com/kuegi/defichain_maxi/pull/75
    • Fix/negative number payback by @kuegi in https://github.com/kuegi/defichain_maxi/pull/76
    • maxi:stableArb added check regarding change of collValue between stab… by @kuegi in https://github.com/kuegi/defichain_maxi/pull/77

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.1...v2.2

    Source code(tar.gz)
    Source code(zip)
    vault-maxi-2-2.zip(401.02 KB)
  • v2.1(Aug 16, 2022)

    DO NOT USE UNTIL DEFICHAIN BUG IS RESOLVED

    A bug on defichain 2.10.0 is preventing this bot from paying back any loans. effectively rendering the whole bot useless. DO NOT USE it until the bug on the chain is resolved.

    Vault Maxi via Ocean API

    this is a non-mandatory update for vault-maxi

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    release hashes

    windows / debian: sha256 hash base64: MF9aJJsoUJDIRS0eqc6CCT2/oiQgIajFd3y/wvZRpKM= sha256 hash hex: 305f5a249b285090c8452d1ea9ce82093dbfa2242021a8c5777cbfc2f651a4a3 macOS: sha256 hash base64: - sha256 hash hex: -

    Changes

    • added safety check on auto-donation to not donate on transfer of funds
    • general performance and stability

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    LM reinvest

    based on the vault-maxi code, we added a new bot which simply takes DFI from your address and invests it into a defined LM-pool. This is perfect to use as automatic reinvest for LM-pools.

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. LM-reinvest Guide

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • [maxi donation] added filter to auto-donation by @kuegi in https://github.com/kuegi/defichain_maxi/pull/53
    • [LM-reinvest] first version of reinvest bot by @kuegi in https://github.com/kuegi/defichain_maxi/pull/54
    • Fix/improvements by @kuegi in https://github.com/kuegi/defichain_maxi/pull/58
    • Feature/extra log on no utxos by @kuegi in https://github.com/kuegi/defichain_maxi/pull/66
    • Feature/no key mode by @kuegi in https://github.com/kuegi/defichain_maxi/pull/64
    • Better errors by @kuegi in https://github.com/kuegi/defichain_maxi/pull/68
    • [ocean-telegram] improved errorhandling on telegram by @kuegi in https://github.com/kuegi/defichain_maxi/pull/71

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v2.0...v2.1

    Source code(tar.gz)
    Source code(zip)
    lm-reinvest-1-0.zip(401.82 KB)
    vault-maxi-2-1.zip(400.36 KB)
  • v2.0(Jun 16, 2022)

    backwards compatible new version

    v2.0 is fully backward compatible. Means you can take this version and update an existing maxi 1.x lambda to 2.0 without any further changes. But if you do not want to use the new single-mint functionality, there is no need to update 1.x as this part has not changed in 2.0.

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    main focus: single mint (aka "dusd-maxi")

    Vault-Maxi 1.x worked in a simple, straight forward way: it didn't matter what collateral you used, it always minted both tokens for the Liquidity Pool (= "double mint"). This meant that you can only use pools where both tokens can be minted (aka not DUSD-DFI) and in case of DUSD in the collateral, you mint DUSD which you could take directly from the collateral (which is inefficient).

    With the new functionality, you can define a "main collateral asset" (either DFI or DUSD) and based on that in combination with the LM-Pair, vault-maxi 2.0 decides itself if it mints both (in case of main = DFI and pool = dStock-DUSD) or if it takes part of the main-asset out of the collateral and mints only the other asset (single mint). Now DUSD-DFI is possible (with main collateral DFI) and also efficient DUSD-only vaults.

    Of course it still keeps the vault within the given range. But don't be alarmed: the collateral of the vault will vary now as maxi moves part of the collateral into the LM and back.

    Also keep in mind that you need to have enough of the main collateral in the vault, so that maxi can withdraw it and still take loans (so no vault with 50% DUSD and 50% BTC for example)

    DUSD to USDC/T arbitrage

    to support the DUSD peg and also give you some extra profits, we added automated arbitrage trading. If DUSD is more than 1% off peg, and you have the needed collateral in the vault (depending on the side of the depeg you need DUSD or USDT or USDC) it automatically takes the collateral (in batch sizes defined in the settings), swaps them to the other side and puts them back into the vault. so you make >1% instant win and the ecosystem thanks you for it.

    Migration from v1.x to v2.0

    If you already have a running version of vault-maxi v1.x and upgrade via the cloud-template, there is no action needed from your side beside double checking all the values in the template. There are new parameters which might need change from your side. Please make sure you fill them in correctly. Specially the LM-pair (instead of LM-token before). In the LM-pair you need to fill in the whole pair (e.g. "QQQ-DUSD") but now you can also fill in "DUSD-DFI". Also check the value of the auto-donation parameter.

    If you are updating "manually" by just uploading a new zip, please be aware of the following steps to take:

    • The role of your lambda function needs access to the new parameters. the list rule is already a wildcard for all defichain-maxi parameters but the section with PutParameter (which currently is just for .../defichain-maxi/state) additionally needs the resource "Fn::Sub": "arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/defichain-maxi/skip" . compare the template file in the repository for more details
    • add the parameter /defichain-maxi/settings/lm-pair (which replaces lm-token) and set it to the full pair you want to use (if you used "QQQ" before, set it to "QQQ-DUSD")

    How to activate v2 features

    single mint

    With v2 it is now possible to take only one asset as loan and take the other asset for the LM pair from the collateral of the vault. This is possible for "DUSD-DFI" (minting DUSD, taking DFI from collateral) and all dToken-DUSD pairs (minting the dToken, taking DUSD from collateral). To activate it, you put in the wanted LM-pair as always and set /defichain-maxi/settings/main-collateral-asset to the according asset that should be taken from the collateral ("DFI" or "DUSD"). This also means that, if you use DUSD-DFI as pair, it only works with single mint (cause you can't mint DFI). with the other pairs, it depends on your main-collateral-asset if it uses single mint (when main-collateral-asset = DUSD) or mint both (when main-collateral-asset = DFI)

    If you want to change from double-mint to single-mint, keep in mind that vault-maxi is not repaying automatically. You need to first remove the exposure with the double-mint setting (easiest by setting maxCollateral = -1) and then let it increase exposure with the single-mint settings.

    stablecoin arbitrage

    If you set /defichain-maxi/settings/stable-arb-batch-size to a number greater than 0, vault-maxi will search for arbitrage opportunities in USDT-DUSD and USDC-DUSD (via composite swap over DFI). If it finds one ( min 1% off from parity+fees) and the according asset is in the collateral, it will take up to batchSize out of the vault, use the arbitrage (swap to the other asset with maxPrice 1) and deposit the result back.

    The calculations include the commission and fee. So with a DEX-fee of 20% (f.e.) the DUSD->USDC/T arb would not kick in until its at 21% premium, but USDT/C->DUSD will happen right at 1.2% discount (1% buffer + 0.2% commission).

    auto donation

    Due to frequent requests from users who like our work but forget to donate, we added an auto-donation as percentage of reinvest. If you set /defichain-maxi/settings/auto-donation-percent-of-reinvest to a value > 0, on every reinvest that the bot does it will take this percentage and donates it to df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07 (thats kuegis address but its split with krysh on a regular basis). So if you choose to donate 5% of your reinvests (aka your rewards), put 5 into the parameter. On every reinvest, the telegram message will also tell you how much you donated for full transparency. We thank everyone for their donations to help fund our development and as a sign of appreciation of our work.

    release hashes

    windows / debian: sha256 hash base64: wtVz6oo3/4ufllv0MYcyv/zpr7FpIgsljcVUQe1jbQs= sha256 hash hex: c2d573ea8a37ff8b9f965bf4318732bffce9afb169220b258dc55441ed636d0b macOS: sha256 hash base64: E2S2t4MCOWv2SOITY9D9WyIdN91u0U8KFm6rryeQV1U= sha256 hash hex: 1364b6b78302396bf648e21363d0fd5b221d37dd6ed14f0a166eabaf27905755

    Changes

    • added single-mint functionality
    • fallback to main ocean on any error
    • added skip-parameter (and ignoreSkip in overrides) to allow addon usage
    • remove all exposure if dusd interest is greater than the pool APR
    • added auto donation feature. (deactivated if no parameter is set, default setting via template is 5%). If activated, it auto donates a user-defined percentage of your reinvest to our donation address.
    • added dusd to usdt/c arbitrage

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    Guide

    We wrote an extensive guide for the whole setup process in AWS. If you just want to run the bot, follow this guide and make sure to read the risk-warnings carefully. Vault-Maxi Guide

    What's Changed

    • Feature/single mint by @kuegi in https://github.com/kuegi/defichain_maxi/pull/38
    • added skip feature by @kuegi in https://github.com/kuegi/defichain_maxi/pull/39
    • Fixes by @kuegi in https://github.com/kuegi/defichain_maxi/pull/40
    • [vault-maxi] added ignoreSkip to overrideParameters by @kuegi in https://github.com/kuegi/defichain_maxi/pull/41
    • [vault-maxi] falling back to main ocean in case of any error. by @kuegi in https://github.com/kuegi/defichain_maxi/pull/42
    • [rpc] added single-mint functionality by @kuegi in https://github.com/kuegi/defichain_maxi/pull/43
    • [maxi] remove/prevent exposure if interest rate is above APR by @kuegi in https://github.com/kuegi/defichain_maxi/pull/48
    • [vault maxi] added auto donation. deactivated on default by @kuegi in https://github.com/kuegi/defichain_maxi/pull/49
    • [vault-maxi] first version of stable-arb part for DUSD maxi by @kuegi in https://github.com/kuegi/defichain_maxi/pull/45
    • Fixes by @kuegi in https://github.com/kuegi/defichain_maxi/pull/50
    • [maxi, stableArb] added possible stable-pools for arb by @kuegi in https://github.com/kuegi/defichain_maxi/pull/52

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v1.1...v2.0

    Source code(tar.gz)
    Source code(zip)
    vault-maxi-2-0.zip(388.09 KB)
  • v1.1(Jun 2, 2022)

    Optional but recomended update

    This optional update doesn't add or change the core functionality. It just adds security checks (to prevent user errors), reduces ocean-api calls and allows you to define a custom ocean-endpoint

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    windows / debian: sha256 hash base64: nWEDd2Q9zJPe24BAVKUxxUEz1fqXqD8DqqkqwHlNAR4= sha256 hash hex: 9d610377643dcc93dedb804054a531c54133d5fa97a83f03aaa92ac0794d011e macOS: sha256 hash base64: OKZrR5ZX8EtdHbKKbIcPld04L+d5IakN5JXtXIOuS7s= sha256 hash hex: 38a66b479657f04b5d1db28a6c870f95dd382fe77921a90de495ed5c83ae4bbb

    Changes

    • adapt collateral ratio to valid values in case of user error (so maxi doesn't stop working due to wrong inputs on the ratio)
    • reduced calls to ocean api to improve performance and reduce load on the ocean api
    • added environment variable VAULTMAXI_OCEAN_URL to specify a custom ocean-like endpoint
    • added the current safety level to the log message for more transparency
    • improved recovery after any error happens, in case that the error happened while maxi was waiting for a tx.

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    @DeFiPages : df1qa26988rj9xamw4tkanu7pthqshw6677vkasdg7

    Guide

    Here is the link

    What's Changed

    • Feature/more safety checks by @kuegi in https://github.com/kuegi/defichain_maxi/pull/35
    • Feature/less ocean calls by @kuegi in https://github.com/kuegi/defichain_maxi/pull/36
    • [vaultMaxi] made custom ocean-url possible via environment by @kuegi in https://github.com/kuegi/defichain_maxi/pull/37

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v1.0...v1.1

    Source code(tar.gz)
    Source code(zip)
    vault-maxi-1-1.zip(371.45 KB)
  • v1.0(Apr 11, 2022)

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    windows / debian: sha256 hash base64: t7EPtruTZdsRGNuIANNDSYXVwUWFgHTdCIO8VEyP6tc= sha256 hash hex: b7b10fb6bb9365db1118db8800d3434985d5c145858074dd0883bc544c8fead7 macOS: sha256 hash base64: Q4lLUPeoG3bEMONwIa5+uS7iIyaV2Sh/e8eDz0wCvdU= sha256 hash hex: 43894b50f7a81b76c430e37021ae7eb92ee2232695d9287f7bc783cf4c02bdd5

    Changes

    • FIX: possible miscalculation on reinvest
    • run Lambda execution in a loop to retry ocean timeout errors
    • run vault-maxi locally
    • FIX: calculation of needed tokens in safety message (only telegram message was affected)
    • remove exposure on frozen vault

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    @DeFiPages : df1qa26988rj9xamw4tkanu7pthqshw6677vkasdg7

    Guide

    Here is the link

    What's Changed

    • retry every tx by @kuegi in https://github.com/kuegi/defichain_maxi/pull/21
    • run main in loop by @kuegi in https://github.com/kuegi/defichain_maxi/pull/22
    • run vault-maxi locally as main module by @DeFiPages in https://github.com/kuegi/defichain_maxi/pull/23
    • small fixes and polishing by @kuegi in https://github.com/kuegi/defichain_maxi/pull/24
    • activate remove exposure on frozen vault by @kuegi in https://github.com/kuegi/defichain_maxi/pull/27
    • changing zip filename to ensure updates are working by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/28

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v1.0-rc2...v1.0

    Source code(tar.gz)
    Source code(zip)
    vault-maxi-1-0.zip(370.95 KB)
  • v1.0-rc2(Mar 30, 2022)

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    windows / debian: sha256 hash: zXkfcAYnimZXcYfBavkW+zqSUphobhKf+5jll56GLEg= macOS: sha256 hash: JiK7JzB2d9Noko/1AqLce/O4JML1EGfOggFxcccR6Uw=

    Changes

    • allow immediate continuation after cleanup or reinvest if time allows
    • remove exposure completly when maxCollateral is set < 0
    • FIX: change limit on listPools -> now all pools should be possible
    • added way to deterministically build the result zip

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    @kuegi : df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07

    @Krysh90 : df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    @DeFiPages : df1qa26988rj9xamw4tkanu7pthqshw6677vkasdg7

    What's Changed

    • final polishing for release candidate by @kuegi in https://github.com/kuegi/defichain_maxi/pull/18
    • Create deterministic zip by @DeFiPages in https://github.com/kuegi/defichain_maxi/pull/19

    New Contributors

    • @DeFiPages made their first contribution in https://github.com/kuegi/defichain_maxi/pull/19

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v1.0-rc1b...v1.0-rc2

    Source code(tar.gz)
    Source code(zip)
    vault-maxi_1_0_rc2.zip(399.11 KB)
  • v1.0-rc1b(Mar 17, 2022)

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    Changes

    • added even more checks and log improvments
    • added possiblity to use privateKey from a bech32 address (obtained via defi-cli dumpprivkey <bech32address> )

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    kĂźgi: df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07 krysh: df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • Feature/checks and logs by @kuegi in https://github.com/kuegi/defichain_maxi/pull/14
    • Feature/additional wallet by @kuegi in https://github.com/kuegi/defichain_maxi/pull/15
    • [safetychecks] safe state after wait by @kuegi in https://github.com/kuegi/defichain_maxi/pull/16
    • [telegram] fix weird behaviour when no telegram can be sent by @kuegi in https://github.com/kuegi/defichain_maxi/pull/17

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v1.0--beta3...v1.0-rc1b

    Source code(tar.gz)
    Source code(zip)
  • v1.0-beta3(Mar 15, 2022)

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    Changes

    • reinvest now also uses UTXOs (always keeps at least 1 DFI in the wallet)
    • added clean-wallet functionality to use dust and commission too
    • added lots of safety checks and warnings
    • sending both tx within one block now (where possible) to improve speed and reduce chance of timeouts

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    kĂźgi: df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07 krysh: df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    What's Changed

    • Feature/safety override and clean wallet by @kuegi in https://github.com/kuegi/defichain_maxi/pull/10
    • [advancedUsage] added description for environment variables by @Krysh90 in https://github.com/kuegi/defichain_maxi/pull/11
    • Feature/both tx in one block by @kuegi in https://github.com/kuegi/defichain_maxi/pull/12
    • [Log] added motivational log for users by @kuegi in https://github.com/kuegi/defichain_maxi/pull/13

    Full Changelog: https://github.com/kuegi/defichain_maxi/compare/v1.0-beta2...v1.0-beta3

    Source code(tar.gz)
    Source code(zip)
  • v1.0-beta2(Mar 11, 2022)

    Vault Maxi via Ocean API

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. If the parameter is set, it even reinvests the rewards into your vault for automatic compounding.

    It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    Changes

    • added reinvest functionality
    • added safety checks and logs to reduce user errors
    • added cleanup in case the previous run timed out or had an error

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    kĂźgi: df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07 krysh: df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    Source code(tar.gz)
    Source code(zip)
  • v1.0-beta(Mar 7, 2022)

    This tool is made to optimize your defichain vault rewards by maximizing the amount of loans put into the liquidity mining of dTokens. You can define the thresholds for your collateralization ratio. if the collateral rises, the tool increases LM-exposure, if it falls it automatically decreases it. It is meant to be run as a lambda on AWS, using the ocean-api. Therefore it doesn't need a fullnode or any server maintenance (as opposed to the python version of this script).

    Disclaimer

    This is not financial advice and anyone using this tool is doing so at their own risk. Never invest more than you are ok to lose. We are using it ourselves but can’t guarantee that it’s working flawlessly in every edge case. We are not responsible for any lost funds.

    Donations

    We are developing this thing in our free time. Noone is paying us for it. If you benefit from our work, it would be a nice gesture to give something back. Here are our DFI donation addresses:

    kĂźgi: df1qqtlz4uw9w5s4pupwgucv4shl6atqw7xlz2wn07 krysh: df1qw2yusvjqctn6p4esyfm5ajgsu5ek8zddvhv8jm

    Source code(tar.gz)
    Source code(zip)
    vault-maxi.zip(1.01 MB)
Owner
kuegi
Mathematical Computerscientist, btc baby whale, quant, father ask me anything twitter: @mkuegi
kuegi
peace-performance (Rust) binding for python. To calculate star ratings and performance points for all osu! gamemodes

peace-performance-python Fast, To calculate star ratings and performance points for all osu! gamemodes peace-performance (Rust) binding for python bas

null 9 Sep 19, 2022
python scripts - mostly automation scripts

python python scripts - mostly automation scripts You can set your environment in various ways bash #!/bin/bash python - locally on remote host #!/bi

Enyi 1 Jan 5, 2022
DownTime-Score is a Small project aimed to Monitor the performance and the availabillity of a variety of the Vital and Critical Moroccan Web Portals

DownTime-Score DownTime-Score is a Small project aimed to Monitor the performance and the availabillity of a variety of the Vital and Critical Morocca

adnane-tebbaa 5 Apr 30, 2022
Performance data for WASM SIMD instructions.

WASM SIMD Data This repository contains code and data which can be used to generate a JSON file containing information about the WASM SIMD proposal. F

Evan Nemerson 5 Jul 24, 2022
This is an online course where you can learn and master the skill of low-level performance analysis and tuning.

Performance Ninja Class This is an online course where you can learn to find and fix low-level performance issues, for example CPU cache misses and br

Denis Bakhvalov 1.2k Dec 30, 2022
EasyBuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way.

EasyBuild is a software build and installation framework that allows you to manage (scientific) software on High Performance Computing (HPC) systems in an efficient way.

EasyBuild community 87 Dec 27, 2022
Developed a website to analyze and generate report of students based on the curriculum that represents student’s academic performance.

Developed a website to analyze and generate report of students based on the curriculum that represents student’s academic performance. We have developed the system such that, it will automatically parse data onto the database from excel file, which will in return reduce time consumption of analysis of data.

VIJETA CHAVHAN 3 Nov 8, 2022
An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures.

ngEHTexplorer An interactive tool with which to explore the possible imaging performance of candidate ngEHT architectures. Welcome! ngEHTexplorer is a

Avery Broderick 7 Jan 28, 2022
Terrible sudoku solver with spaghetti code and performance issues

SudokuSolver Terrible sudoku solver with spaghetti code and performance issues - if it's unable to figure out next step it will stop working, it never

Kamil Bizoń 1 Dec 5, 2021
Performance monitoring and testing of OpenStack

Browbeat Browbeat is a performance tuning and analysis tool for OpenStack. Browbeat is free, Open Source software. Analyze and tune your Cloud for opt

cloud-bulldozer 83 Dec 14, 2022
Collie is for uncovering RDMA NIC performance anomalies

Collie is for uncovering RDMA NIC performance anomalies. Overview Prerequ

Bytedance Inc. 34 Dec 11, 2022
Python based scripts for obtaining system information from Linux.

sysinfo Python based scripts for obtaining system information from Linux. Python2 and Python3 compatible Output in JSON format Simple scripts and exte

Petr Vavrin 70 Dec 20, 2022
Repo Home WPDrawBot - (Repo, Home, WP) A powerful programmatic 2D drawing application for MacOS X which generates graphics from Python scripts. (graphics, dev, mac)

DrawBot DrawBot is a powerful, free application for macOS that invites you to write Python scripts to generate two-dimensional graphics. The built-in

Frederik Berlaen 342 Dec 27, 2022
Web UI for your scripts with execution management

Script-server is a Web UI for scripts. As an administrator, you add your existing scripts into Script server and other users would be ab

Iaroslav Shepilov 1.1k Jan 9, 2023
Shell scripts made simple 🐚

zxpy Shell scripts made simple ?? Inspired by Google's zx, but made much simpler and more accessible using Python. Rationale Bash is cool, and it's ex

Tushar Sadhwani 492 Dec 27, 2022
Some scripts for the Reverse engineered (old) api of CafeBazaar

bazz Note: This project is done and published only for educational purposes. Some scripts for the Reverse engineered (old) API of CafeBazaar. Be aware

Mohsen Tahmasebi 35 Dec 25, 2022
A Curated Collection of Awesome Python Scripts

A Curated Collection of Awesome Python Scripts that will make you go wow. This repository will help you in getting those green squares. Hop in and enjoy the journey of open source. ??

Prathima Kadari 248 Dec 31, 2022
Automation of VASP DFT workflows with ASE - application scripts

This repo contains a library that aims at automatizing some Density Functional Theory (DFT) workflows in VASP by using the ASE toolkit.

Frank Niessen 5 Sep 6, 2022
A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv

poetry-exec-plugin A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv Installat

null 38 Jan 6, 2023