covr.Docs

SDK reference

Constants

Public mainnet identities, signing-domain inputs and gateway timing that the SDK exports. Every value here is a literal or is computed once when the module loads. Nothing reads the environment, an RPC or a key.

Summary

NameValueType
PROGRAM_ID8ZpbTPnDECPTDGN5VHHKH5gfer6EUTnRHcFwfUAbkJDgstring
DEPLOYMENT_ID0x13a01f9d69929d8b65db7e9a6cc0805075876a8a66664e4ef30dd26f635527e2string
GENESIS_HASH5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9dstring
USDC_MINTEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1vstring
USDC_DECIMALS6number
JITOSOL_MINTJ1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPnstring
JITO_STAKE_POOLJito4APyf642JPZPx3hGc6WWJ8zPKtRbRs4P815Awbbstring
TOKEN_PROGRAMTokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DAstring
TOKEN_2022_PROGRAMTokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEbliteral type
CHAIN_ID2000000001number
MAINNET{ programAddress, deploymentId, genesisHash }Deployment
EIP712_DOMAIN_BASE{ name: 'SOL Covered Calls', version: '1', chainId: 2000000001 }Readonly<{...}>
ORDINARY_TERMS_ID0xddae69a8d6ba258eb6501331627a583ee6951df68af6a50760d0a038c0a8379dstring
RESTRICTED_TERMS_ID0xeedfb6068a9b748d45b3341000c743a4b758460d05a852c8473e9fa0469bd7e1string
RESTRICTED_CANCELLATION_TIMEOUT_SECONDS604800nbigint
REGISTRATION_SCOPE'registration-v3'string
assetAliasfunction(mint: string) => string
JITOSOL_ALIAS0x43127405c3191a0b63a5f3d845f616ffea348c68string
USDC_ALIAS0x5ce3bf3a31af18be40ba30f721101b4341690186string
GATEWAY_MAX_FRAME_BYTES1638416384
COLLECT_MS30003000
AWARD_MS30003000
TOTAL_MS60006000
REVIEW_SECONDS6060

PROGRAM_ID

The covered-call program on Solana mainnet. Every builder targets it unless you pass another Deployment.

ts
export declare const PROGRAM_ID: string;
  • Value: 8ZpbTPnDECPTDGN5VHHKH5gfer6EUTnRHcFwfUAbkJDg
  • Meaning: owner of every Maker, MakerOriginV1, MarketV3, PositionV3, Exposure, PremiumBudget, MintPolicyV1 and MintUsageV1 account the SDK derives. Vaults are different: your USDC vault, each position's collateral vault and its strike escrow are SPL token accounts owned by their token program, with a program-derived address as token authority (your Maker account for the USDC vault).
  • Where it matters: check that every account you read (Maker, MarketV3, PositionV3) is owned by this address before you decode it. The decoders do not see the account owner.
Warning

The program is upgradeable. Read its upgrade authority from the program's ProgramData account before you fund a maker vault.

ts
import { PROGRAM_ID } from '@covrfun/maker-sdk';

declare const account: { owner: string; data: Uint8Array } | null;

if (!account || account.owner !== PROGRAM_ID) throw new Error('not a covr program account');

DEPLOYMENT_ID

The 32-byte deployment identity bound into every EIP-712 verifyingContract and stored in every MarketV3 account (bytes 237 to 269).

ts
export declare const DEPLOYMENT_ID: string;
  • Value: 0x13a01f9d69929d8b65db7e9a6cc0805075876a8a66664e4ef30dd26f635527e2
  • Meaning: separates this deployment's signatures from any other deployment of the same code. A grant or quote signed for one deployment never verifies on another.
  • Where it matters: registrationGrantDomain, quoteDomain and decodeMarketV3, which refuses a market whose stored deployment id differs.

GENESIS_HASH

Solana mainnet's genesis hash.

ts
export declare const GENESIS_HASH: string;
  • Value: 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d
  • Meaning: every MarketV3 and PositionV3 account stores it. The decoders require it.
  • Where it matters: decodeMarketV3 refuses any market whose stored genesis is not this value, even if you pass a Deployment with another genesisHash. The program pins the same value.

USDC_MINT

The payment mint of every covered-call market, and the only one this SDK version handles. Premiums, fees and strikes of calls are all paid in it. Put markets, which 0.1.1 does not support, name their own payment mint.

ts
export declare const USDC_MINT: string;
  • Value: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
  • Where it matters: your maker vault holds this mint. deposit moves it from your own token account.

USDC_DECIMALS

Decimals of USDC_MINT. One USDC is 1_000_000 atoms.

ts
export declare const USDC_DECIMALS: number;
  • Value: 6
  • Where it matters: every ...Usdc amount in the SDK is in USDC atoms (10^-6 USDC).

JITOSOL_MINT

The JitoSOL mint, the collateral desks quote today.

ts
export declare const JITOSOL_MINT: string;
  • Value: J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn
  • Decimals: 9 (one JitoSOL is 1_000_000_000 atoms).
  • Where it matters: GatewayClient.connect subscribes to this asset when you pass no assets.

JITO_STAKE_POOL

The Jito stake pool account. The program requires it as a read-only extra account on every fill whose collateral is JitoSOL.

ts
export declare const JITO_STAKE_POOL: string;
  • Value: Jito4APyf642JPZPx3hGc6WWJ8zPKtRbRs4P815Awbb
  • Where it matters: fillV3 appends it for JitoSOL markets and refuses any other pool address.

TOKEN_PROGRAM

The SPL Token program. It owns the USDC mint and your vault.

ts
export declare const TOKEN_PROGRAM: string;
  • Value: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
  • Where it matters: the program field of a CollateralIdentity for a classic SPL mint such as JitoSOL.

TOKEN_2022_PROGRAM

The Token-2022 program. Markets accept collateral owned by either token program.

ts
export declare const TOKEN_2022_PROGRAM = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
  • Value: TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb
  • Type: the string literal itself, not string (unlike TOKEN_PROGRAM).

CHAIN_ID

The EIP-712 chainId used in every covr signing domain and in every RFQ, intent and quote.

ts
export declare const CHAIN_ID: number;
  • Value: 2000000001
  • Meaning: a private venue discriminator. It is not an EVM chain id and not a Solana cluster id.
  • Where it matters: wallets and KMS policies that whitelist chain ids must allow this value.

MAINNET

The default Deployment: mainnet program, deployment id and genesis hash. The object is frozen.

ts
export declare const MAINNET: Deployment;
  • Value:
json
{
  "programAddress": "8ZpbTPnDECPTDGN5VHHKH5gfer6EUTnRHcFwfUAbkJDg",
  "deploymentId": "0x13a01f9d69929d8b65db7e9a6cc0805075876a8a66664e4ef30dd26f635527e2",
  "genesisHash": "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d"
}
  • Where it matters: it is the default last argument of every function that takes a Deployment. See the convention.

EIP712_DOMAIN_BASE

The name, version and chainId shared by every covr EIP-712 domain. Each real domain adds its own verifyingContract: one for the registration grant, one per market. The object is frozen.

ts
export declare const EIP712_DOMAIN_BASE: Readonly<{
    name: string;
    version: string;
    chainId: number;
}>;

ORDINARY_TERMS_ID

The termsId of every ordinary market (settlement mode 0, atomic exercise): sha256("COVR:ORDINARY-ATOMIC:1\0"), as 0x-hex.

ts
export declare const ORDINARY_TERMS_ID: string;
  • Value: 0xddae69a8d6ba258eb6501331627a583ee6951df68af6a50760d0a038c0a8379d
  • Where it matters: a mint policy holds one terms id. A policy built from an ordinary market (with mintPolicySettingsFor) carries this value and admits fills only in ordinary markets.

RESTRICTED_TERMS_ID

The termsId of restricted markets (settlement mode 1, fund then deliver) with the approved 7-day cancellation timeout: sha256("COVR:RESTRICTED-PENDING:1\0" || 0x01 || u64_le(604800)), as 0x-hex.

ts
export declare const RESTRICTED_TERMS_ID: string;
  • Value: 0xeedfb6068a9b748d45b3341000c743a4b758460d05a852c8473e9fa0469bd7e1
Note

Restricted (tokenized-stock) markets are covr-only today. Desks quote ordinary JitoSOL markets.

RESTRICTED_CANCELLATION_TIMEOUT_SECONDS

The only cancellation timeout a restricted market may carry: 7 days.

ts
export declare const RESTRICTED_CANCELLATION_TIMEOUT_SECONDS: bigint;

REGISTRATION_SCOPE

The scope string hashed into the registration grant's verifyingContract.

ts
export declare const REGISTRATION_SCOPE: string;
  • Value: 'registration-v3'
  • Where it matters: registrationGrantDomain derives verifyingContract = last20(keccak256("deployment-v2" || deploymentId || programId || "registration-v3")). For mainnet that is 0xd2d2b887d02b01d3a4371c7b77f96c3880513b4e.

assetAlias

Computes the 20-byte wire alias of a mint. Use it to match an RFQ's asset to a mint, or to subscribe to a feed by mint.

RFQs, intents and quotes name tokens by this alias, not by the Solana mint. The alias is the last 20 bytes of keccak256 over the mint's 32 public-key bytes, as lowercase 0x-hex. It is an identifier only, never an EVM contract.

ts
export declare function assetAlias(mint: string): string;
NameTypeDescription
mintstringBase58 mint address.

Returns: string. 0x plus 40 lowercase hex characters.

Throws: SolanaError from @solana/kit when mint is not a valid base58 address.

ts
import { assetAlias, JITOSOL_MINT, JITOSOL_ALIAS } from '@covrfun/maker-sdk';

console.log(assetAlias(JITOSOL_MINT) === JITOSOL_ALIAS); // true

JITOSOL_ALIAS

The wire alias of JITOSOL_MINT.

ts
export declare const JITOSOL_ALIAS: string;
  • Value: 0x43127405c3191a0b63a5f3d845f616ffea348c68
  • Where it matters: asset, collateralAsset and assetAddress of every JitoSOL RFQ, intent and quote. The JitoSOL feed path is /rfqs/0x43127405c3191a0b63a5f3d845f616ffea348c68.

USDC_ALIAS

The wire alias of USDC_MINT.

ts
export declare const USDC_ALIAS: string;
  • Value: 0x5ce3bf3a31af18be40ba30f721101b4341690186
  • Where it matters: the usd field of every RFQ, intent and quote.

GATEWAY_MAX_FRAME_BYTES

The largest WebSocket frame the gateway accepts, in bytes. The client also uses it as its own inbound limit.

ts
export declare const GATEWAY_MAX_FRAME_BYTES = 16384;
  • Value: 16384 (16 KiB)
  • Where it matters: GatewayClient refuses to send a request whose JSON frame is larger, and closes a socket that receives a larger frame. A signed bid intent or quote frame is under 1 KiB (844 and 931 bytes in the golden vectors).

COLLECT_MS

How long an opening auction collects sealed bid intents, in milliseconds from RFQ creation.

ts
export declare const COLLECT_MS = 3000;
  • Value: 3000 ms
  • Meaning: closesAt = createdAt + 3000. A bid intent's validUntil must be later than ceil(closesAt / 1000).

AWARD_MS

How long the winning maker has to answer an award with a signed quote, in milliseconds.

ts
export declare const AWARD_MS = 3000;
  • Value: 3000 ms
  • Meaning: each award's awardUntil = min(award time + 3000, hardDeadline), rounded down to a whole millisecond. A decline, a disconnect or a failed answer passes the award to the next bidder at once.

TOTAL_MS

The auction's hard deadline, in milliseconds from RFQ creation.

ts
export declare const TOTAL_MS = 6000;
  • Value: 6000 ms
  • Meaning: hardDeadline = createdAt + 6000. No award is made and no quote is admitted after it.

REVIEW_SECONDS

The longest life a quote may have, in seconds, measured on the gateway's clock when it admits the quote.

ts
export declare const REVIEW_SECONDS = 60;
  • Value: 60 s
  • Meaning: the gateway admits a quote only if now < validUntil <= now + 60. defaultIntentValidUntil also uses it: min(option expiry, ceil(hardDeadline / 1000) + 60).