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

Asset
CarrotEvent
CarrotEventMetadata
ChestStrategyType
DistributeVaultFeesEvent
DriftInsuranceFundStrategyType
DriftSupplyStrategyType
Fee
IssueEvent
KlendSupplyStrategyType
MangoSupplyStrategyType
MarginfiSupplyStrategyType
RebalanceRequest
RebalanceUpdate
RedeemEvent
ReserveAPY
SolendReserveAccounts
SolendSupplyStrategyType
Strategy
StrategyAPY
StrategyEvent
StrategyMetadata
StrategyRecord
UpdateSwitchboardOraclePriceEvent
Vault
VaultPerformance

Type Aliases

Carrot
CarrotsEventKind
RebalanceAction
StrategyType

Variables

CARROT_PROGRAM_ID
CARROT_PROGRAM_LOG_ID
CHEST_PROGRAM_ID
DRIFT_PROGRAM_ID
DRIFT_VAULTS_PROGRAM_ID
IDL
KLEND_FARMS_PROGRAM_ID
KLEND_PROGRAM_ID
MANGO_PROGRAM_ID
MARGINFI_PROGRAM_ID
SOLEND_PROGRAM_ID
SWITCHBOARD_ON_DEMAND_PROGRAM_ID

Functions

adjustSharesByFees
amountToUi
amountToUsd
calculatePerformanceFee
calculatePerformanceFeeForStrategy
calculateVaultAPY
calculateWeights
convertSharesToAsset
formatStrategyType
getStrategyPda
getVaultPda
nav
newChestStrategyType
newDriftInsuranceFundStrategyType
newDriftSupplyStrategyType
newKlendSupplyStrategyType
newMangoSupplyStrategyType
newMarginfiSupplyStrategyType
newSolendSupplyStrategyType
sharesEarned
tvl
uiToAmount
usdEarned
usdToAmount