Class PremiaAlpha

The SDK class is the main entry point for interacting with the Premia V3 protocol. It provides access to all the protocol's functionality, including, but not limited to:

  • Querying on-chain and indexed data using various APIs and services
  • Interacting with the main exchange contracts, including trading options and minting/burning LP tokens.
  • Interacting with the orderbook contract and indexing API, including placing/cancelling orders.
  • Interacting with various DeFi APIs, including fetching market data and user balances.
  • Utilizing token lists and pair lists for interacting with the protocol.

Hierarchy

  • Premia

Constructors

Properties

analytics: AnalyticsAPI = ...

The API used to interact with the Analytics data on Premia V3.

Default Value

AnalyticsAPI

chainId: number

Inherit Doc

chainId

coingecko: Coingecko

The service used to interact with the Coingecko v3 API.

See

https://www.coingecko.com/api/documentations/v3

contracts: ContractAPI = ...

The API used to interact with the Contracts on Premia V3.

Default Value

ContractAPI

disableCache: boolean

Inherit Doc

disableCache

multicallProvider?: MulticallProvider

The ethers.js multicall provider instance used for batched contract calls.

See

https://github.com/0xsequence/sequence.js/tree/master/packages/multicall

novaProvider?: Provider

The ethers.js provider instance used for interacting with the orderbook contract.

Default Value

JsonRpcProvider

See

https://docs.ethers.org/v6/api/providers/#Provider

novaProviderCredentials?: {
    provider?: Provider;
    rpcUrl?: string;
}

The SetProviderParams field used to instantiate the SDK.

Type declaration

  • Optional provider?: Provider
  • Optional rpcUrl?: string
novaSigner?: Signer

The ethers.js signer instance used for transacting with the orderbook contract.

Default Value

Wallet

See

https://docs.ethers.org/v6/api/providers/#Signer

novaSignerCredentials?: {
    phrase?: string;
    privateKey?: string;
}

The SetSignerParams field used to instantiate the SDK.

Type declaration

  • Optional phrase?: string
  • Optional privateKey?: string
options: OptionAPI = ...

The API used to interact with Options on Premia V3.

Default Value

OptionAPI

orderbook: OrderbookV1

The service used to interact with the Premia Orderbook API.

Default Value

OrderbookV1

See

https://docs.premia.finance/api/orderbook

orders: OrdersAPI = ...

The API used to interact with the RFQ Messaging Network for Premia V3.

Default Value

OrderbookAPI

pairs: TokenPairAPI = ...

The API used to interact with Token Pairs on Premia V3.

Default Value

TokenPairAPI

pools: PoolAPI = ...

The API used to interact with Pools on Premia V3.

Default Value

PoolAPI

pricing: PricingAPI = ...

The API used to determine best pricing between quotes on Premia V3.

Default Value

PricingAPI

provider: Provider

The ethers.js provider instance used for interacting with the main exchange contracts.

Default Value

JsonRpcProvider

See

https://docs.ethers.org/v6/api/providers/#Provider

providerCredentials: {
    provider?: Provider;
    rpcUrl?: string;
}

The SetProviderParams field used to instantiate the SDK.

Type declaration

  • Optional provider?: Provider
  • Optional rpcUrl?: string
signer?: Signer

The ethers.js signer instance used for transacting with the main exchange contracts.

Default Value

Wallet

See

https://docs.ethers.org/v6/api/providers/#Signer

signerCredentials?: {
    phrase?: string;
    privateKey?: string;
}

The SetSignerParams field used to instantiate the SDK.

Type declaration

  • Optional phrase?: string
  • Optional privateKey?: string
skipSubgraph: boolean

Inherit Doc

skipSubgraph

subgraph: PremiaSubgraph

The Premia subgraph object which handles all interactions with the subgraph

tokens: TokenAPI = ...

The API used to interact with the Tokens on Premia V3.

Default Value

TokenAPI

transactions: TransactionAPI = ...

The API used to interact with the Transactions on Premia V3.

Default Value

TransactionAPI

useTestnet: boolean

Inherit Doc

useTestnet

users: UserAPI = ...

The API used to interact with the Users on Premia V3.

Default Value

UserAPI

vaults: VaultAPI = ...

The API used to interact with the Vaults on Premia V3.

Default Value

VaultAPI

vxPremia: VxPremiaAPI = ...

The API used to interact with VxPremia for Premia V3.

Default Value

VxPremiaAPI

entities: __module = _entities

The static types used to interact with the Premia V3 protocol.

Default Value

_entities

Accessors

Methods

  • Cancel all contract event listeners.

    Returns Promise<void>

  • Cancel all open quote streams.

    Returns Promise<void>

  • Remarks

    This method is synchronous and will not initialize via this.provider.getSigner(). If this behavior is required, use async setSigner().

    Parameters

    Returns void

  • Builds the SDK with the provided parameters.

    Remarks

    Default parameters will be used for any values not passed.

    Parameters

    Returns Promise<Premia>

    A promise that resolves when the SDK has been initialized.

  • Builds the SDK with the provided parameters, synchronously.

    Remarks

    Async signers are not supported, use async initialize if necessary. Default parameters will be used for any values not passed.

    Parameters

    Returns Premia

    The synchronously initialized SDK.

Generated using TypeDoc