go-compound

go-compound is a Golang client, and library for interacting with the compound.finace API, and interacting with the compound contracts, allowing for the creation of bots trading with the Compound protocol.

Contents

  • abi contains json abi definitions for various compound smart contracts
  • bindigns contains abigen generated golang bindings for the various abi's
  • client contains a client library to build applications that use the compound.finance API and interact with the smart contracts
  • cmd contains a small command-line client
  • models contains Golang types for the various responses that the API gives. Currently it has types for CTokenService and AccountService responses.
  • pb contains protobuf definitions for the compound APIs. Do not use
  • sampler contains sampler configurations to enable console based monitoring of your compound accounts

Current Capabilities

APIs

Client Library

  • Access to APIs via Golang programs, and not having to deal with raw http calls
  • Watch account health, signalling and printing on different account health states
  • Retrieve supply interest earned for a particular token
  • Retrieve total supply interest earned
  • Retrieve borrow interest owed for a particular token
  • Borrow from any compound contract
  • Get borrow rate for any compound contract
  • Retrieve list of liquidatable addresses

CLI

  • Pretty print full AccountService::AccountResponse information, suitable for piping to jq
  • Retrieve account health
  • Retrieve supply interest earned for a particular token
  • Retrieve total supply interest earned
  • Retrieve borrow interest owed for a particular token
  • Retrieve a list of addresses that can be liquidated

Monitoring

  • Enables monitoring your account with sampler.
  • Default sampler config located in sampler/sampler.yml however you'll need to replace the addresses as needed.

Long Term Goals

  • Enable persisting retrieve data locally in a DB for fast lookups
  • Enable report generation of your holdings
  • Enable the MarketHistoryService API
  • Enable graphing of MarketHistoryService metrics
  • Enable arbitrage between uniswap and compound
    • Enable things like spotting interest rate arbitrages
    • Repayment arbitrages

GitHub

https://github.com/bonedaddy/go-compound