Josh Hardy
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Rain Arb bot responsibilites These are the operational responsibilites for overseeing the bot performance, this is different from building and maintaining the bot software. ## Provisioning The arb bot consists of several components: - The arb bot client that submits transactions - An indexer that makes orders discoverable - A full node that exposes chain state to the bot All three are in scope for bot operations. We DO NOT operate bare metal instances of any of these. All services are either vendored (e.g. some paid RPC) or dockerized. Further, all "our" infrastructure is open sourced, explicitly with the intent that others can run their own instances in a permissionless manner. Therefore, the scope of provisioning "our" instances is limited to what can be simply and efficiently reproduced via. containerization (i.e. docker compose). ### Bot instances - Provisioning new bots - Updating bots to the latest versions of the software - Making sure changes are staged, in case of regression or unpredictable issues with new versions - Ensuring bot wallets have enough gas - Sweeping hot wallets for accrued tokens to cold wallets ### Subgraphs - Goldsky subgraph provisioning for supported subgraphs - Local nodes for subgraphs Goldsky does not support - Subgraph data size reporting - Subgraph availability reporting - Backup / redunancy planning for subgraphs e.g. hosted graph service ### Nodes @todo ## Monitoring The golden rule of monitoring is that we know about issues before our users do. The first time we discover an infrastructure issue cannot be because someone else reported it to us. ### Metrics We need simple and effective metrics that encompass as many possible failure modes as possible. This forms a definition of "uptime" that we use to objectively define "better" and "worse". - how many blocks elapsed between opportunity and execution? - how often does our execution succeed? The first tells us whether we are effectively clearing user's strategies. The best possible outcome is that we clear a transaction in the first block that it is clearable, a score of `0`. The worst possible outcome is complete failure to clear, a score of "infinity". Many strategies are time sensitive, so delays literally equate to funds loss. Consider a dutch auction that is reducing its price every block. Failing to clear the auction when valid liquidity exists is literally draining the owner's vault. The second metric tells us how well we are submitting transactions in the face of flakey RPCs, MEV front running, etc. High failure rates can cause opp/exec delays, and even cost gas for the bot due to reverts. Once we are quantifying the above with real data, we can establish baselines, SLA expectations and iteratively improve infrastructure against objective measurements. ### Alerts Once we have established baseline expectations of our infrastructure, any exceptions that fall outside expectations need to alert us. Alerts need to be timely, high signal/noise and actionable. Setting up a TG channel that spams all activity is not helpful as it quickly becomes a firehose that nobody pays attention to. Alerts need to have very low false positive and false positive rates, so that if one is ever raised we immediately and reliably triage it. Examples of potential alerts: - Bot down alert over telegram and email - Subgraph down alert over telegram and email - Bot price alert where account is overrunning - Subgraph price alert where account is overrunning - Bot gas balance alert ### Dashboards Creating and maintaining dashboards for - Network health - Orders cleared e.g. number and volume of transactions by time period, network, token - Gas balances of all bot wallets ## Forensics Once an issue is discovered by our monitoring systems we need to be able to reliably reproduce it. Reproduction is always the first step towards diagnosing and solving any issue. Failure to reproduce means failure to solve. As we work with blockchain, we have a super power in the form of fork testing. As long as we log every attempted interaction with the chain, we can always reproduce the chain state in that moment. Offchain reproductions are more difficult, with perhaps more subjective and onerous logging requirements. Therefore, as much as possible should be lifted onchain for all bot operations. Where this is not possible, additional logs will need to be included for future forensics. Log retention/rotation, scrubbing, efficiency, storage policy, etc. all fall under forensics responsibilities. Example forensics tasks include: - Make sure logs are capturing right information adjusting as required - Reduce log size as much as possible without compromising accurate information - Monitor logs to performance issues - Manage hyperdx account and payment plan - Ensure logs contain enough information to investigate any potential issues that oculd occur ## Triage 🚨 **Issues related to our subgraph or bot network could cause real funds loss for our users, therefore they take priority over all other work** 🚨 Because of this, even if an issue is merely _suspected_, it must be taken seriously and steps taken to prove or disprove the hypothesis. If there is a suspected issue that cannot be resolved by inspecting logs, a fork test will be required. Potential issues could be: - An order that should have cleared because the market appeared to allow for it - Reverts - Orders not being picked up at all - Vault balances disappearing quickly ### Scoring and prioritising We need an objective way to score issues as they arise, based on high level criteria. An example is the CVSS https://en.wikipedia.org/wiki/Common_Vulnerability_Scoring_System system for security vulnerabilities which has been widely applied to many IT systems. The CVSS isn't exactly what we need for this infrastructure, but we can adapt it relatively easily to suit our needs. All issues need to be immediately documented in our project management system (e.g. on kanban), scored and prioritised according to the score. All issues that hit a high/critical score threshold MUST be treated as "tools down" priority and take precedence over other responsibilities such as BAU development work.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully