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
| Name | Value | Type |
|---|---|---|
PROGRAM_ID | 8ZpbTPnDECPTDGN5VHHKH5gfer6EUTnRHcFwfUAbkJDg | string |
DEPLOYMENT_ID | 0x13a01f9d69929d8b65db7e9a6cc0805075876a8a66664e4ef30dd26f635527e2 | string |
GENESIS_HASH | 5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d | string |
USDC_MINT | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | string |
USDC_DECIMALS | 6 | number |
JITOSOL_MINT | J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn | string |
JITO_STAKE_POOL | Jito4APyf642JPZPx3hGc6WWJ8zPKtRbRs4P815Awbb | string |
TOKEN_PROGRAM | TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA | string |
TOKEN_2022_PROGRAM | TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb | literal type |
CHAIN_ID | 2000000001 | number |
MAINNET | { programAddress, deploymentId, genesisHash } | Deployment |
EIP712_DOMAIN_BASE | { name: 'SOL Covered Calls', version: '1', chainId: 2000000001 } | Readonly<{...}> |
ORDINARY_TERMS_ID | 0xddae69a8d6ba258eb6501331627a583ee6951df68af6a50760d0a038c0a8379d | string |
RESTRICTED_TERMS_ID | 0xeedfb6068a9b748d45b3341000c743a4b758460d05a852c8473e9fa0469bd7e1 | string |
RESTRICTED_CANCELLATION_TIMEOUT_SECONDS | 604800n | bigint |
REGISTRATION_SCOPE | 'registration-v3' | string |
assetAlias | function | (mint: string) => string |
JITOSOL_ALIAS | 0x43127405c3191a0b63a5f3d845f616ffea348c68 | string |
USDC_ALIAS | 0x5ce3bf3a31af18be40ba30f721101b4341690186 | string |
GATEWAY_MAX_FRAME_BYTES | 16384 | 16384 |
COLLECT_MS | 3000 | 3000 |
AWARD_MS | 3000 | 3000 |
TOTAL_MS | 6000 | 6000 |
REVIEW_SECONDS | 60 | 60 |
PROGRAM_ID
The covered-call program on Solana mainnet. Every builder targets it unless you pass another Deployment.
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.
The program is upgradeable. Read its upgrade authority from the program's ProgramData account before you fund a maker vault.
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).
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,quoteDomainanddecodeMarketV3, which refuses a market whose stored deployment id differs.
GENESIS_HASH
Solana mainnet's genesis hash.
export declare const GENESIS_HASH: string;- Value:
5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d - Meaning: every MarketV3 and PositionV3 account stores it. The decoders require it.
- Where it matters:
decodeMarketV3refuses any market whose stored genesis is not this value, even if you pass aDeploymentwith anothergenesisHash. 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.
export declare const USDC_MINT: string;- Value:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v - Where it matters: your maker vault holds this mint.
depositmoves it from your own token account.
USDC_DECIMALS
Decimals of USDC_MINT. One USDC is 1_000_000 atoms.
export declare const USDC_DECIMALS: number;- Value:
6 - Where it matters: every
...Usdcamount in the SDK is in USDC atoms (10^-6 USDC).
JITOSOL_MINT
The JitoSOL mint, the collateral desks quote today.
export declare const JITOSOL_MINT: string;- Value:
J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn - Decimals: 9 (one JitoSOL is
1_000_000_000atoms). - Where it matters:
GatewayClient.connectsubscribes to this asset when you pass noassets.
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.
export declare const JITO_STAKE_POOL: string;- Value:
Jito4APyf642JPZPx3hGc6WWJ8zPKtRbRs4P815Awbb - Where it matters:
fillV3appends it for JitoSOL markets and refuses any other pool address.
TOKEN_PROGRAM
The SPL Token program. It owns the USDC mint and your vault.
export declare const TOKEN_PROGRAM: string;- Value:
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA - Where it matters: the
programfield of aCollateralIdentityfor a classic SPL mint such as JitoSOL.
TOKEN_2022_PROGRAM
The Token-2022 program. Markets accept collateral owned by either token program.
export declare const TOKEN_2022_PROGRAM = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";- Value:
TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb - Type: the string literal itself, not
string(unlikeTOKEN_PROGRAM).
CHAIN_ID
The EIP-712 chainId used in every covr signing domain and in every RFQ, intent and quote.
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.
export declare const MAINNET: Deployment;- Value:
{
"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.
export declare const EIP712_DOMAIN_BASE: Readonly<{
name: string;
version: string;
chainId: number;
}>;- Value:
{ name: 'SOL Covered Calls', version: '1', chainId: 2000000001 } - Where it matters: you never sign with this object alone. Use
registrationGrantDomainorquoteDomain. See Signing.
ORDINARY_TERMS_ID
The termsId of every ordinary market (settlement mode 0, atomic exercise): sha256("COVR:ORDINARY-ATOMIC:1\0"), as 0x-hex.
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.
export declare const RESTRICTED_TERMS_ID: string;- Value:
0xeedfb6068a9b748d45b3341000c743a4b758460d05a852c8473e9fa0469bd7e1
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.
export declare const RESTRICTED_CANCELLATION_TIMEOUT_SECONDS: bigint;- Value:
604800n(seconds) - Where it matters:
createRestrictedMarketV3defaults to it and refuses any other value.decodeMarketV3decodes restricted markets against it.
REGISTRATION_SCOPE
The scope string hashed into the registration grant's verifyingContract.
export declare const REGISTRATION_SCOPE: string;- Value:
'registration-v3' - Where it matters:
registrationGrantDomainderivesverifyingContract = last20(keccak256("deployment-v2" || deploymentId || programId || "registration-v3")). For mainnet that is0xd2d2b887d02b01d3a4371c7b77f96c3880513b4e.
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.
export declare function assetAlias(mint: string): string;| Name | Type | Description |
|---|---|---|
mint | string | Base58 mint address. |
Returns: string. 0x plus 40 lowercase hex characters.
Throws: SolanaError from @solana/kit when mint is not a valid base58 address.
import { assetAlias, JITOSOL_MINT, JITOSOL_ALIAS } from '@covrfun/maker-sdk';
console.log(assetAlias(JITOSOL_MINT) === JITOSOL_ALIAS); // trueJITOSOL_ALIAS
The wire alias of JITOSOL_MINT.
export declare const JITOSOL_ALIAS: string;- Value:
0x43127405c3191a0b63a5f3d845f616ffea348c68 - Where it matters:
asset,collateralAssetandassetAddressof every JitoSOL RFQ, intent and quote. The JitoSOL feed path is/rfqs/0x43127405c3191a0b63a5f3d845f616ffea348c68.
USDC_ALIAS
The wire alias of USDC_MINT.
export declare const USDC_ALIAS: string;- Value:
0x5ce3bf3a31af18be40ba30f721101b4341690186 - Where it matters: the
usdfield 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.
export declare const GATEWAY_MAX_FRAME_BYTES = 16384;- Value:
16384(16 KiB) - Where it matters:
GatewayClientrefuses 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.
export declare const COLLECT_MS = 3000;- Value:
3000ms - Meaning:
closesAt = createdAt + 3000. A bid intent'svalidUntilmust be later thanceil(closesAt / 1000).
AWARD_MS
How long the winning maker has to answer an award with a signed quote, in milliseconds.
export declare const AWARD_MS = 3000;- Value:
3000ms - 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.
export declare const TOTAL_MS = 6000;- Value:
6000ms - 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.
export declare const REVIEW_SECONDS = 60;- Value:
60s - Meaning: the gateway admits a quote only if
now < validUntil <= now + 60.defaultIntentValidUntilalso uses it:min(option expiry, ceil(hardDeadline / 1000) + 60).