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
npm install @covrfun/maker-sdkIf your own code imports ethers or @solana/kit, install the exact versions the SDK depends on, so both share one copy:
npm install ethers@6.17.0 @solana/kit@8.2.0| Package fact | Value |
|---|---|
| Version | 0.1.1 |
| License | MIT. The license text ships as LICENSE. |
| Module format | ES modules only ("type": "module"). Import it from an ES module project. |
| Runtime | Node.js 24 or later (engines.node: ">=24"). Node only: it uses node:crypto, node:assert and ws. |
| Types | Bundled. No @types package needed. |
| Entry points | @covrfun/maker-sdk, @covrfun/maker-sdk/vectors/golden-vectors.json, @covrfun/maker-sdk/package.json |
| Also shipped | examples/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 tooling | None 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):
| Dependency | Version | Used for |
|---|---|---|
@solana/kit | 8.2.0 | Addresses, PDAs, instruction types |
ethers | 6.17.0 | EIP-712 hashing, signature recovery, TypedDataDomain |
ws | 8.21.3 | Gateway WebSockets |
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:
decodeMarketV3throwsmaker-sdk: unknown settlement mode 2on a put market. Skip those markets if you scan every MarketV3 account.decodePositionV3throwsPositionV3: timeout anchoron 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.
exactPriceAtOrBelowonly rounds your price to one the program can settle exactly. - It never holds keys. Signing functions take a
TypedDataSigner: an ethersWalletor 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/kitinstructions. 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.
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);Takes d | Uses |
|---|---|
deriveMaker, decodeMaker, deriveVault, deriveExposure, deriveMintPolicy, deriveMarket, derivePosition | programAddress |
initializeVault, setPremiumBudget, deposit, withdraw, initializeExposureV3, setExposureLimit, initializeMintPolicyV1, updateMintPolicyV1, pauseMintPolicyV1, decodeMintPolicy, decodeMintUsage, bootstrapMintUsageV1, configureMaker, createMarketV3, createRestrictedMarketV3 | programAddress |
registrationGrantDomain, signRegistrationGrant, registerMakerV3 | programAddress, deploymentId |
decodeMarketV3, marketDomain, decodePositionV3 | programAddress, deploymentId, genesisHash |
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.
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
| Name | Kind | Page | What it is |
|---|---|---|---|
PROGRAM_ID | const | constants | Covered-call program id on mainnet |
DEPLOYMENT_ID | const | constants | 32-byte deployment identity in every signing domain |
GENESIS_HASH | const | constants | Solana mainnet genesis hash |
USDC_MINT | const | constants | The payment mint |
USDC_DECIMALS | const | constants | 6 |
JITOSOL_MINT | const | constants | JitoSOL mint, the collateral desks quote |
JITO_STAKE_POOL | const | constants | Extra account every JitoSOL fill passes |
TOKEN_PROGRAM | const | constants | SPL Token program |
TOKEN_2022_PROGRAM | const | constants | Token-2022 program |
CHAIN_ID | const | constants | EIP-712 chain id 2000000001 |
MAINNET | const | constants | Default Deployment |
EIP712_DOMAIN_BASE | const | constants | Shared domain name, version, chain id |
ORDINARY_TERMS_ID | const | constants | Terms id of ordinary markets |
RESTRICTED_TERMS_ID | const | constants | Terms id of restricted markets |
RESTRICTED_CANCELLATION_TIMEOUT_SECONDS | const | constants | 604800n, the only restricted timeout |
REGISTRATION_SCOPE | const | constants | 'registration-v3' |
assetAlias | function | constants | 20-byte wire alias of a mint |
JITOSOL_ALIAS | const | constants | JitoSOL wire alias |
USDC_ALIAS | const | constants | USDC wire alias |
GATEWAY_MAX_FRAME_BYTES | const | constants | 16384, largest gateway frame |
COLLECT_MS | const | constants | 3000, bid collection window |
AWARD_MS | const | constants | 3000, time to answer an award |
TOTAL_MS | const | constants | 6000, auction hard deadline |
REVIEW_SECONDS | const | constants | 60, longest quote life |
Deployment | interface | types | Program, deployment id and genesis an operation targets |
Signing
| Name | Kind | Page | What it is |
|---|---|---|---|
assertCanonicalSignature | function | signing | Throws unless a signature is in the form the program accepts |
TypedDataSigner | interface | signing | Any EIP-712 signer: ethers Wallet, KMS or HSM adapter |
Setup
| Name | Kind | Page | What it is |
|---|---|---|---|
deriveMaker | function | setup | Maker and MakerOriginV1 addresses of a quote key |
decodeMaker | function | setup | Decode your Maker account: minNonce, operator |
deriveVault | function | setup | USDC vault and PremiumBudget addresses |
deriveExposure | function | setup | Exposure address for one collateral |
deriveMintPolicy | function | setup | MintPolicyV1 and MintUsageV1 addresses |
deriveMarket | function | setup | MarketV3 address from creator and salt |
derivePosition | function | setup | PositionV3 address of a quote nonce, plus its vaults |
REGISTER_TYPES | const | setup | EIP-712 types of the registration grant |
registrationGrantDomain | function | setup | EIP-712 domain of the registration grant |
registrationGrantMessage | function | setup | The grant message for an authority |
signRegistrationGrant | function | setup | Sign the registration grant with your quote key |
registerMakerV3 | function | setup | Build register_maker_v3 |
initializeVault | function | setup | Build initialize_vault |
setPremiumBudget | function | setup | Build set_premium_budget |
deposit | function | setup | Build deposit (USDC into the vault) |
withdraw | function | setup | Build withdraw (vault USDC to your account) |
initializeExposureV3 | function | setup | Build initialize_exposure_v3 |
setExposureLimit | function | setup | Build set_exposure_limit (classic SPL Token collateral) |
mintPolicySettingsFor | function | setup | Mint policy settings from a market and your caps |
initializeMintPolicyV1 | function | setup | Build initialize_mint_policy_v1 |
updateMintPolicyV1 | function | setup | Build update_mint_policy_v1 |
pauseMintPolicyV1 | function | setup | Build pause_mint_policy_v1 (authority or watcher) |
decodeMintPolicy | function | setup | Decode your MintPolicyV1: generation, settings |
decodeMintUsage | function | setup | Decode your MintUsageV1: open amounts, counters |
bootstrapMintUsageV1 | function | setup | Build bootstrap_mint_usage_v1 |
configureMaker | function | setup | Build configure_maker: operator and nonce floor |
RegisterMakerV3Input | interface | types | Input of registerMakerV3 |
CollateralIdentity | interface | types | Mint, token program and decimals |
MintPolicySettingsV1 | interface | types | Mint policy caps and bindings |
MintPolicyV1 | interface | types | Decoded mint policy |
MintUsageV1 | interface | types | Decoded mint usage |
SdkInstruction | type | types | Instruction with accounts and data |
DecodedMakerAccount | type | types | Decoded Maker account |
Markets
| Name | Kind | Page | What it is |
|---|---|---|---|
decodeMarketV3 | function | markets | Decode and validate a MarketV3 account |
quoteDomain | function | markets | EIP-712 domain of one decoded market |
marketDomain | function | markets | Decode then domain, in one call |
createMarketV3 | function | markets | Build create_market_v3 |
createRestrictedMarketV3 | function | markets | Build create_restricted_market_v3 |
DecodedMarketV3 | type | types | MarketV3 | RestrictedMarketV3 |
MarketV3 | interface | types | Ordinary market terms |
RestrictedMarketV3 | interface | types | Restricted market terms |
CreateMarketInput | interface | types | Input of the market builders |
Quoting
| Name | Kind | Page | What it is |
|---|---|---|---|
BID_INTENT_TYPES | const | quoting | EIP-712 types of a bid intent |
QUOTE_V2_TYPES | const | quoting | EIP-712 types of a quote |
WITHDRAW_TYPES | const | quoting | EIP-712 types of a withdrawal |
auctionKey | function | quoting | keccak256 of an RFQ id |
defaultIntentValidUntil | function | quoting | covr's default intent expiry |
buildBidIntent | function | quoting | Unsigned bid intent from an RFQ snapshot |
buildQuote | function | quoting | Unsigned quote from your awarded intent |
signIntent | function | quoting | Sign a bid intent |
signQuote | function | quoting | Sign a quote |
signWithdrawal | function | quoting | Sign a quote withdrawal (route not served to desks) |
BidIntent | interface | types | Signed bid intent |
QuoteV2 | interface | types | Signed quote |
UnsignedBidIntent | type | types | Bid intent without signature |
UnsignedQuoteV2 | type | types | Quote without signature |
RfqRequest | type | types | RFQ instrument |
RfqSnapshot | interface | types | GET /api/rfqs/<id> body |
Award | interface | types | An award you hold |
Settlement
| Name | Kind | Page | What it is |
|---|---|---|---|
strikePayment | function | settlement | USDC atoms paid on exercise |
grossPremium | function | settlement | USDC atoms the vault pays at fill |
fee | function | settlement | Protocol fee, rounded down |
writerPremium | function | settlement | Gross minus fee |
priceForGross | function | settlement | The exact price for a given gross |
exactPriceAtOrBelow | function | settlement | Round a model price down to an exact one |
wireQuantity | function | settlement | Atoms to 18-decimal wire quantity |
atomsFromWire | function | settlement | Wire quantity to atoms |
minimumExactLot | function | settlement | Smallest exact size for a strike |
settlementAmounts | function | settlement | Every amount of one fill |
decodePositionV3 | function | settlement | Decode a PositionV3 account |
fillV3 | function | settlement | Build fill_v3 / fill_restricted_v3 (audit, simulate) |
exerciseV3 | function | settlement | Build exercise_v3 |
releaseV3 | function | settlement | Build release_v3 / release_restricted_v3 |
fundRestrictedExerciseV3 | function | settlement | Build fund_restricted_exercise_v3 |
completePendingDeliveryV3 | function | settlement | Build complete_pending_delivery_v3 |
exerciseV3Instructions | function | settlement | Every instruction of one exercise transaction (recommended) |
releaseV3Instructions | function | settlement | Every instruction of one release transaction (recommended) |
WRITER_ACCOUNT_SPACE | const | settlement | 165, bytes of a token account without extensions |
encodeCancellationRequestV1 | function | settlement | Encode a restricted cancellation request |
decodeCancellationRequestV1 | function | settlement | Decode a restricted cancellation request |
ORDINARY_V3_COMPUTE_UNIT_LIMITS | const | settlement | Compute limits, ordinary instructions |
RESTRICTED_V3_COMPUTE_UNIT_LIMITS | const | settlement | Compute limits, restricted instructions |
PositionV3 | interface | types | Decoded position |
PositionReadInput | interface | types | Input of decodePositionV3 |
FillInput | type | types | Input of fillV3 |
FreshWriterAccount | interface | types | A writer account an exit helper creates |
CancellationRequestV1 | interface | types | Restricted cancellation request |
Gateway client
| Name | Kind | Page | What it is |
|---|---|---|---|
GatewayClient | class | gateway client | Feed, /maker and RFQ reads |
GatewayError | class | gateway client | A refusal from the gateway |
OutcomeUnknownError | class | gateway client | A sent request whose reply never came |
RFQ_NOTE_REASONS | const | gateway client | Reasons sendRfqNote accepts |
GatewayEvent | type | gateway client | rfq, award, notice, closed |
GatewayClientOptions | interface | gateway client | Options of connect |
RfqNoteReason | type | types | One of RFQ_NOTE_REASONS |