Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document and apply process of using canary strats to test bot operation #199

Open
thedavidmeister opened this issue Sep 7, 2024 · 1 comment · May be fixed by rainlanguage/rain.orderbook#881
Assignees

Comments

@thedavidmeister
Copy link
Contributor

thedavidmeister commented Sep 7, 2024

there's a canary strat at https://github.com/rainlanguage/rain.dex.pubstrats/blob/main/src/infra/canary.rain

basically it sets a non-zero amount with a 0 io ratio

this means that the strat just gives money to the bot unconditionally

there's a timer on the ensure so it doesn't insta-drain itself

this can be used to check that the bot clears, e.g. after making changes or bringing up a new bot etc. to make sure that the infra is working correctly

we should document that and use it, as it should work on any/every network

Edit

  • what it does and purpose
    canary is a simple order that sets a non-zero amount with a 0 io ratio, this means that the strat just gives money to the bot unconditionally, there's a timer on the ensure so it doesn't insta-drain itself, this can be used to check that the bot clears, e.g. after making changes or bringing up a new bot etc. to make sure that the infra is working correctly.
  • where to find the strat
    https://github.com/rainlanguage/rain.dex.pubstrats/blob/main/src/infra/canary.rain
  • anything extra to set up
    canary orders are like any other orders, but they clear every hour (or whatever cooldown period is set for it) so if they happen to not clear for any reason the exec kpi alert will go off if that happens a few times in an hour,
    the exec kpi checks the unsuccessful transactions, and as its clears when there are many failed transactions in a row in a short timespan, that indictaes something is probably not right and needs attention. besides these there is nothing special about canaries, now that bot has self fudning owned vaults option, one can specify the canary vault in the bot's env vars and bot will redeposit into the specified vault once the it goes below the specified threshold, this is not specific to canaries, but any vault can be set to be refunded. for more info about this, check bot's README, but can simply set self fund vaults by follwoing example:
SELF_FUND_ORDERS=token,vaultId,threshold,toptupamount;token,vaultId,threshold,toptupamount

Edit2:

deployed canaries:
owner: rain mnemonic main acc: 0x7177b9d00bb5dbcaaf069cc63190902763783b09

base: 0x4cd90ef4fbfc29b896f311f789de0c5cfb073c8ef187c2593ac2b95e4c28d990
matchain: 0x58047d4981a5db938182674b1690f2f187a8299802f6584a47231cd38efcff4d

@rouzwelt
Copy link
Collaborator

rouzwelt commented Sep 15, 2024

owner: rain mnemonic main acc: 0x7177b9d00bb5dbcaaf069cc63190902763783b09

base: 0x4cd90ef4fbfc29b896f311f789de0c5cfb073c8ef187c2593ac2b95e4c28d990
matchain: 0x11281dfd0f45a7c83d86cfd9caa1c392edcb75e63009f1314f6f1f8ff1931422

Edit: needs funds in their vaults

@rouzwelt rouzwelt linked a pull request Sep 23, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants