LogoLogo
Swivel v4.0.0
Swivel v4.0.0
  • Litepaper
    • Principal Tokens (PTs)
      • Exiting/Selling PTs
      • Secondary AMM's
    • Yield Tokens (YTs)
      • Exiting/Selling YTs
    • AMM vs. Orderbook
  • Swivel Safety Module (SSM)
    • Staking
    • Withdrawing
  • Swivel Exchange
    • Exchange Functions
      • Simple Fixed Yield Lending
      • Professional Fixed-Yield Lending
      • Purchasing YTs
      • Selling PTs
      • Selling YTs
      • Splitting/Combining Tokens
      • Redeeming Tokens/Interest
    • Maturity
    • Liquidity Incentives
    • Minimums, Rate Limits & Fees
    • Retroactive Distribution
    • How to Claim SWIV Tokens
  • Developers
    • Exchange API
      • GET
        • Get Markets
        • Orderbook
        • Get Order
        • OHCLV (Candles)
        • Get Effective Price (Preview Market Order)
        • Get Order History
        • Get Last Trade Info
      • POST
        • Order
    • Swivel.js
      • API
        • Swivel
        • MarketPlace
        • VaultTracker
    • Swivel.py
      • swivel
        • swivel.abstracts
          • swivel.abstracts.deployed
          • swivel.abstracts.market_place
          • swivel.abstracts.swivel
          • swivel.abstracts.vault_tracker
        • swivel.contracts
          • swivel.contracts.market_place
          • swivel.contracts.swivel
          • swivel.contracts.vault_tracker
        • swivel.vendors
          • swivel.vendors.signer
          • swivel.vendors.w3
    • Scrivel (Python Examples)
    • Contracts Overview
      • Contracts
        • Swivel
        • MarketPlace
        • VaultTracker
        • Creator
    • Ubiquitous Language V4
      • Shared Language
      • UI Language
      • Technical Language
      • Compound Language
      • Finance Terms
  • Community & Media
  • Incentives
  • Other Resources
    • Institutions
      • Rate Profile Optimization
        • Instruments and Participants
        • Market Opportunities and Pricing
        • Counterparty Risk Management
        • Benefits and drawbacks of standardization
        • User Needs
          • Corporate Treasury and Funding
          • Institutional Investors and Asset Managers
          • Speculators and Proprietary Trading Functions
          • Brokers and Market Makers
          • Liquidity Management, Funding and Resource Management
          • Risk Management and Insurance
          • Smaller Institutions and Individuals
      • Swivel for Enterprise
        • Overview
        • How Swivel works
        • Flexible Order Book
        • Future Developments
      • Delegated Credit
        • Challenges of Delegated Credit
          • Credit Pools
          • Intermediating Trust in Credit Delegation
Powered by GitBook
On this page
  1. Developers
  2. Exchange API
  3. GET

OHCLV (Candles)

Get OHCLV

GET https://api.swivel.exchange/v4/samples?underlying=x&maturity=y&protocol=p&start=z&end=e&interval=f&type=g

This endpoint allows you to request OHLCV points for the given period. Returns OHLCV points with each containing its OHLCV data at the given timestamp.

Query Parameters

Name
Type
Description

interval*

string

The time between datapoints in minutes dividable by 5. E.g. 5, 15, 30, 60, ...

maturity*

string

The maturity of market in unix seconds.

underlying*

string

The underlying token contract being transacted. E.g. USDC, DAI, etc.,

start*

number

Start of of the period in seconds

end*

number

End of the period in seconds

type*

string

Sampling type e.g. OHLCV

protocol*

integer

A pointer that refers to a given yield bearing market like Lido or Compound.

The protocol enum values:

enum Protocols {

Erc4626 = 0,

Compound = 1,

Rari = 2,

Yearn = 3,

Aave = 4,

Euler = 5,

Lido = 6

}

[
    {
        "timestamp": 1638472500,
        "data": {
            "open": "0.0499",
            "high": "0.0499",
            "low": "0.0499",
            "close": "0.0499",
            "volume": "252275019238957087498"
        }
    },
    {
        "timestamp": 1638473400,
        "data": {
            "open": "0.0499",
            "high": "0.05",
            "low": "0.0499",
            "close": "0.05",
            "volume": "170000000000000000000"
        }
    },
...
]
{
    "error": {
        "message": "invalid maturity"
    }
}
PreviousGet OrderNextGet Effective Price (Preview Market Order)

Last updated 1 year ago