GithubHelp home page GithubHelp logo

od-bot's People

Contributors

alekseevaiana avatar dependabot[bot] avatar jahabeebs avatar pi0neerpat avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

od-bot's Issues

Mainnet gas settings

Related to #68

The payer wallet is not able to send gas to the bot wallet. This is likely due to the gas settings for optimism. We need to address this, and also update the gas settings for Arbitrum so we don't have the same issue there.

QA: Analytics

Analytics

image

  • Remove collateral borrow rate, since this is duplicated with stability fee
  • Add oracle links for collateral
  • Add safety and liquidation ratios
  • Add oracle for OD

Add delay to /oracle

Due to the block timing issue on goerli arbitrum, we need to add a delay when sending back-to-back updateCollateralPrice to prevent those from failing

Add chart to bot

  • create a function to screenshot the charts
  • Return the screenshot in the updateRate call for the bot

Liquidation Bot: deployment and data storage

  1. store tx hashes and data like the amount of tokens and which type of token in a db for integration with discord later
  2. deploy liquidation bot code to vercel or render or somewhere else
  3. schedule cron or server to run every hour

Additional auctions data

Add additional data to auction metrics:

  • Accounting engine coin balance: safeEngine.coinbalance(accountingEngine)
  • Accounting engine debt balance: safeEngine.debtBalance(accountingEngine)
  • Accounting engine surplus: coinBalance-debtBalance

image

Deploy public bot

  • Create new bot in discord dev portal
  • Get slash command bot running publicly
  • Add to discord server
  • Deploy bot backend to bot.opendollar
  • Update readmes
  • Update domain routing to bot.

Add support for production contracts

  • Update the SDK
  • Modify the /rate and /analytics endpoints to check if ENVIRONMENT=prod and set the network to arbitrum
  • Add funds to the Payer 0x30E6D104C87AEf61C9ca861e84Fa4723d224d52c

Filter data by network

  • /pages/api/graphql query should allow filtering by network
  • ARBITRUM, ARBITRUM_SEPOLIA, OPTIMISM
  • Queries for chart data should also be filtered by network
  • Reset supabase database (can delete all data in od-bots project)

Cooldown for nonce errors

Add a 2 minute cooldown to all operations which submit transactions

This will prevent Nonce errors from causing the operation to fail

Create graphs

  • erc20Supply
  • marketPrice
  • globalDebt
  • globalDebtUtilization (show percentage)
  • surplusInTreasury
  • redemptionRate and redemptionPrice should be shown on the same graph

Notes:

  • To generate data for your local app: run yarn test a few times
  • blockTimestamp must be multiplied by 1000 before converting to a javascript date

Rate Setter

set the redemption rate with updateRate via the Rate Setter contract
Screen Shot 2023-08-15 at 10 00 14 AM

Cleanup Bot UI

  • Remove section "Trigger the bot"
  • Make table and chart more readable
  • Add Header/Footer
  • Match OD colors/branding
  • Should have tabs to show both testnet and mainnet stats. Depends on #63

ESM threshold setter and tax collector bot

Screen Shot 2023-08-15 at 9 50 27 AM

collect taxes and calculate fees on the protocol. Reflexer should should have a version of this. it can be set as a cron job that runs every so often.

  • decide low often to calculate
  • calculate the $ taxes collected vs the cost of calling

Gas fee update

updateCollateralPrice is costing us $0.35 https://optimistic.etherscan.io/tx/0xc119ecc015d6f28a4e85b081bb0ea308b3f927bfc0bf4742171ab356f2187be1 with the bot

however when people are calling it using the job contract, which actually performs three actions in one single step, they are only paying $0.06 total https://optimistic.etherscan.io/tx/0x4caa233fe6701e80e1f4777a1ec46987ed4e1d740fb33e637a3e9475a380487a

  • Determine if our gas settings need to be modified to avoid overpaying
  • Determine if we should instead use the job contracts with the bot, instead of calling the functions directly.

Add gas balance to error messages

Currently oracle update errors don't show gas balance for the bot.
The bot is out of gas because the send tx for optimism is failing (gas settings maybe?)

  • Update error messages to include the gas balance

image

Liquidation Bot

https://github.com/reflexer-labs/auction-keeper
Screen Shot 2023-08-15 at 9 42 09 AM

what: liquidates underwater safes, bids on surplus
how: collateral auction house interactions
result: user collateral in safes is bought via bids and sold to the market for profit.
why: keeping the protocol free of bad debt and settling surplus tokens

https://www.figma.com/file/cipzwfeTSmY1T4pB6ppt5M/GEB-Diagram---NFT-Strategy?type=whiteboard&node-id=0-1&t=TK8jUtnhmNjr2ytD-0
https://docs.reflexer.finance/

regular geb with no changes:
https://www.figma.com/file/5GL7lVwqNeNKIcANCgCJjl/GEB-Diagram-Share?type=whiteboard&t=OjxAndc4U2uYbHVq-0

Add /claim

  • For /user [0xAddress] and /claim [0xAddress], the token balance should be read after the tokens are airdropped. Right now its done before
  • Add a note to try claim again if it didn't work the first time
  • Update the amount of collateral to drop to be based on the decimals of the token
  • Update note to refresh the app
    Related to #28

Rate Setter updating bot

A user can call updateResult on the Rate Setter contract to re-calculate the redemption price. This should be called at least once an hour. This also updates the result of the current market price (as the protocol understands it) based on the pool that is being tracked, initially OD/ETH. When the market rate is above/below target, then the redemption rate is set as a reflex

image

Should output data related to what the redemption price over time.

Fix node v16 requirement

Vercel deprecates node 16 deployments in February. Update to be compatible with node 18

➤ YN0000: │ /tmp/xfs-03592262 STDERR error [email protected]: The engine "node" is incompatible with this module. Expected version "^12.0.0 || ^14.0.0 || ^16.0.0". Got "18.17.1"

/price improvements

  • remove need to call it twice?
  • Add instructions for needing to call it twice?
  • Add restrictions that the resulting price can only be within 50% of the current price

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.