@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / SomniaMarketsAddresses

Interface: SomniaMarketsAddresses

Defined in: packages/sdk/src/config.ts:12

Protocol contract addresses (all optional — features degrade if unset).

Properties

fakeOracle?

optional fakeOracle?: `0x${string}`

Defined in: packages/sdk/src/config.ts:14

FakeOracle resolver (demo resolve/void).


collateral?

optional collateral?: `0x${string}`

Defined in: packages/sdk/src/config.ts:20

Per-venue collateral ERC-20 (the venue's quote/collateral token; on test environments this is the faucet-capable TestUSDC). Preferred over testUsdc, which remains as the legacy/fallback alias.


testUsdc?

optional testUsdc?: `0x${string}`

Defined in: packages/sdk/src/config.ts:25

TestUSDC collateral (faucet + balances). Legacy/fallback alias for SomniaMarketsAddresses.collateral.


binaryModule?

optional binaryModule?: `0x${string}`

Defined in: packages/sdk/src/config.ts:31

BinaryMarketsModule — the binary product's core module (complete-set mint/redeem, market creation, adapter approval). Needed by the trader writes, the hub-approval reads, and /system diagnostics.


marketCreator?

optional marketCreator?: `0x${string}`

Defined in: packages/sdk/src/config.ts:36

MarketCreator factory. When set, the live tail watches MarketCreated and picks up new binary markets the block they deploy — no indexer round-trip.


clobFactory?

optional clobFactory?: `0x${string}`

Defined in: packages/sdk/src/config.ts:41

ClobFactory — /system-diagnostics fallback when the module's live clobFactory() read fails; a live/config mismatch is flagged.


binaryPoolImpl?

optional binaryPoolImpl?: `0x${string}`

Defined in: packages/sdk/src/config.ts:47

BinaryPool implementation the factory clones (the EIP-1167 master copy; distinct from the factory's binaryMarketImpl). Not read by the SDK itself, but surfaced to apps — the explorer's system overview renders it.


binarySettlement?

optional binarySettlement?: `0x${string}`

Defined in: packages/sdk/src/config.ts:55

The permanent BinarySettlement singleton (settlement-extraction v2). Every pool finalizes its markets into it and every redemption routes through it, so a pool can be recycled onto the next market. Needed by the low-level redeemDirect / claimOwed / getSettlement trader methods, which throw if it is unset. Absent on pre-v2 (pool-redeem) deploys.


operatorPermissionsRegistry?

optional operatorPermissionsRegistry?: `0x${string}`

Defined in: packages/sdk/src/config.ts:60

Shared OperatorPermissionsRegistry — users operator-approve a SpotStopOrderRegistry here (once, globally) so it can place their stop order via the pool at trigger time.


marketsCore?

optional marketsCore?: `0x${string}`

Defined in: packages/sdk/src/config.ts:66

MarketsCore — the control-plane registry of operators, typed venues, and the module binding per market type. Needed by the operator/venue admin reads + createOperatorAdmin writes.


collateralRouter?

optional collateralRouter?: `0x${string}`

Defined in: packages/sdk/src/config.ts:73

CollateralRouter periphery — the native-token (wrap/unwrap) + Permit2 entry over BinaryMarketsModule's complete-set flow. May be absent for an environment where only the plain-ERC-20 path is deployed; the router-based trader methods throw if it is unset rather than sending to the zero address.


marketCreatorFactory?

optional marketCreatorFactory?: `0x${string}`

Defined in: packages/sdk/src/config.ts:79

MarketCreatorFactory — stamps out per-operator/venue MarketCreator (+ its policy) instances, the operator "market machinery" layer. Needed by createMarketCreatorAdmin writes; the admin throws if it is unset.


oracleHub?

optional oracleHub?: `0x${string}`

Defined in: packages/sdk/src/config.ts:90

The OracleHub proxy (Oracle v2 §8e) — the protocol's ONE governance-approved oracle adapter. Every market creation binds through it (content-addressed scheduleQuestion dedup, earmark-at-creation resolution funding + bounded-drain exact metering, payout-vector delivery). Needed by the OracleHub reads (quoteCreateMarketValue, getSchedulingCost, earmarkedOf, resolveReserve) and the createOracleHubAdmin writes; those throw if it is unset. Also the default adapter for createMarketCreatorAdmin.createMarketCreator.


oracleAdapterFactory?

optional oracleAdapterFactory?: `0x${string}`

Defined in: packages/sdk/src/config.ts:96

Deprecated

LEGACY (pre-oracle-v2): OracleAdapterFactory. The factory contract was deleted in Oracle v2 — use SomniaMarketsAddresses.oracleHub. Kept only so old configs keep type-checking; nothing in the SDK reads it.


sharedOracleAdapter?

optional sharedOracleAdapter?: `0x${string}`

Defined in: packages/sdk/src/config.ts:102

Deprecated

LEGACY (pre-oracle-v2): the shared ProphecyOracleAdapter proxy. Replaced by SomniaMarketsAddresses.oracleHub. Kept only so old configs keep type-checking; nothing in the SDK reads it.


lend?

optional lend?: LendAddresses

Defined in: packages/sdk/src/config.ts:128

SomniaLend money-market addresses — a THIRD-PARTY Aave v3 fork (docs.somnialend.finance), so unlike the first-party fields above these are NOT in the deployments manifests. Set SOMNIA_MAINNET_LEND or SOMNIA_TESTNET_LEND (from the root entry) for the published deployments. Backs the client.lend namespace; its methods throw a clear error when the address they need is unset.

Gotchas

This is the ONLY way to point the lend surface at a deployment — and the addresses must belong to this client's chain. A testnet deployment needs a testnet client; there is no way to graft one chain's lend addresses onto another chain's socket.

Example

ts
 const exchange = new SomniaMarkets({
   ...config,
   addresses: { lend: SOMNIA_MAINNET_LEND },
 });
 const account = await exchange.client.lend.getAccount(me);
 console.log(`health factor ${account.healthFactor}`);