Overview

Typescript libraries related to protocol operations

  • Houses various types, hardcoded shared values, basic math functions, program idl
  • dont pull this in directly, its a dependency of the clients
  • used to interface with the carrot API
  • used to read on chain data via validator rpc
  • used to create and send txns to carrot protocol program
  • code that interacts with yield sources
cd lib/

# build all packages
make

# fmt
make fmt

# update docs
make build_docs

# look at your changes locally
make serve_docs;

Interfaces

DriftUserPerpPositionData
DriftUserPositionData
DriftUserSpotPositionData
RateCompressionCalculationParams

Type Aliases

DriftPerpPositionDirection
DriftSpotPositionBalanceType

Functions

calculateDriftRateCompression
calculateKlendRateCompression
calculateMangoRateCompression
calculateMarginfiRateCompression
calculateSolendRateCompression
createSwitchboardFeedIx
createSwitchboardQueueIx
getDriftApy
getDriftBalance
getDriftClient
getDriftEmissionsApy
getDriftInsuranceFundApy
getDriftPyusdEmissionsPerDay
getDriftSpotMarket
getDriftUserPositions
getDriftVaultApy
getKlendApy
getKlendEmissionsApy
getKlendMarket
getKlendObligationAddress
getKlendReserve
getMangoApy
getMangoBalance
getMangoBank
getMarginfiApy
getMarginfiBalance
getMarginfiBank
getMarginfiClient
getMarginfiEmissionsApy
getSolendApy
getSolendBalance
getSolendReserve
getSwitchboardFeed