Skip to main content

Interface: OvercastReader

Defined in: packages/overcast-core/src/protocol/reader.ts:10

Extended by

Methods

balance()

balance(user, asset): Promise<bigint>;

Defined in: packages/overcast-core/src/protocol/reader.ts:14

Gets the current balance for an asset in the protocols vault

Parameters

ParameterTypeDescription
userstring-
asset{ address: string; cashLike?: boolean; chain?: string; coinGeckoId?: string; decimals?: number; lastKnownPriceUsd?: number; logoUrl?: string; name?: string; rwa?: boolean; symbol?: string; volatility?: number; }-
asset.addressstringThe on-chain address (mint) that uniquely identifies the asset.
asset.cashLike?booleanWhether or not the asset can be treated similar to cash
asset.chain?stringThe chain the asset lives on.
asset.coinGeckoId?stringCoinGecko id for price lookups, e.g. usd-coin.
asset.decimals?numberNumber of decimal places in the asset's native units.
asset.lastKnownPriceUsd?numberLast known USD price, sourced best-effort from an external feed (CoinGecko). Untrusted — do not use for settlement, signing, valuation, or any value transfer. It is informational only (e.g. showing an approximate notional in a picker), may be stale, missing, or wrong, and is never part of the canonical, content-addressed asset identity. Present only once a price has actually been fetched for the asset.
asset.logoUrl?stringLogo of the coin
asset.name?stringHuman name of the asset.
asset.rwa?booleanWhether the asset is a real-world asset (RWA) — e.g. tokenized private equity — rather than a native crypto asset.
asset.symbol?stringHuman ticker, e.g. USDC.
asset.volatility?numberVolatility of the asset

Returns

Promise<bigint>


exerciseClaims()

exerciseClaims(option, user): Promise<bigint>;

Defined in: packages/overcast-core/src/protocol/reader.ts:69

returns the user balance of exercise claims for the given option

Parameters

ParameterTypeDescription
optionMarketOption-
userstring-

Returns

Promise<bigint>


exerciseClaimsSupply()

exerciseClaimsSupply(option): Promise<bigint>;

Defined in: packages/overcast-core/src/protocol/reader.ts:49

Returns the total supply of exercise claims for the given option

Parameters

ParameterTypeDescription
optionMarketOption-

Returns

Promise<bigint>


getCollateralOffer()

getCollateralOffer(id): Promise<
| WithId<CollateralOffer>
| null>;

Defined in: packages/overcast-core/src/protocol/reader.ts:37

Look up a single collateral offer by its content-address Id, or null when no such offer exists on-chain.

Parameters

ParameterType
idstring

Returns

Promise< | WithId<CollateralOffer> | null>


getOption()

getOption(collateralOfferId, settlementOfferId): Promise<
| WithId<MarketOption>
| null>;

Defined in: packages/overcast-core/src/protocol/reader.ts:28

Look up a single market option by the content-address ids of the two offers it was matched from, or null when no such option exists on-chain.

An option's on-chain account is keyed by its (collateralOffer, settlementOffer) id pair (the seeds of its PDA), not by its own content-address hash — so those two ids, rather than the option id, are how it is fetched directly without scanning. The returned option carries its own content-address Id (the one the RFQ flow / storage use) on id.

TODO: we should make this just a single id

Parameters

ParameterType
collateralOfferIdstring
settlementOfferIdstring

Returns

Promise< | WithId<MarketOption> | null>


getSettlementOffer()

getSettlementOffer(id): Promise<
| WithId<SettlementOffer>
| null>;

Defined in: packages/overcast-core/src/protocol/reader.ts:43

Look up a single settlement offer by its content-address Id, or null when no such offer exists on-chain.

Parameters

ParameterType
idstring

Returns

Promise< | WithId<SettlementOffer> | null>


redeemClaims()

redeemClaims(option, user): Promise<bigint>;

Defined in: packages/overcast-core/src/protocol/reader.ts:62

returns the user balance of redeem claims for the given option

Parameters

ParameterTypeDescription
optionMarketOption-
userstring-

Returns

Promise<bigint>


redeemClaimsSupply()

redeemClaimsSupply(option): Promise<bigint>;

Defined in: packages/overcast-core/src/protocol/reader.ts:55

Returns the total supply of redeem claims for the given option

Parameters

ParameterTypeDescription
optionMarketOption-

Returns

Promise<bigint>