Get Order History

Get Order History

GET https://api.swivel.exchange/v2/users/:address/orders?underlying=u&maturity=m&protocol=p&status=s

This endpoint allows you to request the order history for a given address, and allows filtering by active, cancelled, full and expired statuses. Returns chronologically sorted orders for a given address.

Query Parameters

NameTypeDescription

address*

string

Public key of an order's creator

underlying*

string

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

maturity*

string

The maturity of market in unix seconds.

status

list(string)

List of statuses expired, cancelled, full or insolvent.

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

}

{
    "orders": [
        {
            "order": {
                "key": "0x279eb2584cb32ccc7a512d3d46e3dbb83ecde4b0c231c3f4838cae0ea70223e8",
                "maker": "0x096Da21Ac79ae1EDbC69A07CE5c705E6c77Fec90",
                "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa",
                "vault": false,
                "exit": false,
                "principal": "30000000000000000000000",
                "premium": "3333000000000000000000",
                "maturity": "1669957199",
                "expiry": "1641372040",
                "protocol": 1
            },
            "meta": {
                "price": "0.1111",
                "signature": "0x75d626fdf62c67cf1de04f077fd7447f1164976f7f60826a63eece886923c11b59f061bd7b6d81fa96cdc3208ff53d4926ad8ba66d06a9101cc81d0e23792aaa1c",
                "premiumAvailable": "3333000000000000000000",
                "principalAvailable": "30000000000000000000000",
                "sequence": 63604
            }
        },
        {
            "order": {
                "key": "0xa8181ff6e0bfa16130944d5add7220eed46f44796de7d4216728dde40376ac5e",
                "maker": "0x096Da21Ac79ae1EDbC69A07CE5c705E6c77Fec90",
                "underlying": "0x5592EC0cfb4dbc12D3aB100b257153436a1f0FEa",
                "vault": true,
                "exit": false,
                "principal": "107758620689655172413793",
                "premium": "10000000000000000000000",
                "maturity": "1669957199",
                "expiry": "1641371984",
                "protocol": 1
            },
            "meta": {
                "price": "0.0928",
                "signature": "0xa4e8958193cf2cb9c70e4c4a7df9c3c7b68f89fd2f250d80e6bc9dbd9cba8c54415fb2f4d8da33c1d81d5a028233255b52adbf36bee3a2a929fb3ea3e735ff7a1c",
                "premiumAvailable": "10000000000000000000000",
                "principalAvailable": "107758620689655172413793",
                "sequence": 63593
            }
        },
    ...
    ]
}

Last updated