covr.Docs

SDK reference

Types

Every type the SDK exports, with each field's meaning and unit. Declarations are copied from the shipped .d.ts files. Types re-exported from ethers (TypedDataDomain, TypedDataField) and @solana/kit (Address, Instruction, AccountMeta) are those libraries' own.

Units used below:

UnitMeaning
atomsCollateral base units. JitoSOL has 9 decimals: 1 JitoSOL = 1_000_000_000 atoms.
USDC atoms10^-6 USDC. 1 USDC = 1_000_000.
priceE18USDC × 10^18 per one whole collateral token.
strikeE8USD × 10^8 per whole collateral token.
quantityE18Collateral atoms scaled to 18 decimals (the wire quantity).
unix sSeconds since 1970-01-01 UTC.
epoch msMilliseconds since 1970-01-01 UTC.

Deployment

Which program and deployment an operation targets. Every function that derives or decodes program accounts takes one as an optional last argument, default MAINNET. See the convention.

ts
export interface Deployment {
    readonly programAddress: string;
    readonly deploymentId: string;
    readonly genesisHash: string;
}
FieldTypeMeaning
programAddressstringProgram id, base58.
deploymentIdstring32-byte deployment identity, 0x + 64 hex. Bound into every signing domain.
genesisHashstringChain genesis hash, base58. Market decoding still requires mainnet's value.

TypedDataSigner

The signer every signing function takes. Full details: Signing.

ts
export interface TypedDataSigner {
    signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, unknown>): Promise<string>;
}
MemberMeaning
signTypedDataSigns EIP-712 typed data. Returns 0x + 130 hex: r, s, v, with v in {27, 28} and low s.

RegisterMakerV3Input

Input of registerMakerV3.

ts
export interface RegisterMakerV3Input {
    authority: string;
    makerEthAddress: string;
    signature: string | Uint8Array;
}
FieldTypeMeaning
authoritystringYour Solana authority, base58. Signs the transaction, pays rent, owns the Maker forever.
makerEthAddressstringYour quote key address, 0x + 40 hex.
signaturestring | Uint8ArrayThe registration grant signature: 0x + 130 hex, or 65 bytes.

CollateralIdentity

A collateral mint and how to read it.

ts
export interface CollateralIdentity {
    mint: string;
    program: string;
    decimals: number;
}
FieldTypeMeaning
mintstringCollateral mint, base58.
programstringIts token program: TOKEN_PROGRAM or TOKEN_2022_PROGRAM.
decimalsnumberMint decimals, 0 to 255. JitoSOL: 9.

MintPolicySettingsV1

The caps and bindings of one mint policy. Build it with mintPolicySettingsFor.

ts
export interface MintPolicySettingsV1 {
    watcher: string;
    enabled: boolean;
    termsId: Uint8Array;
    profileHash: Uint8Array;
    maxOrderAtoms: bigint;
    maxReservedAtoms: bigint;
    maxReservedStrikeUsdc: bigint;
    lifetimePremiumLimitEnabled: boolean;
    lifetimePremiumLimitUsdc: bigint;
}
FieldTypeMeaning
watcherstringA key that may pause the policy and do nothing else. The zero key (11111111111111111111111111111111) means none.
enabledbooleanfalse refuses every fill on this mint.
termsIdUint8Array32 bytes. Only markets with this terms id fill against the policy.
profileHashUint8Array32 bytes. Only markets with this mint profile fill against the policy.
maxOrderAtomsbigintLargest single fill, atoms.
maxReservedAtomsbigintMost atoms open at once on this mint, atoms.
maxReservedStrikeUsdcbigintMost strike obligation open at once on this mint, USDC atoms.
lifetimePremiumLimitEnabledbooleanWhether the lifetime premium cap applies.
lifetimePremiumLimitUsdcbigintLifetime gross premium cap on this mint, USDC atoms. Must be 0n when the cap is disabled.

MintPolicyV1

Your decoded mint policy, from decodeMintPolicy.

ts
export interface MintPolicyV1 {
    address: Address;
    version: 1;
    bump: number;
    maker: Address;
    authority: Address;
    collateral: Address;
    collateralProgram: Address;
    collateralDecimals: number;
    payment: Address;
    paymentProgram: Address;
    paymentDecimals: 6;
    generation: bigint;
    settings: MintPolicySettingsV1;
    admission: 'not-evaluated';
}
FieldTypeMeaning
addressAddressThe policy account.
version1Account version.
bumpnumberPDA bump.
makerAddressYour Maker account.
authorityAddressYour Solana authority.
collateral, collateralProgram, collateralDecimalsThe collateral mint, its token program and decimals.
payment, paymentProgram, paymentDecimalsUSDC mint, SPL Token program, 6.
generationbigintStarts at 1 and goes up by one on every update or pause. Pass it as expectedGeneration.
settingsMintPolicySettingsV1Watcher, enabled flag, terms id, profile hash and caps.
admission'not-evaluated'The decoder proves the record's consistency, not that fills are admitted.

MintUsageV1

Your decoded mint usage counters, from decodeMintUsage. All amounts cover this one collateral mint.

ts
export interface MintUsageV1 {
    address: Address;
    version: 1;
    bump: number;
    maker: Address;
    collateral: Address;
    collateralProgram: Address;
    collateralDecimals: number;
    payment: Address;
    paymentProgram: Address;
    paymentDecimals: 6;
    policy: Address;
    bootstrapped: boolean;
    reservedAtoms: bigint;
    reservedStrikeUsdc: bigint;
    cumulativePremiumUsdc: bigint;
    openClaims: bigint;
    pendingClaims: bigint;
    totalFills: bigint;
    totalSettled: bigint;
    admission: 'not-evaluated';
}
FieldTypeMeaning
address, version, bumpThe usage account, 1, its PDA bump.
maker, collateral, collateralProgram, collateralDecimals, payment, paymentProgram, paymentDecimalsAs in MintPolicyV1.
policyAddressYour MintPolicyV1 for this mint.
bootstrappedbooleanfalse until bootstrapMintUsageV1 runs. Fills fail while it is false.
reservedAtomsbigintCollateral atoms in open positions. Compare with maxReservedAtoms.
reservedStrikeUsdcbigintStrike obligations of open positions, USDC atoms. Compare with maxReservedStrikeUsdc.
cumulativePremiumUsdcbigintGross premium paid on this mint since creation, USDC atoms. Never decreases. Compare with lifetimePremiumLimitUsdc.
openClaimsbigintPositions not yet settled.
pendingClaimsbigintRestricted positions with the strike funded, awaiting delivery.
totalFillsbigintFills since creation.
totalSettledbigintPositions settled since creation.
admission'not-evaluated'As in MintPolicyV1.

SdkInstruction

The instruction type the vault, budget, deposit, withdraw and exposure-limit builders return: a @solana/kit instruction whose accounts and data are always present. Other builders return the same shape under their own names.

ts
export type SdkInstruction = Instruction & {
    accounts: AccountMeta[];
    data: Uint8Array;
};
FieldTypeMeaning
programAddressAddressThe program id.
accountsAccountMeta[]{ address, role }. Roles: 0 read-only, 1 writable, 2 read-only signer, 3 writable signer. No signer objects are attached.
dataUint8Array8-byte Anchor discriminator (sha256("global:<name>")[0..8]) followed by the arguments, little-endian.

DecodedMakerAccount

Your Maker account, decoded by decodeMaker.

ts
export type DecodedMakerAccount = {
    authority: Address;
    ethAddress: `0x${string}`;
    bump: number;
    operator: Address;
    minNonce: bigint;
} & ({
    migrationFenced: false;
    startSlot: null;
} | {
    migrationFenced: true;
    startSlot: bigint;
});
FieldTypeMeaning
authorityAddressThe Solana authority that owns the Maker.
ethAddress`0x${string}`Your quote key address, lowercase.
bumpnumberPDA bump of the Maker account.
operatorAddressKey that may sign exercises for you. The zero key means none.
minNoncebigintNonce floor: a fill of a quote whose nonce is below it fails. Raise it with configureMaker.
migrationFencedbooleanReserved account-format flag. Always true for a Maker created by registerMakerV3. You do not need it.
startSlotbigint | nullFor a Maker created by registerMakerV3: the slot it was registered at.

DecodedMarketV3

A decoded market of either mode. Narrow it on settlementMode.

ts
export type DecodedMarketV3 = MarketV3 | RestrictedMarketV3;

MarketV3

An ordinary market (settlement mode 0), as decodeMarketV3 returns it.

ts
export interface MarketV3 {
    address: string;
    programAddress: string;
    version: 3;
    bump: number;
    settlementMode: 0;
    collateralDecimals: number;
    paymentDecimals: 6;
    creator: string;
    collateral: string;
    collateralProgram: string;
    payment: string;
    paymentProgram: string;
    feeOwner: string;
    genesisHash: string;
    deploymentId: Uint8Array;
    termsId: Uint8Array;
    profileHash: Uint8Array;
    salt: bigint;
    expiry: bigint;
    window: bigint;
    strikeE8: bigint;
    maxQuantityAtoms: bigint;
    feeBps: number;
    paused: boolean;
}
FieldTypeMeaning
addressstringThe market account.
programAddressstringProgram that owns it.
version3Account version.
bumpnumberPDA bump.
settlementMode0Ordinary: atomic exercise.
collateralDecimalsnumberCollateral mint decimals.
paymentDecimals6USDC decimals.
creatorstringWallet that created the market (PDA seed).
collateralstringCollateral mint.
collateralProgramstringCollateral token program.
paymentstringUSDC mint.
paymentProgramstringSPL Token program.
feeOwnerstringOwner of the USDC account that receives the protocol fee.
genesisHashstringMainnet genesis hash.
deploymentIdUint8Array32 bytes, equal to DEPLOYMENT_ID.
termsIdUint8Array32 bytes, equal to ORDINARY_TERMS_ID.
profileHashUint8Array32 bytes: fingerprint of the collateral mint's token profile, taken at creation.
saltbigintCreator's salt (PDA seed), u64.
expirybigintOption expiry, unix s.
windowbigintExercise window after expiry, seconds, 60 to 3,600.
strikeE8bigintStrike, USD × 10^8.
maxQuantityAtomsbigintLargest single fill, atoms.
feeBpsnumberProtocol fee on the gross premium, basis points, 0 to 1,000.
pausedbooleanA paused market refuses new fills.

RestrictedMarketV3

A restricted market (settlement mode 1): every MarketV3 field, with settlementMode: 1 and a cancellation timeout. Restricted markets are covr-only today.

ts
export interface RestrictedMarketV3 extends Omit<MarketV3, 'settlementMode'> {
    settlementMode: 1;
    cancellationTimeoutSeconds: bigint;
}
FieldTypeMeaning
settlementMode1Restricted: fund the strike, then deliver.
cancellationTimeoutSecondsbigintAlways 604800n (7 days). termsId equals RESTRICTED_TERMS_ID.

CreateMarketInput

Input of createMarketV3 and createRestrictedMarketV3.

ts
export interface CreateMarketInput {
    creator: string;
    salt: bigint;
    collateral: string;
    feeOwner: string;
    /** Unix seconds. The program requires 60 s <= expiry - now <= 90 days at creation. */
    expiry: bigint;
    window: bigint;
    strikeE8: bigint;
    maxQuantityAtoms: bigint;
    feeBps: number;
    /** Your clock in unix seconds, used to apply the program's expiry bounds. The chain
     * clock decides; leave margin for submission delay. */
    nowUnix: bigint;
}
FieldTypeMeaning
creatorstringWallet that signs and pays rent. PDA seed.
saltbigintAny u64. One market per (creator, salt).
collateralstringCollateral mint. Not native SOL.
feeOwnerstringOwner of the USDC account that receives fees. Not the zero key.
expirybigintOption expiry, unix s. 60 s to 90 days after the chain clock.
windowbigintExercise window, seconds, 60 to 3,600.
strikeE8bigintStrike, USD × 10^8. Positive.
maxQuantityAtomsbigintLargest single fill, atoms. Positive.
feeBpsnumberFee, basis points, integer 0 to 1,000.
nowUnixbigintYour clock, unix s. Used only for the local expiry check; it is not sent.

BidIntent

A signed sealed bid intent: the exact bid_intent params. signIntent returns it.

ts
export interface BidIntentTerms {
    assetAddress: string;
    chainId: number;
    expiry: number;
    isPut: boolean;
    isTakerBuy: boolean;
    quantity: string;
    strike: string;
    usd: string;
    collateralAsset: string;
}
export interface BidIntent extends BidIntentTerms {
    auctionId: string;
    kind: AuctionKind;
    market: string;
    position: string | null;
    wallet: string;
    maker: string;
    price: string;
    validUntil: number;
    signature: string;
}

AuctionKind is 'open' | 'position_sale' | 'early_close'. BidIntentTerms and AuctionKind are not exported by name.

FieldTypeMeaning
auctionIdstringRFQ id, a lowercase UUID v4.
kind'open'Opening auction. Desks bid only on these.
marketstringMarket account, base58.
positionnullAlways null for an opening auction.
walletstringThe writer (customer) wallet, base58.
assetAddressstringCollateral alias, copied from request.asset.
chainIdnumber2000000001.
expirynumberOption expiry, unix s.
isPutbooleanfalse.
isTakerBuybooleanfalse.
quantitystringquantityE18, decimal string.
strikestringstrikeE8, decimal string.
usdstringUSDC alias.
collateralAssetstringCollateral alias.
makerstringYour quote key address.
pricestringpriceE18, decimal string.
validUntilnumberIntent expiry, unix s.
signaturestring65-byte EIP-712 signature, lowercase 0x hex.

UnsignedBidIntent

A BidIntent without signature: 17 fields. buildBidIntent returns it.

ts
export type UnsignedBidIntent = Omit<BidIntent, 'signature'>;

QuoteV2

A signed executable quote: the quote param of sendQuote. The program verifies the same signature at fill. signQuote returns it.

ts
export interface Quote {
    assetAddress: string;
    chainId: number;
    expiry: number;
    isPut: boolean;
    isTakerBuy: boolean;
    quantity: string;
    strike: string;
    maker: string;
    nonce: string;
    price: string;
    validUntil: number;
    usd: string;
    collateralAsset: string;
    signature: string;
}
export interface QuoteV2 extends Quote {
    auctionId: string;
    writer: string;
}

Quote is the base interface; it is not exported by name.

FieldTypeMeaning
auctionIdstringRFQ id. Signed as keccak256(utf8(id)).
writerstringThe writer wallet, base58. Only this wallet can fill the quote.
assetAddressstringCollateral alias.
chainIdnumber2000000001.
isPutbooleanfalse.
strikestringstrikeE8, decimal string. Must equal the market's.
expirynumberOption expiry, unix s. Must equal the market's.
makerstringYour quote key address.
noncestringu64 decimal string. One fill per nonce; must be at least min_nonce.
pricestringpriceE18, decimal string. Equals the awarded intent's price.
quantitystringquantityE18, decimal string.
isTakerBuybooleanfalse.
validUntilnumberQuote expiry, unix s. At most 60 s after gateway admission, at most expiry.
usdstringUSDC alias.
collateralAssetstringCollateral alias.
signaturestring65-byte EIP-712 signature, lowercase 0x hex.

UnsignedQuoteV2

A QuoteV2 without signature: 15 fields. buildQuote returns it.

ts
export type UnsignedQuoteV2 = Omit<QuoteV2, 'signature'>;

RfqRequest

The instrument of an RFQ, as broadcast on the feed and repeated in the snapshot.

ts
export type RfqRequest = Request;
export interface Request {
    asset: string;
    assetName: string;
    chainId: number;
    expiry: number;
    isPut: boolean;
    isTakerBuy: boolean;
    quantity: string;
    strike: string;
    taker: string;
    usd: string;
    collateralAsset: string;
}
FieldTypeMeaning
assetstringCollateral alias, lowercase. JitoSOL: JITOSOL_ALIAS.
assetNamestringDisplay label.
chainIdnumber2000000001.
expirynumberOption expiry, unix s.
isPutbooleanfalse: covered calls only.
isTakerBuybooleanfalse.
quantitystringquantityE18, decimal string. Convert with atomsFromWire.
strikestringstrikeE8, decimal string.
takerstring20-byte zero address placeholder.
usdstringUSDC alias.
collateralAssetstringCollateral alias.

RfqSnapshot

The body of GET /api/rfqs/<id> (getRfq).

ts
export interface RfqSnapshot {
    id: string;
    kind: 'open' | 'position_sale' | 'early_close';
    position: string | null;
    status: 'collecting' | 'finalizing' | 'quoted' | 'no_quote' | 'expired' | string;
    market: string;
    preparationFamily?: 'ordinary-v3' | 'restricted-v3' | string;
    /** Epoch ms. */
    closesAt: number;
    /** Epoch ms. */
    hardDeadline: number;
    bidCount?: number;
    wallet: string;
    request: RfqRequest;
    /** Restricted (stock) RFQs only: sign while it is fresh, see the integration guide. */
    stockSelection?: unknown;
    quote?: QuoteV2;
    [extra: string]: unknown;
}
FieldTypeMeaning
idstringRFQ id, lowercase UUID v4.
kindstring'open' for an opening auction, the only kind desks bid on.
positionstring | nullnull for an opening auction.
statusstringcollecting until closesAt; finalizing while awards run; quoted once a quote is admitted; no_quote when the auction ends without one.
marketstringThe market account. Read and decode it yourself.
preparationFamilystring'ordinary-v3' or 'restricted-v3'.
closesAtnumberEnd of bid collection, epoch ms: creation + 3,000.
hardDeadlinenumberLast moment for an award or a quote, epoch ms: creation + 6,000.
bidCountnumberIntents entered so far.
walletstringThe writer (customer) wallet. Becomes the quote's writer.
requestRfqRequestThe instrument.
stockSelectionunknownRestricted RFQs only. Desks are not served those today.
quoteQuoteV2The admitted quote, shown only to the maker that made it.

The gateway may add other fields (for example noQuoteReason on a no_quote RFQ). They are untyped.

Award

An award you hold: the gateway picked your intent. Arrives as an award event.

ts
export interface Award {
    id: string;
    intent: BidIntent;
    awardUntil: number;
    hardDeadline: number;
}
FieldTypeMeaning
idstringRFQ id.
intentBidIntentThe awarded intent, as the gateway sent it. Compare it with your stored copy.
awardUntilnumberYour quote must be admitted before this, epoch ms. At most 3,000 ms after the award, never after hardDeadline.
hardDeadlinenumberAuction hard deadline, epoch ms.

PositionV3

A decoded position, from decodePositionV3. The object is frozen.

ts
export interface PositionV3 {
    address: Address;
    version: 3;
    bump: number;
    collateralVaultBump: number;
    strikeEscrowBump: number;
    state: 0 | 1 | 2 | 3 | 4 | 5;
    status: 'open' | 'pending_delivery' | 'exercised' | 'released' | 'early_closed' | 'bilaterally_canceled';
    /** Mode 0 has no pending rights. Mode 1 is record evidence, not authorization
     * to open a restricted agreement or a default for its timeout terms. */
    timeoutAnchor: 0 | 1;
    settlementMode: 'ordinary-atomic' | 'restricted-pending';
    collateralDecimals: number;
    paymentDecimals: 6;
    maker: Address;
    makerAuthority: Address;
    makerEthAddress: string;
    writer: Address;
    termsAccount: Address;
    termsId: string;
    profileHash: string;
    genesisHash: Address;
    deploymentId: string;
    collateralMint: Address;
    collateralProgram: Address;
    paymentMint: Address;
    paymentProgram: Address;
    policy: Address;
    usage: Address;
    collateralVault: Address;
    strikeEscrow: Address;
    nonce: bigint;
    admissionGeneration: bigint;
    quantityAtoms: bigint;
    grossPremiumUsdc: bigint;
    strikeUsdc: bigint;
    openedAt: bigint;
    expiry: bigint;
    exerciseWindowSeconds: bigint;
    cancellationTimeoutSeconds: bigint;
    intentGeneration: bigint;
    fundedAt: bigint;
    cancelEligibleAt: bigint;
    fundedStrikeUsdc: bigint;
    exerciseDeadline: bigint;
    makerOperator: Address;
    makerMinNonce: bigint;
    makerFenced: boolean;
    makerFenceSlot: bigint | null;
    slot: bigint;
    commitment: 'finalized';
    admission: 'not-evaluated';
}
FieldTypeMeaning
addressAddressThe position account.
version3Account version.
bump, collateralVaultBump, strikeEscrowBumpnumberPDA bumps.
state / status0 open (filled, not settled); 1 pending_delivery (restricted: strike funded, awaiting delivery); 2 exercised; 3 released (collateral returned after the window); 4 early_closed; 5 bilaterally_canceled (restricted cancellation).
timeoutAnchor0 | 10 ordinary, 1 restricted.
settlementModestring'ordinary-atomic' or 'restricted-pending'.
collateralDecimalsnumberCollateral mint decimals.
paymentDecimals6USDC decimals.
makerAddressYour Maker account.
makerAuthorityAddressYour Solana authority.
makerEthAddressstringYour quote key, lowercase.
writerAddressThe customer who sold the call.
termsAccountAddressThe market account.
termsId, profileHash, deploymentIdstring32-byte values as 0x hex, copied from the market.
genesisHashAddressMainnet genesis hash.
collateralMint, collateralProgramAddressCollateral mint and token program.
paymentMint, paymentProgramAddressUSDC mint and SPL Token program.
policy, usageAddressYour mint policy and mint usage accounts.
collateralVaultAddressHolds the writer's collateral until settlement.
strikeEscrowAddressRestricted only: holds the funded strike.
noncebigintThe quote nonce that opened it.
admissionGenerationbigintYour mint policy generation when it was filled.
quantityAtomsbigintCollateral locked, atoms.
grossPremiumUsdcbigintPremium your vault paid, USDC atoms.
strikeUsdcbigintStrike payment due on exercise, USDC atoms.
openedAtbigintFill time, unix s.
expirybigintOption expiry, unix s.
exerciseWindowSecondsbigintWindow after expiry, seconds.
exerciseDeadlinebigintexpiry + exerciseWindowSeconds, unix s. Exercise before it; release from it.
cancellationTimeoutSecondsbigint0n ordinary; 604800n restricted.
intentGeneration, fundedAt, cancelEligibleAt, fundedStrikeUsdcbigintRestricted funding state; all 0n while unfunded. Times in unix s, amounts in USDC atoms.
makerOperatorAddressYour operator when read. The zero key means none.
makerMinNoncebigintYour min_nonce when read.
makerFenced, makerFenceSlotReserved: copies of migrationFenced and startSlot from your Maker account (DecodedMakerAccount).
slotbigintThe slot you read at.
commitment'finalized'The commitment you asserted.
admission'not-evaluated'The decoder proves record consistency only, not live state.

PositionReadInput

Input of decodePositionV3.

ts
export interface PositionReadInput {
    /** PositionV3 and Maker account data from ONE finalized getMultipleAccounts read at `slot`. */
    position: {
        address: string;
        data: Uint8Array;
    };
    maker: {
        address: string;
        data: Uint8Array;
    };
    slot: bigint;
    makerEthAddress: string;
    /** Your own Solana authority, pinned independently of these bytes. */
    makerAuthority: string;
    nonce: bigint;
    /** The position's market (or its collateral identity). */
    collateral: Pick<DecodedMarketV3, 'collateral' | 'collateralProgram' | 'collateralDecimals'>;
    /** Refuse unless both reads are at or after this slot. Defaults to `slot`. */
    minContextSlot?: bigint;
    writer?: string;
}
FieldTypeMeaning
position{ address; data }The position account and its 652 bytes.
maker{ address; data }Your Maker account and its bytes, from the same read.
slotbigintThe context slot of that read.
makerEthAddressstringYour quote key address.
makerAuthoritystringYour Solana authority, from your own config, not from the bytes.
noncebigintThe position's nonce.
collateral{ collateral; collateralProgram; collateralDecimals }Usually the decoded market.
minContextSlotbigintOptional. Refuse a read older than this slot. Default: slot.
writerstringOptional. Refuse unless the stored writer equals it.

FillInput

Input of fillV3.

ts
export type FillInput = Omit<FillV3Input, 'market'> & {
    market: DecodedMarketV3;
};
export interface FillV3Input {
    market: MarketV3;
    writer: string;
    writerCollateral: string;
    writerPayment: string;
    feeTokens: string;
    quantityAtoms: bigint;
    quote: QuoteV2;
    makerProvenance?: MakerProvenance;
    useMigrationHolds?: boolean;
    jitoStakePool?: string;
}
FieldTypeMeaning
marketDecodedMarketV3The quote's market. Restricted markets dispatch to fill_restricted_v3.
writerstringThe writer wallet. Signs the fill. Must equal quote.writer.
writerCollateralstringWriter's collateral token account (source of the collateral).
writerPaymentstringWriter's USDC token account (receives the writer premium).
feeTokensstringUSDC token account owned by the market's feeOwner (receives the fee).
quantityAtomsbigintFill size, atoms. quote.quantity must equal its wire form.
quoteQuoteV2Your signed quote.
makerProvenanceMakerProvenanceReserved. Leave unset.
useMigrationHoldsbooleanReserved. Leave unset.
jitoStakePoolstringOptional. For a JitoSOL market, only JITO_STAKE_POOL is accepted (the default). Must be unset for other mints.

FreshWriterAccount

A token account an exit helper creates for the writer, at createWithSeed(base, seed, tokenProgram). Returned by exerciseV3Instructions and releaseV3Instructions.

ts
export interface FreshWriterAccount {
    address: Address;
    base: Address;
    seed: string;
    mint: Address;
    tokenProgram: Address;
}
FieldTypeMeaning
addressAddressThe new account. Only base can allocate it, so the writer cannot pre-create, freeze, delegate or close it.
baseAddressYour signer: the exercise authority or the release payer.
seedstring32 lowercase hex characters. Random unless you passed one.
mintAddressUSDC for the writer payment account; the collateral mint for the collateral account.
tokenProgramAddressThe mint's token program, which owns the account. The writer is its token owner.

CancellationRequestV1

A restricted cancellation request, mirroring the program's 288-byte Borsh struct. Restricted markets are covr-only today.

ts
export interface CancellationRequestV1 {
    genesisHash: string;
    program: string;
    termsId: string;
    position: string;
    maker: string;
    writer: string;
    intentGeneration: bigint;
    refundStrikeUsdc: bigint;
    returnCollateralAtoms: bigint;
    paymentDestination: string;
    collateralDestination: string;
    validUntil: bigint;
}
FieldTypeMeaning
genesisHashstringGenesis hash, base58.
programstringProgram id.
termsIdstringThe position's terms id, 0x + 64 hex.
positionstringThe position account.
makerstringThe Maker account.
writerstringThe writer wallet.
intentGenerationbigintThe position's funding generation.
refundStrikeUsdcbigintStrike refunded to the maker, USDC atoms: the full escrow.
returnCollateralAtomsbigintCollateral returned to the writer, atoms: the vault's current amount.
paymentDestinationstringMaker's USDC account for the refund.
collateralDestinationstringWriter's collateral account.
validUntilbigintRequest expiry, unix s. Must be after the position's cancelEligibleAt.

GatewayEvent

The events client.events yields: rfq, award, notice and closed. Full description: GatewayEvent.

ts
export type GatewayEvent = {
    type: 'rfq';
    asset: string;
    id: string;
    request: RfqRequest;
} | ({
    type: 'award';
} & Award) | {
    type: 'notice';
    socket: 'maker' | 'feed';
    message: unknown;
}
 | {
    type: 'closed';
    socket: 'maker' | 'feed' | 'client';
    asset?: string;
    code: number;
    reason: string;
};

GatewayClientOptions

Options of GatewayClient.connect. Defaults and ranges: GatewayClientOptions.

ts
export interface GatewayClientOptions {
    /** Collateral mints or 20-byte aliases to subscribe to. Default: JitoSOL. */
    assets?: readonly string[];
    /** Reply timeout for /maker requests. Default 5000 ms; the award window is 3000 ms. */
    requestTimeoutMs?: number;
    /** HTTP base for /api routes. Default: the WebSocket URL with ws->http, wss->https. */
    httpUrl?: string;
    /** getRfq gives up after this. Default 5000 ms. */
    httpTimeoutMs?: number;
    /** Most events held unread for events(). One more closes the client: the queued events
     * stay readable, then a 'closed' event from 'client'. Default 1000. */
    maxQueuedEvents?: number;
    /** Each socket's upgrade must complete within this. Default 10000 ms. */
    handshakeTimeoutMs?: number;
    /** Every socket is pinged this often... Default 15000 ms (the heartbeat covr's own maker uses). */
    heartbeatIntervalMs?: number;
    /** ...and ended when the matching pong has not arrived within this. Default 30000 ms. */
    heartbeatTimeoutMs?: number;
}

RfqNoteReason

One of the reasons in RFQ_NOTE_REASONS.

ts
export type RfqNoteReason = typeof RFQ_NOTE_REASONS[number];
// 'warming_up' | 'fully_booked' | 'wallet_limit' | 'too_large' | 'not_priced'