C3 REST API (0.4)

Download OpenAPI specification:Download

C3

C3 Image C3 is a self-custodial exchange that utilizes a hybrid architecture combining off-chain and on-chain components for performance and security.

The off-chain component handles instant trade processing and matching, while the on-chain component handles trade settlement. This innovative hybrid architecture allows C3 to offer a trading platform that is both performant and accessible, similar to traditional exchanges, while remaining trustless and non-custodial at all times.

• Matching Engine: Users can place and cancel trade orders. Orders become either matched or enter the order book. Matched orders settle on-chain and evoke a borrow operation in case of trades on margin.

• Risk Engine: Operation Approval: Any operation – except deposits – passes through the risk engine and is approved or disapproved according to the risk of the user’s account.

• Borrowing & Lending Pool: Users can transfer assets to or from the pool, i.e. lend towards or borrow from the pool. Users’ principals accrue interest over time.

• Liquidation: Unhealthy accounts, i.e. accounts which fail to respect the maintenance margin requirement, can be liquidated by any C3 user, if their liquidation requests are valid.

Blockchains and Assets Supported:

  • Algorand (ALGO)
  • Ethereum (ETH, USDC, WBTC)
  • Avalanche (AVAX, USDC)
  • Arbitrum (ARB, USDC)
  • BSC (BNB)
  • Solana (SOL, PYTH, W)

Find more info check our Blog!

For API Support use the #api-support channel on Discord

Websockets Documentation

Error Codes

General

Code HTTP Status Code Message
10000 500 "Unknown Error"
10001 429 "Too many requests"
10002 400 "Couldn't find instrument with asset id: {param0}"
10003 400 "Invalid signature"
10004 500 "Signer is not available"
10005 500 "Mutex Timeout Processing Requests for the user {param0}"

Delegation

Code HTTP Status Code Message
11000 400 "Couldn't validate signature for the user {param0}"
11001 400 "Delegation name must be less than 32 characters"
11002 400 "Can't withdraw from delegated account"
11003 401 "Only the owner of the account can view their delegations"
11004 401 "Only the owner of the account can delegate"
11005 400 "Cannot delegate to yourself"
11006 401 "Only the owner of the account can revoke delegation"
11007 500 "A delegation to that user is already in place"
11008 410 "Invalid delegation id for the user or already revoked"
11009 400 "Expiration time cannot be more than the maximum allowed. The maximum time is {param0} days"

Operations

Code HTTP Status Code Message
12000 400 "Not enough fees to withdraw {param0}, expected fee: {param1}, received fee: {param2}"
12001 400 "Not enough balance and max borrow to withdraw {param0}"
12002 451 "Unsafe Withdraw to destination Address: {param0}, Chain: {param1}."
12003 400 "Withdraw would result in negative available margin {param0}"
12004 400 "Operation Account ID {param0} doesn't match with endpoint"
12005 400 "Unknown operation type {param0}"
12006 400 "Invalid destination chain, fee not found"
12007 400 "Not enough available cash to perform the operation"
12008 400 "Not enough lend position to redeem"
12009 400 "Not enough margin available to execute the borrow without netting"
12010 400 "Pool move operation would result in negative available margin {param0} or less than old margin {param1}"
12011 400 "Amount in request {param0} doesn't match the amount in the signed transaction {param1}"
12012 400 "Invalid VAA, it doesn't match with the request. receivedInstrument.asaId: {param0}, req.assetId: {param1}, req.amount: {param2}, amountBuffer: {param3}"
12013 400 "Repay amount in request {param0} doesn't match the repay amount encoded in VAA {param1}"
12014 451 "Unsafe Deposit origin from Address: {param0}, Chain: {param1}."
12016 400 "This deposit VAA is in process or was already redeemed"
12017 400 "Pool move operation value is below the required minimum of {param0} USD"
13000 500 "Couldn't find oracle price for asset id: {param0}"
13001 500 "Couldn't find price snapshot for market :{param0}"
13002 500 "Last price snapshot is not currently available for market :{param0}, please retry later..."
13003 400 "Invalid granularity {param0}"
13004 500 "Price oracle is not available"

Orders

Code HTTP Status Code Message
14000 500 "Not enough available liquidity in pool"
14001 400 "Not enough funds to open order"
14002 400 "Invalid order: sell amount can never be zero"
14003 400 "Invalid order: both amounts are zero"
14004 400 "Buy Market amount converted to Base is close to minimum allowed. Base Amount: {param0}. Minimum: {param1}"
14005 400 "Price {param0} isn't a multiple for this pair. Price Quantum: {param1}"
14006 400 "Base amount is not a multiple. Base Amount: {param0}. Amount Quantum: {param1}"
14007 400 "Base amount is less than the minimum allowed. Base Amount: {param0}. Minimum: {param1}"
14008 400 "Base amount is more than the maximum allowed. Base Amount: {param0}. Maximum: {param1}"
14009 400 "Order expiry {param0} is not in the allowed range in UnixTime (seconds): [{param0} - {param1}]"
14010 400 "Max Borrow/Redeem amount ({param0}) is lower than expected order shortfall : ({param1})"
14011 400 "Creator address does not match the one in request"
14012 500 "Unexpected error creating order"
14013 400 "Order {param0} has invalid signature for user {param1}"
14014 400 "Expected Base64 of the public key {param0} (derived from order account address)"
14015 400 "Couldn't verify the signature for user {param0}"
14016 400 "Cant find Account Info for user Address : {param0}"
14017 400 "Wrong parameters allOrdersUntil and orders where both undefined."
14018 400 "Opening this order would put the account in an unhealthy state"
14019 400 "Specified order margin is not enough to cover cost"
14020 400 "Not enough funds in the system to open margin order, please try again later"
14021 400 "Not enough cash or max borrow to open the order. Cash: {param0}, Max Borrow: {param1}, Sell Amount (With Fees): {param2}"
14022 400 "Requested order price {param0} doesnt match with buy / sell price specified in the settlement ticket {param1}"
14023 400 "Invalid price in settlement ticket for market order buyAmount should be 0"

Liquidation

Code HTTP Status Code Message
15000 400 "Target Account ID {param0} is healthy therefore it cannot be liquidated"
15001 400 "Target Account ID {param0} health ({param1}) is lower than min liquidation threshold {param2}"
15002 400 "Liquidator doesn't have enough available margin for this operation"
15003 500 "User {param0} is currently going through a liquidation process, no operation can be accepted until it's finished."
15004 400 "Instrument not found for asset id {param0} in {param1} basket"
15005 400 "Price not found for asset id {param0} in {param1} basket"
15006 400 "Found negative or zero cash in basket for asset id {param0}"
15007 400 "Liquidatee was not defined correctly"
15008 400 "Cannot liquidate yourself"
15009 400 "Liquidation requested collateral value ({param0} USD) is greater than assumed debt value ({param1} USD)"
15010 400 "Found zero principal in pool basket for asset id {param0}"
15011 400 "Amount specified in basket for {param0} and assetId {param1} is greater than available"
15012 400 "User {param0} is healthy after orders are closed therefore it cannot be liquidated"
15013 400 "Target user {param0} does not exist"
15014 400 "Instruments in basket should be ordered strictly ascending by SlotId"

System

getSystemInfo

Returns the system info. That includes the current block parsed, contract ids, addresses and more.

Responses

Response samples

Content type
application/json
{
  • "commitHash": "123456e9cdc015e68db916fa1234e84fc30681ce",
  • "serverAddress": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
  • "withdrawBuffer": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
  • "lastBlockParsed": 30628460,
  • "cctpHubAddress": "0xcccc12345678901234567890123456789012abcd",
  • "contractIds": {
    }
}

Instruments

getInstruments

Returns the lists of all the instruments (Assets) used in the system.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getInstrumentsPools

Returns the list of all instrument pools in the system.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

getInstrumentsPrices

Returns a list of the prices of assets used in C3. Prices are used to calculate each user's position's health. Prices are fetched from Pyth.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Markets

Market sth

getMarkets

Returns info of each market available in C3 Exchange.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getMarket

Returns static data for a particular market.

path Parameters
marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

Responses

Response samples

Content type
application/json
{
  • "id": "BTC-USDC",
  • "baseInstrument": {
    },
  • "quoteInstrument": {
    },
  • "priceIncrement": 0.01,
  • "quantityIncrement": 0.0001,
  • "minQuantity": 0.0005,
  • "maxQuantity": 50
}

getMarketStats

Returns statistics and dynamic data for a particular market.

path Parameters
marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getMarketBars

Returns price history for a particular market.

path Parameters
marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
from
required
integer (Timestamp)

Start timestamp interval inclusive

to
required
integer (Timestamp)

End timestamp interval not inclusive

granularity
required
string (GranularityName)
Enum: "5m" "1H" "1D"

Granularity name

pageSize
integer (CountBars) [ 1 .. 500 ]
Example: pageSize=10

The maximum amount of levels to return

Responses

Response samples

Content type
application/json
{
  • "id": "BTC-USDC",
  • "bars": [
    ]
}

getMarketOrderbook

Returns statistics and dynamic data for a particular market.

path Parameters
marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
priceGrouping
string (Price)
Example: priceGrouping=26258.82

The price value to group the orders into different levels

pageSize
integer (Count) [ 1 .. 100 ]
Example: pageSize=10

The maximum amount of levels to return

Responses

Response samples

Content type
application/json
{
  • "id": "BTC-USDC",
  • "priceGrouping": 2.345,
  • "bids": [
    ],
  • "asks": [
    ]
}

getMarketTrades

Returns latest trades data for a particular market.

path Parameters
marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
pageSize
integer (Count) [ 1 .. 100 ]
Example: pageSize=10

The maximum amount of trades to return

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getOrderBookSnapshot

Returns the full order book aggregated by price. Please use this in conjunction with websocket delta feed to keep an updated order book

path Parameters
marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
pageSize
integer (Count) [ 1 .. 100 ]
Example: pageSize=10

The maximum amount of levels to return

Responses

Response samples

Content type
application/json
{
  • "id": "BTC-USDC",
  • "priceGrouping": 2.345,
  • "bids": [
    ],
  • "asks": [
    ]
}

User

loginStart

Initiates the login process by generating a nonce that must be signed by the user. The returned message is human-readable, providing a welcome to C3.

query Parameters
chainId
required
number (ChainId)
Enum: 1 2 4 6 8 23 10002 10003

The Chain ID represents different blockchain networks. Here's a mapping of the Chain IDs Supported by C3:

  • 1: SOLANA
  • 2: ETH
  • 4: BSC
  • 6: AVAX
  • 8: ALGORAND
  • 23: ARBITRUM
  • 10002: SEPOLIA (ONLY FOR TESTNET ENVIRONMENT)
  • 10003: ARBITRUM SEPOLIA (ONLY FOR TESTNET ENVIRONMENT)
address
required
string

Blockchain Public Address

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

loginComplete

Continues the login process by verifying the signed nonce obtained from the /loginStart endpoint. Returns user information including user ID, account ID, JWT token, and additional login statistics.

Request Body schema: application/json
required
chainId
required
number (ChainId)
Enum: 1 2 4 6 8 23 10002 10003

The Chain ID represents different blockchain networks. Here's a mapping of the Chain IDs Supported by C3:

  • 1: SOLANA
  • 2: ETH
  • 4: BSC
  • 6: AVAX
  • 8: ALGORAND
  • 23: ARBITRUM
  • 10002: SEPOLIA (ONLY FOR TESTNET ENVIRONMENT)
  • 10003: ARBITRUM SEPOLIA (ONLY FOR TESTNET ENVIRONMENT)
address
required
string (UserId)

The unique identifier assigned to a user, currently equivalent to the user's address. Note that this association may evolve over time.

signature
required
string (LoginSignature)

The signature of the nonce obtained from the /loginStart endpoint

object (Ephemeral Data)

Responses

Request samples

Content type
application/json
{
  • "chainId": 1,
  • "address": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
  • "signature": "string",
  • "ephemeralData": {
    }
}

Response samples

Content type
application/json
{
  • "userId": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
  • "accountId": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
  • "token": "Bearer ABC123",
  • "firstLogin": true,
  • "encryptionKey": "string"
}

loginStatus

Returns the current status of the user's login session.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "encryptionKey": "string"
}

logout

Log out the account.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Account

getAccount

Returns static data for a particular account.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Responses

Response samples

Content type
application/json
{
  • "id": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
  • "owner": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
  • "wallet": {
    },
  • "createdOn": 0
}

getAccountMarketLimits

Returns limits information for a particular maket for this account. Note: in future versiones the user should be able to reduce their limits explicitly.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

Responses

Response samples

Content type
application/json
{
  • "maxBuyOrderSize": "string",
  • "maxSellOrderSize": "string",
  • "buyAvailableCash": "string",
  • "sellAvailableCash": "string",
  • "buyPoolBalance": "string",
  • "sellPoolBalance": "string"
}

getAccountTradesForMarket

Returns trades made by this account for a particular market.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
beforeId
string (FillId)
Example: beforeId=12313546546

Unique identifier for a both sides of a trade

pageSize
integer (CountTrades) [ 1 .. 1000 ]
Example: pageSize=10
creator
string (UserId)
Example: creator=24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE

The unique identifier assigned to a user, currently equivalent to the user's address. Note that this association may evolve over time.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getAccountOrdersForMarket

Returns orders created by this account for a particular market.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
isOpen
boolean
Default: true

If true, only currently open orders will be returned

creator
string (UserId)
Example: creator=24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE

The unique identifier assigned to a user, currently equivalent to the user's address. Note that this association may evolve over time.

ids
Array of strings (OrderId)
Example: ids=I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=

Optional list of order ids to retrieve

fieldsToIgnore
Array of strings (IgnorableOrderFields)
Items Enum: "openOrderData" "trades" "cancelOrderTicket" "makerFees" "takerFees"

Optional list of order fields to remove from each retrieved order. This parameter can be used to reduce the amount of information retrieved.

offset
number
pageSize
integer (Count) [ 1 .. 100 ]
Example: pageSize=10

Responses

Response samples

Content type
application/json
[
  • {
    }
]

submitNewOrders

Place a new order.

This action represents the user's intention to place a new order in a 'human-readable' language, as well as the settlement ticket, which is the message data signed by the user and then verified by the smart contract.

Although most of the 'human-readable' data (such as marketId, type, side, size) could be calculated from the settlement ticket data, we believe that explicitly stating this data by the user will improve the API's usability.

It will also enable the system to assist and ensure that the smart contract data accurately represents the user's intention.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

Request Body schema: application/json
One of
marketId
required
string (MarketId)

Market identification or name

type
required
string (OrderType)
Enum: "limit" "market"
side
required
string (OrderSide)
Enum: "buy" "sell"
size
required
string

Size of the order, in base currency for limit and sell market orders, in quote for buy market orderrs. (i.e. a limit ETH-USDC of size 1 represents 1 ETH, a buy market ETH-USDC of size 10 represents 10 USDC ).

required
object (SettlementTicket)

This entity contains all the required data to validate and settle the order execution by the underlying smart contracts.

price
string (Price)
sentTime
integer (Timestamp)

Epoch time in milliseconds

clientOrderId
string <= 64 characters

Unique client order identification

Responses

Request samples

Content type
application/json
Example
{
  • "marketId": "BTC-USDC",
  • "type": "limit",
  • "side": "buy",
  • "price": 19175.5,
  • "size": 1,
  • "settlementTicket": {
    },
  • "sentTime": 1667187723000000,
  • "clientOrderId": "8e9fe0b1-abe2-47ec-b851-c2f45c0c06aa"
}

Response samples

Content type
application/json
[
  • {
    }
]

cancelMarketOrders

Allow the user to cancel all market orders

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

marketId
required
string (MarketId)
Example: BTC-USDC

Market identification or name

query Parameters
signature
required
string (Signature)
creator
string (UserId)
Example: creator=24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE

The unique identifier assigned to a user, currently equivalent to the user's address. Note that this association may evolve over time.

allOrdersUntil
required
integer (Timestamp)

Epoch time in milliseconds

Responses

Response samples

Content type
application/json
[
  • null
]

cancelOrders

Allow the user to cancel multiple open orders

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

query Parameters
orders
Array of strings (OrderId)
Example: orders=I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=
signature
required
string (Signature)
creator
string (UserId)
Example: creator=24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE

The unique identifier assigned to a user, currently equivalent to the user's address. Note that this association may evolve over time.

allOrdersUntil
integer (Timestamp)

Epoch time in milliseconds

Responses

Response samples

Content type
application/json
[
  • null
]

submitDeposit

Initializes a deposit operation.

path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Request Body schema: application/json
One of
instrumentId
required
string (InstrumentId)

Instrument identification or name

amount
required
string (Quantity)
repayAmount
required
string (Quantity)
note
string
algorandSignedFundingTransaction
required
string (AlgorandSignedTransaction)

Responses

Request samples

Content type
application/json
{
  • "instrumentId": "BTC",
  • "amount": "string",
  • "repayAmount": "string",
  • "note": "string",
  • "wormholeVAA": "string",
  • "overrideOriginChain": 1,
  • "overrideOriginAddress": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitWithdraw

Initializes a withdraw operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Request Body schema: application/json
lease
required
string (Lease)

Random 32 bytes number encoded in Base64 string

lastValid
required
number
signature
required
string (Signature)
amount
required
string (Quantity)
instrumentId
required
string (InstrumentId)

Instrument identification or name

maxBorrow
required
string (Quantity)
maxFees
required
string (Quantity)
required
object (WithdrawDestinationAddress)
solanaOwnerAddress
string

Solana owner address for the destination address

Responses

Request samples

Content type
application/json
{
  • "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
  • "lastValid": 30628460,
  • "signature": "string",
  • "amount": "string",
  • "instrumentId": "BTC",
  • "maxBorrow": "string",
  • "maxFees": "string",
  • "destination": {
    },
  • "solanaOwnerAddress": "6qp77EKaaJXEk2pEg4pNjJSfYepgZMxNjM9jX6Ke3VEG"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitLend

Initializes a lend operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

instrumentId
required
string (InstrumentId)
Example: BTC

Instrument identification or name

Request Body schema: application/json
lease
required
string (Lease)

Random 32 bytes number encoded in Base64 string

lastValid
required
number
signature
required
string (Signature)
amount
required
string (Quantity)

Responses

Request samples

Content type
application/json
{
  • "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
  • "lastValid": 30628460,
  • "signature": "string",
  • "amount": "string"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitRedeem

Initializes a redeem operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

instrumentId
required
string (InstrumentId)
Example: BTC

Instrument identification or name

Request Body schema: application/json
lease
required
string (Lease)

Random 32 bytes number encoded in Base64 string

lastValid
required
number
signature
required
string (Signature)
amount
required
string (Quantity)

Responses

Request samples

Content type
application/json
{
  • "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
  • "lastValid": 30628460,
  • "signature": "string",
  • "amount": "string"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitBorrow

Initializes a borrow operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

instrumentId
required
string (InstrumentId)
Example: BTC

Instrument identification or name

Request Body schema: application/json
lease
required
string (Lease)

Random 32 bytes number encoded in Base64 string

lastValid
required
number
signature
required
string (Signature)
amount
required
string (Quantity)

Responses

Request samples

Content type
application/json
{
  • "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
  • "lastValid": 30628460,
  • "signature": "string",
  • "amount": "string"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitRepay

Initializes a repay operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

instrumentId
required
string (InstrumentId)
Example: BTC

Instrument identification or name

Request Body schema: application/json
lease
required
string (Lease)

Random 32 bytes number encoded in Base64 string

lastValid
required
number
signature
required
string (Signature)
amount
required
string (Quantity)

Responses

Request samples

Content type
application/json
{
  • "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
  • "lastValid": 30628460,
  • "signature": "string",
  • "amount": "string"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitLiquidation

Initializes a liquidation operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The liquidator account

Request Body schema: application/json
lease
required
string (Lease)

Random 32 bytes number encoded in Base64 string

lastValid
required
number
signature
required
string (Signature)
required
Array of objects (Basket)
required
Array of objects (Basket)
target
required
string (AccountId)

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Responses

Request samples

Content type
application/json
{
  • "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
  • "lastValid": 30628460,
  • "signature": "string",
  • "liabilityBasket": [
    ],
  • "assetBasket": [
    ],
  • "target": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

submitRefund

Initializes a refund operation.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Request Body schema: application/json
required
object (CancelOrderTicket)
signature
required
string (Signature)

Responses

Request samples

Content type
application/json
{
  • "ticket": {
    },
  • "signature": "string"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

addNewDelegation

Adds permissions to a user.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Request Body schema: application/json
name
required
string <= 32 characters
delegatedTo
required
string (AccountId)

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

expiresOn
required
integer (TimestampSeconds)

Epoch time in seconds

nonce
required
number
signature
required
string (DelegationSignature)

Main account signature authorizing temporary operation delegation to another C3 account

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "delegatedTo": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
  • "expiresOn": 0,
  • "nonce": 0,
  • "signature": "string"
}

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

revokeDelegation

Revokes permissions from an account.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

query Parameters
id
required
string (DelegationId)
Example: id=1345344

Delegation identification.

Responses

Response samples

Content type
application/json
{
  • "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}

getDelegations

Returns accounts and permissions.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getAccountBalance

Returns current balance for this account.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

Responses

Response samples

Content type
application/json
{
  • "portfolioOverview": {
    },
  • "instrumentsInfo": [
    ]
}

getAccountOperations

Returns operations related to this account.

Authorizations:
BearerAuth
path Parameters
accountId
required
string (AccountId)
Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS

The C3 Account Identification is a unique identifier that is derived from the user's address and serves to link the account to operations and positions within the platform. Note that this association may evolve over time.

query Parameters
types
Array of strings (Operation type)
Items Enum: "deposit" "withdraw" "lend" "redeem" "borrow" "repay" "liquidate" "account_move" "refund" "received_liquidation"

List of operation types to include, if not set it means all the operation types.

statuses
Array of strings (Account operation status)
Items Enum: "pending" "settled" "failed"

List of operation statuses to include, if not set it means all the operation statuses.

instrumentIds
Array of strings (InstrumentId)
Example: instrumentIds=BTC

List of related instruments to include, if not set it means all the instruments.

createdSince
integer (Timestamp)

The Operation should be created since this time or later

createdUntil
integer (Timestamp)

The Operation should be created until this time or before

idBefore
number

Only operations with an id lower than this will be returned

pageSize
integer (Count) [ 1 .. 100 ]
Example: pageSize=10

Number of items to return

Responses

Response samples

Content type
application/json
[
  • {
    }
]

getInsolventAccounts

Returns the lists of all the account which are in state of liquidation. Balances are also included

Responses

Response samples

Content type
application/json
{
  • "prices": [
    ],
  • "accounts": [
    ]
}