covr.Docs

SDK reference

SDK overview

@covrfun/maker-sdk is the TypeScript toolkit a market-making desk uses to quote covr's covered calls on Solana. It derives and decodes your on-chain accounts, builds every setup and settlement instruction, signs gateway messages with your quote key, does the exact USDC arithmetic the program does, and speaks the gateway's WebSocket protocol.

Install

sh
npm install @covrfun/maker-sdk

If your own code imports ethers or @solana/kit, install the exact versions the SDK depends on, so both share one copy:

sh
npm install ethers@6.17.0 @solana/kit@8.2.0
Package factValue
Version0.1.1
LicenseMIT. The license text ships as LICENSE.
Module formatES modules only ("type": "module"). Import it from an ES module project.
RuntimeNode.js 24 or later (engines.node: ">=24"). Node only: it uses node:crypto, node:assert and ws.
TypesBundled. No @types package needed.
Entry points@covrfun/maker-sdk, @covrfun/maker-sdk/vectors/golden-vectors.json, @covrfun/maker-sdk/package.json
Also shippedexamples/maker/index.ts and examples/maker/README.md (an example bot); examples/keeper/index.ts, examples/keeper/withdraw.ts and examples/keeper/README.md (an expiry keeper and a vault withdraw script); README.md; CHANGELOG.md
Dev toolingNone required. To run a .ts file directly, use node file.ts (Node 24 strips types) or install tsx (npm install -D tsx) and run npx tsx file.ts. Node does not strip types inside node_modules, so copy the example bot out before running it.

Runtime dependencies, pinned to exact versions (the source and the built package.json pin the same three):

DependencyVersionUsed for
@solana/kit8.2.0Addresses, PDAs, instruction types
ethers6.17.0EIP-712 hashing, signature recovery, TypedDataDomain
ws8.21.3Gateway WebSockets
Note

covr turns gateway access on per desk. covr's markets list only covr's own maker today, so your bid intents are verified exactly like real ones and then refused with Bid intent verified but not entered: this market does not list this maker yet (practice mode). Listing other desks is planned work. Desks quote JitoSOL ordinary markets; tokenized-stock (restricted) markets stay covr-only. Markets a desk creates are not shown to customers yet.

Cash-secured puts are not in this package

covr's program has run cash-secured puts since its 4 November 2026 upgrade. Version 0.1.1 has no put support: no builders for put setup or settlement, no put decoders, and no put quote signing. Until a release ships them, a desk cannot build put quotes or put setup with this SDK. covr's gateway does not route put RFQs to desks either, so today only covr's own maker quotes puts. When a release with put helpers ships is to confirm with covr. The on-chain put rules are in Program > Cash-secured puts.

Two things in 0.1.1 meet put accounts on chain:

  • decodeMarketV3 throws maker-sdk: unknown settlement mode 2 on a put market. Skip those markets if you scan every MarketV3 account.
  • decodePositionV3 throws PositionV3: timeout anchor on a put position.

covr's source also has an optional paymentMint on initializeVault, setPremiumBudget, deposit, withdraw and deriveVault, for vaults in a payment token other than USDC. It is not in 0.1.1 either. In 0.1.1 these functions handle USDC only.

Design principles

  • It builds and signs. It never prices. There is no pricing model and no default price anywhere. Every price is an argument you pass. exactPriceAtOrBelow only rounds your price to one the program can settle exactly.
  • It never holds keys. Signing functions take a TypedDataSigner: an ethers Wallet or your KMS or HSM adapter. Nothing loads a key from disk or the environment.
  • It never picks an RPC. No function reads the chain. You read accounts from your own RPC at finalized commitment, check their owner, and pass the bytes to the decoders.
  • It never submits. Builders return @solana/kit instructions. Your pipeline adds them to a transaction, signs with your Solana authority and sends.
  • No environment. The SDK reads no environment variable. Mainnet identities are literals in constants.
  • Exact or refuse. Amounts that the program would refuse make the SDK throw. Nothing is rounded except the protocol fee, which rounds down as the program does.
  • covr's own code. The decoders, the signers and most builders call the same code covr's own maker and gateway use. The vault, premium budget, deposit, withdraw and exposure-limit encoders, and the fresh writer account recipe of the exit helpers, are the SDK's own and are tested byte for byte against covr's.

The Deployment argument

Every function that derives, decodes or builds against a program address takes an optional last argument d: Deployment, defaulting to MAINNET. Pass another Deployment only for a local validator or tests.

ts
import { deriveMaker, MAINNET, type Deployment } from '@covrfun/maker-sdk';

declare const localProgramId: string; // a program you deployed to a local validator
const local: Deployment = { ...MAINNET, programAddress: localProgramId };

const onMainnet = await deriveMaker('0x7B99e6A7407Fe0058119F4f13494C0b9cec35738');
const onLocal = await deriveMaker('0x7B99e6A7407Fe0058119F4f13494C0b9cec35738', local);

The other program-facing functions take no d. quoteDomain, fillV3, exerciseV3, releaseV3, fundRestrictedExerciseV3, completePendingDeliveryV3, exerciseV3Instructions and releaseV3Instructions read the program and deployment from the decoded market you pass, so they follow the Deployment you decoded it with.

Note

Market decoding always requires the mainnet genesis hash and the mainnet USDC mint, exactly as the program does. A Deployment with another genesisHash cannot decode any market.

Every export

The package exports 93 values and 28 types.

Constants

NameKindPageWhat it is
PROGRAM_IDconstconstantsCovered-call program id on mainnet
DEPLOYMENT_IDconstconstants32-byte deployment identity in every signing domain
GENESIS_HASHconstconstantsSolana mainnet genesis hash
USDC_MINTconstconstantsThe payment mint
USDC_DECIMALSconstconstants6
JITOSOL_MINTconstconstantsJitoSOL mint, the collateral desks quote
JITO_STAKE_POOLconstconstantsExtra account every JitoSOL fill passes
TOKEN_PROGRAMconstconstantsSPL Token program
TOKEN_2022_PROGRAMconstconstantsToken-2022 program
CHAIN_IDconstconstantsEIP-712 chain id 2000000001
MAINNETconstconstantsDefault Deployment
EIP712_DOMAIN_BASEconstconstantsShared domain name, version, chain id
ORDINARY_TERMS_IDconstconstantsTerms id of ordinary markets
RESTRICTED_TERMS_IDconstconstantsTerms id of restricted markets
RESTRICTED_CANCELLATION_TIMEOUT_SECONDSconstconstants604800n, the only restricted timeout
REGISTRATION_SCOPEconstconstants'registration-v3'
assetAliasfunctionconstants20-byte wire alias of a mint
JITOSOL_ALIASconstconstantsJitoSOL wire alias
USDC_ALIASconstconstantsUSDC wire alias
GATEWAY_MAX_FRAME_BYTESconstconstants16384, largest gateway frame
COLLECT_MSconstconstants3000, bid collection window
AWARD_MSconstconstants3000, time to answer an award
TOTAL_MSconstconstants6000, auction hard deadline
REVIEW_SECONDSconstconstants60, longest quote life
DeploymentinterfacetypesProgram, deployment id and genesis an operation targets

Signing

NameKindPageWhat it is
assertCanonicalSignaturefunctionsigningThrows unless a signature is in the form the program accepts
TypedDataSignerinterfacesigningAny EIP-712 signer: ethers Wallet, KMS or HSM adapter

Setup

NameKindPageWhat it is
deriveMakerfunctionsetupMaker and MakerOriginV1 addresses of a quote key
decodeMakerfunctionsetupDecode your Maker account: minNonce, operator
deriveVaultfunctionsetupUSDC vault and PremiumBudget addresses
deriveExposurefunctionsetupExposure address for one collateral
deriveMintPolicyfunctionsetupMintPolicyV1 and MintUsageV1 addresses
deriveMarketfunctionsetupMarketV3 address from creator and salt
derivePositionfunctionsetupPositionV3 address of a quote nonce, plus its vaults
REGISTER_TYPESconstsetupEIP-712 types of the registration grant
registrationGrantDomainfunctionsetupEIP-712 domain of the registration grant
registrationGrantMessagefunctionsetupThe grant message for an authority
signRegistrationGrantfunctionsetupSign the registration grant with your quote key
registerMakerV3functionsetupBuild register_maker_v3
initializeVaultfunctionsetupBuild initialize_vault
setPremiumBudgetfunctionsetupBuild set_premium_budget
depositfunctionsetupBuild deposit (USDC into the vault)
withdrawfunctionsetupBuild withdraw (vault USDC to your account)
initializeExposureV3functionsetupBuild initialize_exposure_v3
setExposureLimitfunctionsetupBuild set_exposure_limit (classic SPL Token collateral)
mintPolicySettingsForfunctionsetupMint policy settings from a market and your caps
initializeMintPolicyV1functionsetupBuild initialize_mint_policy_v1
updateMintPolicyV1functionsetupBuild update_mint_policy_v1
pauseMintPolicyV1functionsetupBuild pause_mint_policy_v1 (authority or watcher)
decodeMintPolicyfunctionsetupDecode your MintPolicyV1: generation, settings
decodeMintUsagefunctionsetupDecode your MintUsageV1: open amounts, counters
bootstrapMintUsageV1functionsetupBuild bootstrap_mint_usage_v1
configureMakerfunctionsetupBuild configure_maker: operator and nonce floor
RegisterMakerV3InputinterfacetypesInput of registerMakerV3
CollateralIdentityinterfacetypesMint, token program and decimals
MintPolicySettingsV1interfacetypesMint policy caps and bindings
MintPolicyV1interfacetypesDecoded mint policy
MintUsageV1interfacetypesDecoded mint usage
SdkInstructiontypetypesInstruction with accounts and data
DecodedMakerAccounttypetypesDecoded Maker account

Markets

NameKindPageWhat it is
decodeMarketV3functionmarketsDecode and validate a MarketV3 account
quoteDomainfunctionmarketsEIP-712 domain of one decoded market
marketDomainfunctionmarketsDecode then domain, in one call
createMarketV3functionmarketsBuild create_market_v3
createRestrictedMarketV3functionmarketsBuild create_restricted_market_v3
DecodedMarketV3typetypesMarketV3 | RestrictedMarketV3
MarketV3interfacetypesOrdinary market terms
RestrictedMarketV3interfacetypesRestricted market terms
CreateMarketInputinterfacetypesInput of the market builders

Quoting

NameKindPageWhat it is
BID_INTENT_TYPESconstquotingEIP-712 types of a bid intent
QUOTE_V2_TYPESconstquotingEIP-712 types of a quote
WITHDRAW_TYPESconstquotingEIP-712 types of a withdrawal
auctionKeyfunctionquotingkeccak256 of an RFQ id
defaultIntentValidUntilfunctionquotingcovr's default intent expiry
buildBidIntentfunctionquotingUnsigned bid intent from an RFQ snapshot
buildQuotefunctionquotingUnsigned quote from your awarded intent
signIntentfunctionquotingSign a bid intent
signQuotefunctionquotingSign a quote
signWithdrawalfunctionquotingSign a quote withdrawal (route not served to desks)
BidIntentinterfacetypesSigned bid intent
QuoteV2interfacetypesSigned quote
UnsignedBidIntenttypetypesBid intent without signature
UnsignedQuoteV2typetypesQuote without signature
RfqRequesttypetypesRFQ instrument
RfqSnapshotinterfacetypesGET /api/rfqs/<id> body
AwardinterfacetypesAn award you hold

Settlement

NameKindPageWhat it is
strikePaymentfunctionsettlementUSDC atoms paid on exercise
grossPremiumfunctionsettlementUSDC atoms the vault pays at fill
feefunctionsettlementProtocol fee, rounded down
writerPremiumfunctionsettlementGross minus fee
priceForGrossfunctionsettlementThe exact price for a given gross
exactPriceAtOrBelowfunctionsettlementRound a model price down to an exact one
wireQuantityfunctionsettlementAtoms to 18-decimal wire quantity
atomsFromWirefunctionsettlementWire quantity to atoms
minimumExactLotfunctionsettlementSmallest exact size for a strike
settlementAmountsfunctionsettlementEvery amount of one fill
decodePositionV3functionsettlementDecode a PositionV3 account
fillV3functionsettlementBuild fill_v3 / fill_restricted_v3 (audit, simulate)
exerciseV3functionsettlementBuild exercise_v3
releaseV3functionsettlementBuild release_v3 / release_restricted_v3
fundRestrictedExerciseV3functionsettlementBuild fund_restricted_exercise_v3
completePendingDeliveryV3functionsettlementBuild complete_pending_delivery_v3
exerciseV3InstructionsfunctionsettlementEvery instruction of one exercise transaction (recommended)
releaseV3InstructionsfunctionsettlementEvery instruction of one release transaction (recommended)
WRITER_ACCOUNT_SPACEconstsettlement165, bytes of a token account without extensions
encodeCancellationRequestV1functionsettlementEncode a restricted cancellation request
decodeCancellationRequestV1functionsettlementDecode a restricted cancellation request
ORDINARY_V3_COMPUTE_UNIT_LIMITSconstsettlementCompute limits, ordinary instructions
RESTRICTED_V3_COMPUTE_UNIT_LIMITSconstsettlementCompute limits, restricted instructions
PositionV3interfacetypesDecoded position
PositionReadInputinterfacetypesInput of decodePositionV3
FillInputtypetypesInput of fillV3
FreshWriterAccountinterfacetypesA writer account an exit helper creates
CancellationRequestV1interfacetypesRestricted cancellation request

Gateway client

NameKindPageWhat it is
GatewayClientclassgateway clientFeed, /maker and RFQ reads
GatewayErrorclassgateway clientA refusal from the gateway
OutcomeUnknownErrorclassgateway clientA sent request whose reply never came
RFQ_NOTE_REASONSconstgateway clientReasons sendRfqNote accepts
GatewayEventtypegateway clientrfq, award, notice, closed
GatewayClientOptionsinterfacegateway clientOptions of connect
RfqNoteReasontypetypesOne of RFQ_NOTE_REASONS