LogoLogo
AppBlogGovSocials
  • What is Premia?
    • Premia Origins
      • History
      • Principles
      • Mission, Vision, & Values
  • Quick Start
  • The Premia Protocol
    • Options on Premia
      • Options Primer
      • Order-book vs. AMM
    • Key Protocol Features
      • Base Layer (Exchange)
      • Depot Layer (Vaults)
      • Messaging Layer (RFQ & OB)
      • Fee Schedule
      • Differentiators
    • Concepts
      • LP Range Orders
      • Trading
      • Orderbook & Request-for-Quote (RFQ)
      • Fees
      • Exercise & Settlement
      • Margin
      • Oracles
      • Liquidity Mining
      • Referral Programs
      • Advanced Exchange Concepts
        • Token Integration Requirements
        • Flash Swaps and Loans
      • Vault Depot
        • What is a Depot?
        • APY Calculation
        • Underwriter Depot
    • Governance
      • Premian Civitas
        • Parliament
        • Blue Descent
        • Premian Assembly
        • "Influence" Politics
      • Voting (vxPremia)
        • vxPremia Manifold
        • vxPremia Rewards
          • Options Liquidity Mining
          • Protocol Commissions
          • AirDrip Initiative
      • Operator & Facilitator Role
        • Operational Expenditure and Maintenance Costs
        • Insurance Fund
      • Meta Economics
  • Developer Center
    • APIs
      • Orderbook API
        • REST API
        • WEBSOCKET
      • Subgraph API
      • Containerized API
        • API Reference
          • Orderbook
            • Quotes
            • Orders
          • Pool
            • Settle
            • Exercise
            • Annihilate
          • Account
            • Collateral Approval
            • Orders
            • Collateral Balances
            • Native Balance
            • Option Balances
          • Pools
            • Find Pools
            • Create Pools
            • Valid Maturities
            • Valid Strikes
          • Oracles
            • IV
            • Spot
          • Vaults
            • Quote
            • Trade
        • WebSockets Reference
          • Authorization
          • Connection
          • Quotes Channel
          • RFQ Channel
    • SDK
      • Guides
      • SDK Technical Docs
    • Contracts
      • Multi-Signature Wallets
      • V3 Protocol
        • Overview
        • Guides
        • Smart Contract Technical Documentation
      • Margin
      • Orderbook
      • vxPremia
      • Universal Router
      • Vaults
    • Integrations
      • Use Cases
      • Code Snippets
    • Subgraph
    • V3 Change log
  • Bots
    • Range Order Bot
  • Resources
    • VIP & Institutional Services
    • Media Kit
    • Bug Bounty
    • Audits
    • Community Groups
    • Research
      • SSVI
    • Legal, Terms, & Disclaimers
      • Terms of Service
      • Privacy Policy
      • Cookie Policy
      • Prohibited Use
      • Affiliate & Advocate Program
      • Self-Service Affiliate Agreement
      • Bug Bounty Terms
      • Academy/Newsletter Disclaimer
      • Trading Competition Terms and Disclaimers
      • Blue Descent
      • Legal Disclaimer
      • Media Disclaimer
      • AML/KYC Policies
      • Intellectual Property
      • Amendments & Updates
      • Contact Us
      • FAQs (WIP)
    • 📰Newsletter
    • 🌊Crypto News Blotter
    • 🎓Academy
    • 🔵Premia Blue (V3)
    • 💎Premia V2 Docs
Powered by GitBook

Terms and Disclaimers

  • Privacy Policy
On this page
  • Overview
  • API KEY
  • Pool vs Orderbook
  • Orderbook
  • RFQ
  • Orderbook vs. RFQ Quotes

Was this helpful?

  1. Developer Center
  2. APIs

Orderbook API

PreviousAPIsNextREST API

Last updated 1 year ago

Was this helpful?

Overview

The Premia Orderbook API can be used to Publish and/or Get quotes from the orderbook and RFQ system for any deployed/deployable option pool. The Orderbook API comprises of both a and a . There is no centralized dependency to Publish or Get quotes. The orderbook API is simply a convenience wrapper around web3 calls so that others do not need to aggregate the data themselves.

This API is primarily for the aggregation/display of decentralized orderbook data. Actions such as , , or checking a quotes status is NOT done through this API. If you are a trader please read through this section and then reference our .

API KEY

In order to use the API directly or through the SDK, an api key is required. Currently, all api key requests must be made to research@premia.finance. Please use subject line: 'API KEY REQUEST' and an api key will be returned.

Pool vs Orderbook

Since all trades must make their way on-chain in some way shape or form, the pool contract for a specific market can be viewed as the "gateway" for this. The pool contract currently supports dual functionality for both interacting with the AMM and interacting with the Orderbook. Functions which include OB in their name are designated for Orderbook functionality

Orderbook

As mentioned in the , quotes are published (by emitting events) to Arbitrum Nova and can be accessed by anyone listening to events on-chain. The Orderbook API will publish quotes for market makers on their behalf and aggregate public order events to create a limit orderbook for any deployed/deployable pool.

When posting an order, a deadline is provided in the quote object which specifies the duration a quote is valid for. When a deadline is surpassed, the quote will expire without the need for action by the quote maker. However, if a user would like to prematurely void a quote before the deadline is hit, they must invoke the cancel function within the pool contract .

To fill an order that was published to the orderbook, a user must call the fill function available on the pool contract . Filling orders (as a taker) will incur a transaction fee. Please see for more details.

IMPORTANT: Unlike LP's, makers who utilize the orderbook do NOT collect trading fees.

RFQ

Request-For-Quote is an additional feature available through the orderbook infrastructure in which users can publish requests for a specific pool and receive personalized quotes from market makers. Publishing a request can only be done via , but receiving requests can be done via or .

What is an RFQ request look like? It is simply an object with the following details:

  • PoolKey -> the pool identifier object (base token, quote token, oracle address, strike, maturity, call or put)

  • Side -> either a 'bid' or 'ask'

  • ChainId -> the chain id (Arbitrum One Mainnet or Goerli Arbitrum Testnet)

  • Size -> the quantity that is be requested

  • Taker -> the address of the user requesting the quote

When a market maker receives this request (via WEBSOCKET), they will then generate a personalized quote and publish a quote to the orderbook for this request. There is no guarantee that a quote will be returned back after publishing an RFQ request.

Orderbook vs. RFQ Quotes

NOTE: It's important for market makers to publish RFQ quotes with the takerAddress in the quote object populated with the taker address from the request (as opposed to Zero Address). While the quote is viewable by anyone, the quote can only be filled by the requester.

The main difference between an RFQ quote and an orderbook quote is that the takerAddress is not populated within the quote object for standard quotes. This mean the quote can be filled by any taker address on Arbitrum One. This makes the quote "public". If the takerAddress is populated with an address, it can only be filled by this address, making the order "private". Private quotes are created when a Request-For-Quote is made by a user. See for more information on how to publish an RFQ.

REST API
WEBSOCKET
cancelling
filling
fillable
Containerized API
Orderbook Concepts
here
here
Fees
WEBSOCKET
REST API
WEBSOCKET
here