GET
All GET endpoints are documented here. Base URLs should be changed in relation to the environment that is used: Testnet or Mainnet.
Get Markets
GET
https://api.swivel.exchange/v2/markets?status=s&depth=d
This endpoint allows you to request a list of markets.
Query Parameters
status
string
active or matured
depth
integer
The number of markets to return.
Get Orderbook
GET
https://api.swivel.exchange/v2/orderbook?underlying=u&maturity=m&protocol=p&depth=d
This endpoint allows you to request an orderbook of a given depth for a specified market. Returns receiving premium and paying premium orders in descending/ascending order including availableVolume translated into both premiumAvailable and principalAvailable.
Query Parameters
underlying*
string
The underlying token being transacted. E.g. USDC, DAI, etc.,
maturity*
string
The maturity of market in unix seconds.
depth
integer
The number of orders on each side of the orderbook to return.
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
}
Get Order
GET
https://api.swivel.exchange/v2/orders/key
This endpoint allows you to request the detailed state and parameters for a given order.
Returns the orders parameters as well as order price, volume available and initial timestamp.
Path Parameters
key*
String
Order key
Get Effective Price (Preview Market Order)
GET
https://api.swivel.exchange/v2/fillpreview?underlying=u&maturity=m&protocol=p&volume=v&vault=w&exit=e
This endpoint allows you to request a limit order payload that matches a given market order. Returns the effective price as well as orders for consumption.
Query Parameters
underlying*
string
The underlying token being transacted. E.g. USDC, DAI, etc.,
maturity*
string
The duration of the rolling-maturity market in seconds. E.g. 31536000 (12 months)
volume*
string
The amount of currency to use.
vault*
boolean
Indicates if an order is in relation to a initiating/exiting a vault or zcToken
exit*
boolean
Indicated if an order is an exit or an initiate
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
}
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
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
}
Get Last Trade Info
GET
https://api.swivel.exchange/v2/fills?underlying=u&maturity=m&protocol=p&depth=d
This endpoint allows you to request the agreement most recently initiated in a given market. (The trade last made in a given market) Returns the parameters of the most recent agreement for the specified market.
Query Parameters
underlying*
string
The underlying token being transacted. E.g. USDC, DAI, etc.,
maturity*
string
The maturity of market in unix seconds.
depth*
string
Should always be 1 to return one last trade. If more specified, the result will be a sorted list of last trades.
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
}
Get OHCLV
GET
https://api.swivel.exchange/v2/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
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
}
Last updated