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

gas: GasAPI = ...

The API used to interact with gas for Premia V3.

Default Value

GasAPI

mining: MiningAPI = ...

The API used to interact with liquidity mining for Premia V3.

Default Value

MiningAPI

multicallProvider: MulticallProvider<AbstractProvider>

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

See

https://github.com/Rubilmax/ethers-multicall-provider

optionPS: OptionPSAPI = ...

The API used to interact with optionPS for Premia V3.

Default Value

OptionPSAPI

optionReward: OptionRewardAPI = ...

The API used to interact with option reward for Premia V3.

Default Value

OptionRewardAPI

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

orderbookProvider?: 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

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

The SetProviderParams field used to instantiate the SDK.

Type declaration

  • Optional provider?: Provider
  • Optional rpcUrl?: string
orderbookSigner?: 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

orderbookSignerAddress?: string

The address of the orderbook signer, if an orderbook signer is set.

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

The SetSignerParams field used to instantiate the SDK.

Type declaration

  • Optional phrase?: string
  • Optional privateKey?: string
orders: OrdersAPI = ...

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

Default Value

OrdersAPI

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
referral: ReferralAPI = ...

The API used to interact with referrals for Premia V3.

Default Value

ReferralAPI

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

signerAddress?: string

The address of the signer, if a signer is set.

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

The SetSignerParams field used to instantiate the SDK.

Type declaration

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

Inherit Doc

skipVoidnode

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

voidnode: PremiaVoidnode

The Premia voidnode object which handles all interactions with voidnode server.

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

  • set voidnodeAuthentication(authentication): void
  • Parameters

    Returns void

  • set voidnodeUri(uri): void
  • Parameters

    • uri: string

      A uri to connect to the Voidnode indexed data service.

    Returns void

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