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.
Find more info check our Blog!
For API Support use the #api-support channel on Discord
Info in the C3 Exchange Websockets Documentation
Language | Link |
---|---|
Python | https://github.com/c3exchange/c3-python-sdk |
Typescript | https://github.com/c3exchange/c3-typescript-sdk |
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}" |
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" |
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" |
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" |
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" |
Returns the system info. That includes the current block parsed, contract ids, addresses and more.
{- "commitHash": "123456e9cdc015e68db916fa1234e84fc30681ce",
- "serverAddress": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "withdrawBuffer": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "lastBlockParsed": 30628460,
- "cctpHubAddress": "0xcccc12345678901234567890123456789012abcd",
- "contractIds": {
- "ceOnchain": 32754106,
- "pricecaster": 32754106
}
}
[- {
- "id": "ALGO",
- "asaId": 0,
- "asaName": "ALGO",
- "asaUnitName": "ALGO",
- "asaDecimals": 6,
- "slotId": 1,
- "chains": [ ],
- "riskParameters": {
- "initial": {
- "haircut": "0.4",
- "margin": "0.2"
}, - "maintenance": {
- "haircut": "0.3",
- "margin": "0.1"
}, - "optUtilization": "0.8"
}
}
]
[- {
- "id": "ALGO",
- "borrowApr": 0,
- "lendApr": 0,
- "totalLiquidity": "1000",
- "totalBorrowed": "0"
}, - {
- "id": "BTC",
- "borrowApr": 0,
- "lendApr": 0,
- "totalLiquidity": "1000",
- "totalBorrowed": "0"
}
]
[- {
- "id": "BTC-USDC",
- "baseInstrument": {
- "id": "SOL",
- "asaId": 102,
- "asaName": "wormhole.sol",
- "asaUnitName": "wSOL",
- "asaDecimals": 9,
- "chains": [
- {
- "chainId": 8,
- "tokenAddress": "0xE654DB9dF47dfe951875a572236feD592CeC2a2b"
}
]
}, - "quoteInstrument": {
- "id": "USDC",
- "asaId": 31566704,
- "asaName": "USDC",
- "asaUnitName": "USDC",
- "asaDecimals": 6,
- "chains": [
- {
- "chainId": 2,
- "tokenAddress": "0x7679D36F06196a0045e233Cae6DfE515D2c59A8F"
}, - {
- "chainId": 8,
- "tokenAddress": "0x4B01CD8a125dda1331bC15146c1C26966a6574b9"
}
]
}, - "priceIncrement": 0.01,
- "quantityIncrement": 0.0001,
- "minQuantity": 0.0005,
- "maxQuantity": 50
}
]
Returns static data for a particular market.
marketId required | string (MarketId) Example: BTC-USDC Market identification or name |
{- "id": "BTC-USDC",
- "baseInstrument": {
- "id": "SOL",
- "asaId": 102,
- "asaName": "wormhole.sol",
- "asaUnitName": "wSOL",
- "asaDecimals": 9,
- "chains": [
- {
- "chainId": 8,
- "tokenAddress": "0xE654DB9dF47dfe951875a572236feD592CeC2a2b"
}
]
}, - "quoteInstrument": {
- "id": "USDC",
- "asaId": 31566704,
- "asaName": "USDC",
- "asaUnitName": "USDC",
- "asaDecimals": 6,
- "chains": [
- {
- "chainId": 2,
- "tokenAddress": "0x7679D36F06196a0045e233Cae6DfE515D2c59A8F"
}, - {
- "chainId": 8,
- "tokenAddress": "0x4B01CD8a125dda1331bC15146c1C26966a6574b9"
}
]
}, - "priceIncrement": 0.01,
- "quantityIncrement": 0.0001,
- "minQuantity": 0.0005,
- "maxQuantity": 50
}
Returns statistics and dynamic data for a particular market.
marketId required | string (MarketId) Example: BTC-USDC Market identification or name |
[- {
- "id": "BTC-USDC",
- "status": "trading",
- "24hrBar": [
- {
- "start": 1665892860,
- "end": 1665979260,
- "openPrice": 19180.63,
- "closePrice": 19172.32,
- "highPrice": 19425.84,
- "lowPrice": 19087.37,
- "baseVolume": 138750.0945,
- "quoteVolume": 2665799014.206784
}
]
}
]
Returns price history for a particular market.
marketId required | string (MarketId) Example: BTC-USDC Market identification or name |
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 |
{- "id": "BTC-USDC",
- "bars": [
- {
- "start": 1665979200,
- "end": 1665979260,
- "openPrice": 19180.63,
- "closePrice": 19172.32,
- "highPrice": 19181.84,
- "lowPrice": 19171.8,
- "baseVolume": 71.55,
- "quoteVolume": 1372329
}, - {
- "start": 1665979260,
- "end": 1665979320,
- "openPrice": 19172.32,
- "closePrice": 19162.98,
- "highPrice": 19183.74,
- "lowPrice": 19161.55,
- "baseVolume": 124.74,
- "quoteVolume": 2391296.985
}
]
}
Returns statistics and dynamic data for a particular market.
marketId required | string (MarketId) Example: BTC-USDC Market identification or name |
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 |
{- "id": "BTC-USDC",
- "priceGrouping": 2.345,
- "bids": [
- {
- "price": "26258.82",
- "volume": "string"
}
], - "asks": [
- {
- "price": "26258.82",
- "volume": "string"
}
]
}
Returns latest trades data for a particular market.
marketId required | string (MarketId) Example: BTC-USDC Market identification or name |
pageSize | integer (Count) [ 1 .. 100 ] Example: pageSize=10 The maximum amount of trades to return |
[- {
- "fillId": "12313546546",
- "marketId": "BTC-USDC",
- "buyOrderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "sellOrderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "tradeOn": 0,
- "tradeBaseAmount": "string",
- "tradeQuoteAmount": "string",
- "tradeBuyFees": "string",
- "tradeSellFees": "string",
- "tradeBuyBorrow": "string",
- "tradeBuyRepay": "string",
- "tradeSellBorrow": "string",
- "tradeSellRepay": "string",
- "tradePrice": "string",
- "buyOrderCompleted": true,
- "sellOrderCompleted": true,
- "buyOrderIsTaker": true,
- "status": "PENDING"
}
]
Returns the full order book aggregated by price. Please use this in conjunction with websocket delta feed to keep an updated order book
marketId required | string (MarketId) Example: BTC-USDC Market identification or name |
pageSize | integer (Count) [ 1 .. 100 ] Example: pageSize=10 The maximum amount of levels to return |
{- "id": "BTC-USDC",
- "priceGrouping": 2.345,
- "bids": [
- {
- "price": "26258.82",
- "volume": "string"
}
], - "asks": [
- {
- "price": "26258.82",
- "volume": "string"
}
]
}
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.
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:
|
address required | string Blockchain Public Address |
{- "code": "string",
- "message": "string"
}
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.
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:
|
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) |
{- "chainId": 1,
- "address": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "signature": "string",
- "ephemeralData": {
- "address": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "signature": "string",
- "expiresOn": 0
}
}
{- "userId": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "accountId": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "token": "Bearer ABC123",
- "firstLogin": true,
- "encryptionKey": "string"
}
Returns static data for a particular account.
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. |
{- "id": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "owner": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "wallet": {
- "chain": 1,
- "address": "0xa61BB243CF00Cd407ffAE11FDc51f5976cd2382D"
}, - "createdOn": 0
}
Returns limits information for a particular maket for this account. Note: in future versiones the user should be able to reduce their limits explicitly.
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 |
{- "maxBuyOrderSize": "string",
- "maxSellOrderSize": "string",
- "buyAvailableCash": "string",
- "sellAvailableCash": "string",
- "buyPoolBalance": "string",
- "sellPoolBalance": "string"
}
Returns trades made by this account for a particular market.
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 |
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. |
[- {
- "fillId": "12313546546",
- "marketId": "BTC-USDC",
- "buyOrderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "sellOrderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "tradeOn": 0,
- "tradeBaseAmount": "string",
- "tradeQuoteAmount": "string",
- "tradeBuyFees": "string",
- "tradeSellFees": "string",
- "tradeBuyBorrow": "string",
- "tradeBuyRepay": "string",
- "tradeSellBorrow": "string",
- "tradeSellRepay": "string",
- "tradePrice": "string",
- "buyOrderCompleted": true,
- "sellOrderCompleted": true,
- "buyOrderIsTaker": true,
- "status": "PENDING",
- "accountSide": "BUYER"
}
]
Returns orders created by this account for a particular market.
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 |
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 |
[- {
- "id": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "newOrderData": {
- "marketId": "BTC-USDC",
- "type": "limit",
- "side": "buy",
- "size": "string",
- "settlementTicket": {
- "account": "AQIDBAECAwQBAgMEAQIDBAECAwQBAgMEAQIDBAECAwQ=",
- "creator": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "buySlotId": 1,
- "buyAmount": "string",
- "sellSlotId": 1,
- "sellAmount": "string",
- "maxBuyAmountToPool": "string",
- "maxSellAmountFromPool": "string",
- "nonce": 0,
- "expiresOn": 0,
- "signature": "string"
}, - "price": "26258.82",
- "sentTime": 0,
- "clientOrderId": "862f572b-769b-41b6-9b9b-ac470c5d9bbb"
}, - "openOrderData": {
- "remainingAmount": "string",
- "locked": "string",
- "status": "Pending"
}, - "trades": [
- {
- "fillId": "12313546546",
- "marketId": "BTC-USDC",
- "buyOrderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "sellOrderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "tradeOn": 0,
- "tradeBaseAmount": "string",
- "tradeQuoteAmount": "string",
- "tradeBuyFees": "string",
- "tradeSellFees": "string",
- "tradeBuyBorrow": "string",
- "tradeBuyRepay": "string",
- "tradeSellBorrow": "string",
- "tradeSellRepay": "string",
- "tradePrice": "string",
- "buyOrderCompleted": true,
- "sellOrderCompleted": true,
- "buyOrderIsTaker": true,
- "status": "PENDING"
}
], - "cancelOrderTicket": {
- "account": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "creator": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "orderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "haveId": "BTC",
- "haveAmount": "string",
- "cancelOn": 0,
- "refundRequest": "string"
}, - "makerFees": "string",
- "takerFees": "string",
- "addedOn": 0
}
]
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.
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 |
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 |
{- "marketId": "BTC-USDC",
- "type": "limit",
- "side": "buy",
- "price": 19175.5,
- "size": 1,
- "settlementTicket": {
- "account": "4NBVMUVACZHLKXTU4WHGULXRPSYKR5MCRZ3FUVUGIJTVJBCL5GTUUUWHGM",
- "creator": "733BHFUPQ5BNKM6C3COBUSZVV5FVQHRNPKG7WQBQ4XNVA3WSCKBPGKVQXI",
- "buySlotId": 1,
- "buyAmount": 100000000,
- "sellSlotId": 2,
- "sellAmount": 19271377500,
- "maxBuyAmountToPool": 0,
- "maxSellAmountFromPool": 0,
- "expiresOn": 1667101802,
- "nonce": 16671018020000,
- "signature": "0xbe609aee343fb3c4b28e1df9e632fca64fcfaede20f02e86244efddf30957bd2"
}, - "sentTime": 1667187723000000,
- "clientOrderId": "8e9fe0b1-abe2-47ec-b851-c2f45c0c06aa"
}
[- {
- "id": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ="
}
]
Allow the user to cancel all market orders
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 |
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 |
[- null
]
Allow the user to cancel multiple open orders
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. |
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 |
[- null
]
Initializes a deposit operation.
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) Instrument identification or name |
amount required | string (Quantity) |
repayAmount required | string (Quantity) |
note | string |
algorandSignedFundingTransaction required | string (AlgorandSignedTransaction) |
{- "instrumentId": "BTC",
- "amount": "string",
- "repayAmount": "string",
- "note": "string",
- "wormholeVAA": "string",
- "overrideOriginChain": 1,
- "overrideOriginAddress": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a withdraw operation.
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. |
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 |
{- "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
- "lastValid": 30628460,
- "signature": "string",
- "amount": "string",
- "instrumentId": "BTC",
- "maxBorrow": "string",
- "maxFees": "string",
- "destination": {
- "chain": "ethereum",
- "address": "0xa61BB243CF00Cd407ffAE11FDc51f5976cd2382D"
}, - "solanaOwnerAddress": "6qp77EKaaJXEk2pEg4pNjJSfYepgZMxNjM9jX6Ke3VEG"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a lend operation.
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 |
lease required | string (Lease) Random 32 bytes number encoded in Base64 string |
lastValid required | number |
signature required | string (Signature) |
amount required | string (Quantity) |
{- "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
- "lastValid": 30628460,
- "signature": "string",
- "amount": "string"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a redeem operation.
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 |
lease required | string (Lease) Random 32 bytes number encoded in Base64 string |
lastValid required | number |
signature required | string (Signature) |
amount required | string (Quantity) |
{- "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
- "lastValid": 30628460,
- "signature": "string",
- "amount": "string"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a borrow operation.
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 |
lease required | string (Lease) Random 32 bytes number encoded in Base64 string |
lastValid required | number |
signature required | string (Signature) |
amount required | string (Quantity) |
{- "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
- "lastValid": 30628460,
- "signature": "string",
- "amount": "string"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a repay operation.
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 |
lease required | string (Lease) Random 32 bytes number encoded in Base64 string |
lastValid required | number |
signature required | string (Signature) |
amount required | string (Quantity) |
{- "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
- "lastValid": 30628460,
- "signature": "string",
- "amount": "string"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a liquidation operation.
accountId required | string (AccountId) Example: C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS The liquidator account |
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. |
{- "lease": "y1vC8jXwAlPEJccvS4v884/uvJj5tJc6bucKayD5P8M=",
- "lastValid": 30628460,
- "signature": "string",
- "liabilityBasket": [
- [
- {
- "instrumentId": "BTC",
- "amount": "0.1201"
}, - {
- "instrumentId": "ETH",
- "amount": "-2.4545"
}
]
], - "assetBasket": [
- [
- {
- "instrumentId": "BTC",
- "amount": "0.1201"
}, - {
- "instrumentId": "ETH",
- "amount": "-2.4545"
}
]
], - "target": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Initializes a refund operation.
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. |
required | object (CancelOrderTicket) |
signature required | string (Signature) |
{- "ticket": {
- "account": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "creator": "24AV37GGIROGSNBHH655DQAOQ75FBIVD2GSYGFV3ULEH3OYNQJWHKMQTEE",
- "orderId": "I0mJdYc0aShzRZgnNFlyNAlYcjmEVyk0dZKDRTQ0NDQ=",
- "haveId": "BTC",
- "haveAmount": "string",
- "cancelOn": 0,
- "refundRequest": "string"
}, - "signature": "string"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Adds permissions to a user.
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. |
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 |
{- "name": "string",
- "delegatedTo": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "expiresOn": 0,
- "nonce": 0,
- "signature": "string"
}
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Revokes permissions from an account.
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. |
id required | string (DelegationId) Example: id=1345344 Delegation identification. |
{- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc="
}
Returns accounts and permissions.
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. |
[- {
- "id": "1345344",
- "name": "string",
- "delegatedTo": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "expiresOn": 0,
- "createdOn": 0,
- "lastUsedOn": 0,
- "revokedOn": 0
}
]
Returns current balance for this account.
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. |
{- "portfolioOverview": {
- "value": "string",
- "availableMargin": "string",
- "buyingPower": "string",
- "health": "string",
- "leverage": "string",
- "adjustedMaintenanceMargin": "string",
- "maintenanceMarginSupport": 3232.00000001,
- "maintenanceMarginRequirement": 3232.00000001,
- "initialMarginSupport": 3232.00000001,
- "initialMarginRequirement": 3232.00000001
}, - "instrumentsInfo": [
- {
- "instrumentId": "BTC",
- "availableCash": "string",
- "lockedCash": "string",
- "maxBorrow": "string",
- "maxLend": "string",
- "maxWithdraw": "string",
- "maxWithdrawWithBorrow": "string",
- "cash": "string",
- "poolPosition": "string",
- "shortfall": "string"
}
]
}
Returns operations related to this account.
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. |
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 |
[- {
- "id": "OGKhmSE5rr+R2cx31/wNt5TaxYIYECWMlOvIkLwqjFc=",
- "type": "deposit",
- "status": "pending",
- "groupId": "string",
- "block": 0,
- "blockIndex": 0,
- "instrumentId": "BTC",
- "amount": "string",
- "createdOn": 0,
- "extraInfo": {
- "repayAmount": "string",
- "origin": {
- "chain": 1,
- "address": "0xa61BB243CF00Cd407ffAE11FDc51f5976cd2382D"
}
}, - "steps": [
- {
- "key": "string",
- "status": "string",
- "updatedOn": 0
}
]
}
]
Returns the lists of all the account which are in state of liquidation. Balances are also included
{- "prices": [
- [
- {
- "id": "BTC",
- "price": "25653.12"
}, - {
- "id": "ETH",
- "price": "1500.45"
}
]
], - "accounts": [
- {
- "accountId": "C3_L6VD42QWIR2ESDCZKY7B7TIYVSZNLKKLNHFODICR35B4YPOULFK6USCS",
- "health": "-25.45",
- "cash": [
- [
- {
- "instrumentId": "BTC",
- "amount": "0.1201"
}, - {
- "instrumentId": "ETH",
- "amount": "-2.4545"
}
]
], - "pool": [
- [
- {
- "instrumentId": "BTC",
- "amount": "0.1201"
}, - {
- "instrumentId": "ETH",
- "amount": "-2.4545"
}
]
]
}
]
}