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

Was this helpful?

  1. Developer Center
  2. APIs
  3. Containerized API
  4. API Reference
  5. Orderbook

Quotes

PreviousOrderbookNextOrders

Last updated 1 year ago

Was this helpful?

Publishes option quote(s) on-chain and into the orderbook (max quotes quantity is 200). Please note there is no gas that is paid to publish quotes. Deadline is the number of seconds the order is valid for. Price is normalized. For calls, price is denominated in the base token (ie 0.13 WETH), and for puts price is in denominated in the quote token but normalized using strike. For example, a put price of 0.13 => (234 USDC price / 1800 Strike ) is equivalent to 234 USDC if the strike is 1800. The takerAddress is optional and should only be populated if responding to an RFQ, otherwise omit.

post
Authorizations
Body
basestringRequiredExample: WETH
quotestringRequiredExample: USDC
expirationstringRequiredExample: 03NOV23Pattern: ^\d\d\w\w\w\d\d$
strikenumberRequiredExample: 1800
typestringRequiredExample: PPattern: ^C$|^P$
sidestringRequiredExample: bidPattern: ^bid$|^ask$
sizenumberRequiredExample: 4
pricenumberRequiredExample: .13
deadlineintegerRequiredExample: 120
takerstringOptionalExample: 0x...4cFF2Pattern: ^0x[a-fA-F0-9]{40}$
Responses
200
Quote exists
application/json
201
Quote created
application/json
400
Bad request
application/json
401
Not authorized
application/json
post
POST /orderbook/quotes HTTP/1.1
Host: 
x-apikey: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 152

[
  {
    "base": "WETH",
    "quote": "USDC",
    "expiration": "03NOV23",
    "strike": 1800,
    "type": "P",
    "side": "bid",
    "size": 4,
    "price": ".13",
    "deadline": 120,
    "taker": "0x...4cFF2"
  }
]
{
  "failed": [
    {
      "reason": "Quote deadline is invalid (cannot be less than 10 sec)",
      "quote": {
        "base": "WETH",
        "quote": "USDC",
        "expiration": "03NOV23",
        "strike": 1700,
        "type": "P",
        "side": "bid",
        "remainingSize": 3,
        "provider": "0x3ba638...fb25e",
        "taker": "0x0000000000000000000000000000000000000000",
        "price": ".15",
        "deadline": 184,
        "quoteId": "0x3ba638...fb25e",
        "ts": 1698952534
      }
    }
  ],
  "exists": [
    {
      "base": "WETH",
      "quote": "USDC",
      "expiration": "03NOV23",
      "strike": 1700,
      "type": "P",
      "side": "bid",
      "remainingSize": 3,
      "provider": "0x3ba638...fb25e",
      "taker": "0x0000000000000000000000000000000000000000",
      "price": ".15",
      "deadline": 184,
      "quoteId": "0x3ba638...fb25e",
      "ts": 1698952534
    }
  ]
}

Get all quotes for a specific option up to a specified size/qty. All orders will be ranked from best to worst according to price. Please note that this will not show the full state of the orderbook if the total market liquidity is greater than the size specified.

get
Authorizations
Query parameters
basestringRequired

base token symbol (ie WETH)

Example: WETH
quotestringRequired

quote token symbol (ie USDC)

Example: USDC
expirationstringRequired

option expiration (ie 03NOV23)

Example: 03NOV23
strikenumberRequired

option strike (ie 1800)

Example: 1800
typestringRequired

C or P

Example: PPattern: ^C$|^P$
sizenumberRequired

number of contracts (ie 4)

Example: 4
sidestringRequired

orderbook side (ie bid)

Example: bidPattern: ^bid$|^ask$
providerstringOptional

unique address of the provider (maker)

Example: 0x3ba638...fb25ePattern: ^0x[a-fA-F0-9]{40}$
takerstringOptional

unique address of the taker (only for rfq quotes)

Example: 0x3ba638...fb25ePattern: ^0x[a-fA-F0-9]{40}$
Responses
200
Successful operation
application/json
400
Invalid parameters supplied
application/json
401
Not authorized
application/json
get
GET /orderbook/quotes?base=WETH&quote=USDC&expiration=03NOV23&strike=1800&type=P&size=4&side=bid HTTP/1.1
Host: 
x-apikey: YOUR_API_KEY
Accept: */*
[
  {
    "base": "WETH",
    "quote": "USDC",
    "expiration": "03NOV23",
    "strike": 1700,
    "type": "P",
    "side": "bid",
    "remainingSize": 3,
    "provider": "0x3ba638...fb25e",
    "taker": "0x0000000000000000000000000000000000000000",
    "price": ".15",
    "deadline": 184,
    "quoteId": "0x3ba638...fb25e",
    "ts": 1698952534
  }
]
  • GETGet all quotes for a specific option up to a specified size/qty. All orders will be ranked from best to worst according to price. Please note that this will not show the full state of the orderbook if the total market liquidity is greater than the size specified.
  • POSTPublishes option quote(s) on-chain and into the orderbook (max quotes quantity is 200). Please note there is no gas that is paid to publish quotes. Deadline is the number of seconds the order is valid for. Price is normalized. For calls, price is denominated in the base token (ie 0.13 WETH), and for puts price is in denominated in the quote token but normalized using strike. For example, a put price of 0.13 => (234 USDC price / 1800 Strike ) is equivalent to 234 USDC if the strike is 1800. The takerAddress is optional and should only be populated if responding to an RFQ, otherwise omit.
  • DELETEDeletes the quote(s) from the orderbook that have not exceeded their deadline (max quotes quantity is 25). Please note that orders that have surpassed their deadline do NOT need to be cancelled. They are automatically removed from the orderbook and are unfillable on-chain. Cancelling orders does incur on-chain gas fees.
  • PATCHUsed to fill quote(s) (max quotes quantity is 25). Only the size and quoteId for each quote are required. All quoteIds are returned either as 'success' or 'failed'. Each limit order that is trying to be filled is an "all or nothing" attempt.

Deletes the quote(s) from the orderbook that have not exceeded their deadline (max quotes quantity is 25). Please note that orders that have surpassed their deadline do NOT need to be cancelled. They are automatically removed from the orderbook and are unfillable on-chain. Cancelling orders does incur on-chain gas fees.

delete
Authorizations
Body
quoteIdsstring[] ยท min: 1RequiredExample: 0x3ba638...fb25e
Responses
200
Quote cancelled
application/json
400
Invalid parameters supplied
application/json
401
Not authorized
application/json
delete
DELETE /orderbook/quotes HTTP/1.1
Host: 
x-apikey: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 35

[
  {
    "quoteIds": [
      "0x3ba638...fb25e"
    ]
  }
]
{
  "success": [
    "0x3ba638...fb25e"
  ],
  "failed": [
    "0x3ba638...fb25e"
  ],
  "omitted": [
    "0x3ba638...fb25e"
  ]
}

Used to fill quote(s) (max quotes quantity is 25). Only the size and quoteId for each quote are required. All quoteIds are returned either as 'success' or 'failed'. Each limit order that is trying to be filled is an "all or nothing" attempt.

patch
Authorizations
Body
tradeSizenumberRequiredExample: 4
quoteIdstringRequiredExample: 0x3ba638...fb25ePattern: [a-fA-F0-9]{64}$
Responses
200
Quotes filled
application/json
400
Bad request
application/json
401
Not authorized
application/json
patch
PATCH /orderbook/quotes HTTP/1.1
Host: 
x-apikey: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 46

[
  {
    "tradeSize": 4,
    "quoteId": "0x3ba638...fb25e"
  }
]
{
  "success": [
    "0x3ba638...fb25e"
  ],
  "failed": [
    "0x3ba638...fb25e"
  ]
}