Zarban API (2.0.0)

Download OpenAPI specification:Download

API for Zarban services.

Websocket

Websocket Upgrade

Upgrade to websocket connection

Responses

Permit

Get permit for single token

Get permit for single token

query Parameters
token
required
string0x[a-fA-F0-9]{40}

Ethereum address of the token

user
required
string0x[a-fA-F0-9]{40}

Ethereum address of the user

Responses

Response samples

Content type
application/json
{
  • "typedData": {
    },
  • "hash": "string"
}

Swap

Get a quote for a swap

Get a quote for a swap

Request Body schema: application/json
required
requestId
string^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[4][0-9a-fA-F]...
type
string (OrderType)
Enum: "Classic" "DutchLimit"
tradeType
required
string (TradeType)
Enum: "ExactInput" "ExactOutput"
inputToken
required
string^(0x)?[0-9a-fA-F]{40}$
outputToken
required
string^(0x)?[0-9a-fA-F]{40}$
amount
required
string
recipient
required
string^(0x)?[0-9a-fA-F]{40}$
object (QuoteRequestOptions)

Responses

Request samples

Content type
application/json
{
  • "requestId": "string",
  • "type": "Classic",
  • "tradeType": "ExactInput",
  • "inputToken": "0x1234567890123456789012345678901234567890",
  • "outputToken": "0x1234567890123456789012345678901234567890",
  • "amount": "123.456789",
  • "recipient": "string",
  • "options": {
    }
}

Response samples

Content type
application/json
{
  • "type": "Classic",
  • "tradeType": "ExactInput",
  • "time": {
    },
  • "amount": {
    },
  • "quote": {
    },
  • "quoteId": "string",
  • "gasPrice": {
    },
  • "gasUseEstimate": 0,
  • "gasFeeEstimate": {
    },
  • "routeString": "A -- [0x0000000000000000000000000000000000000012] --> B -- [0x0000000000000000000000000000000000000023] --> C",
  • "methodParameters": {
    },
  • "route": [
    ],
  • "orderInfo": {
    },
  • "encodedOrder": "string",
  • "orderHash": "string",
  • "permitData": {
    }
}

Orders

Updates Order Entity

updates an order entity in database

Request Body schema: application/json
required
orderHash
required
string^(0x)?[0-9a-fA-F]{64}$

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "msg": "Bad request",
  • "reasons": [
    ]
}

Fetch Unfilled Orders

Get a list of unfilled orders filtered by different parameters.

query Parameters
type
string
Enum: "limit" "dutch"

Type of the order

hash
string^0x[0-9,a-z,A-Z]{64}$

order hash

status
string
Enum: "open" "expired" "error" "cancelled" "filled" "insufficient-funds"

Status of the order

offerer
string0x[a-fA-F0-9]{40}

Ethereum address of the offerer

filler
string0x[a-fA-F0-9]{40}

Ethereum address of the filler

object (TimeRange)

Decay start time

object (TimeRange)

Decay end time

object (TimeRange)

Order deadline

cursor
integer

Cursor for pagination

limit
integer
Default: 10

Limit the number of orders returned (default is 10)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Addresses

Get all addresses

All addresses knows to Zarban.

query Parameters
format
string

The type of addresses to return

Responses

Response samples

Content type
application/json
[
  • {
    }
]

LendingPool

Deposit to lending pool

Deposit to lending pool

Request Body schema: application/json
required

Deposit transaction request, if amount is not provided, it will be calculated based on the token balance

user
required
string <address>

Ethereum address of the user

symbol
required
string
amount
string

The amount to deposit in native token units, if not provided, it will be calculated based on the token balance

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "symbol": "ETH",
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    },
  • "response": {
    }
}

Withdraw from lending pool

Withdraw from lending pool

Request Body schema: application/json
required

Withdraw transaction request, if amount is not provided, it will be calculated based on the user account status

user
required
string <address>

Ethereum address of the user

symbol
required
string
amount
string

The amount to withdraw in native token units, if not provided, it will be calculated based on the deposit balance

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "symbol": "string",
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    },
  • "response": {
    }
}

Borrow from lending pool

Borrow from lending pool

Request Body schema: application/json
required

Borrow transaction request, if amount is not provided, it will be calculated based on the token balance

user
required
string <address>

Ethereum address of the user

symbol
required
string
amount
string

The amount to borrow in native token units

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "symbol": "string",
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    },
  • "response": {
    }
}

Repay to lending pool

Repay to lending pool

Request Body schema: application/json
required

Repay transaction request, if amount is not provided, it will repay the maximum possible amount

user
required
string <address>

Ethereum address of the user

symbol
required
string
amount
string

The amount to repay in native token units, if not provided, it will be calculated based on the borrow balance

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "symbol": "string",
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    },
  • "response": {
    }
}

Enable/Disable asset as collateral

Allows to enable/disable a specific asset as collateral

Request Body schema: application/json
required

UseAssetAsCollateral transaction request

user
required
string <address>

Ethereum address of the user

symbol
required
string

Symbol of asset

enabled
required
boolean

Enable or disable the asset as collateral

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "symbol": "string",
  • "enabled": true
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    },
  • "response": {
    }
}

Fetch Reserve Data By Asset

Retrieve data of reserves

query Parameters
asset
string

The asset address in hexadecimal format.

Responses

Response samples

Content type
application/json
{
  • "id": "0x1234567890123456789012345678901234567890:0x1234567890123456789012345678901234567890",
  • "underlyingAsset": {
    },
  • "zTokenAddress": "0x1234567890123456789012345678901234567890",
  • "variableDebtTokenAddress": "0x1234567890123456789012345678901234567890",
  • "borrowingEnabled": true,
  • "isActive": true,
  • "isFrozen": false,
  • "usageAsCollateralEnabled": true,
  • "reserveFactor": "0.1",
  • "baseLTVasCollateral": "0.5",
  • "reserveLiquidationThreshold": "0.6",
  • "reserveLiquidationBonus": "0.1",
  • "utilizationRate": "0.5",
  • "totalDebt": {
    },
  • "totalLiquidity": {
    },
  • "availableLiquidity": {
    },
  • "supplyAPY": "0.1",
  • "supplyAPR": "0.1",
  • "variableBorrowAPY": "0.1",
  • "variableBorrowAPR": "0.1",
  • "price": {
    }
}

Get user deposits of Lendingpool

Get user deposits of Lendingpool

query Parameters
user
string0x[a-fA-F0-9]{40}

Ethereum address of the user

reserve
string0x[a-fA-F0-9]{40}

Ethereum address of the reserve

cursor
integer

Cursor for pagination

limit
integer
Default: 50

Limit the number of deposits returned (default is 50)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get user borrows of lendingpool

Get user borrows of lendingpool

query Parameters
user
string0x[a-fA-F0-9]{40}

Ethereum address of the user

reserve
string0x[a-fA-F0-9]{40}

Ethereum address of the reserve

cursor
integer

Cursor for pagination

limit
integer
Default: 50

Limit the number of deposits returned (default is 50)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

StableCoinSystem

Create vault

Create vault

Request Body schema: application/json
required

Create vault transaction request

ilkName
required
string

The name of the ilk

user
required
string <address>

Ethereum address of the user

collateralAmount
string

The amount of collateral to deposit in native token units

mintAmount
required
string

The amount of stablecoin to mint in native token units

Responses

Request samples

Content type
application/json
{
  • "ilkName": "ETH-A",
  • "user": "0x1234567890123456789012345678901234567890",
  • "collateralAmount": "10000000000000000000",
  • "mintAmount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

Deposit collateral

Deposit collateral

Request Body schema: application/json
required

Deposit collateral transaction request

user
required
string <address>

Ethereum address of the user

vaultId
required
integer

The ID of the vault

amount
string

The amount of collateral to deposit in native token units, if not provided, it will be calculated based on the wallet balance

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "vaultId": 1,
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

Withdraw collateral

Withdraw collateral

Request Body schema: application/json
required

Withdraw collateral transaction request

user
required
string <address>

Ethereum address of the user

vaultId
required
integer

The ID of the vault

amount
string

The amount of collateral to withdraw in native token units, if not provided, it will be calculated based on the withdrawable balance

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "vaultId": 1,
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

Mint ZAR

Mint ZAR

Request Body schema: application/json
required

Mint ZAR transaction request

user
required
string <address>

Ethereum address of the user

vaultId
required
integer

The ID of the vault

amount
string

The amount of stablecoin to mint in native token units, if not provided, it will be calculated based on the available to mint amount

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "vaultId": 1,
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

Repay ZAR

Repay ZAR

Request Body schema: application/json
required

Repay ZAR transaction request

user
required
string <address>

Ethereum address of the user

vaultId
required
integer

The ID of the vault

amount
string

The amount of stablecoin to repay in native token units, if not provided, it will be calculated based on the borrow balance

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "vaultId": 1,
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

liquidate a vault

liquidate a vault

Request Body schema: application/json
required

Liquidate a Vault transaction request

user
required
string <address> 0x[a-fA-F0-9]{40}

Ethereum address of the user who is liquidating the vault and receiving incentives.

vaultId
required
integer

The ID of the vault

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "vaultId": 1
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

approve and join ZAR token into Vat contract

approve and join ZAR token into Vat contract

Request Body schema: application/json
required

Approve and join Zar token into Vat contract transaction request

user
required
string <address> 0x[a-fA-F0-9]{40}

Ethereum address of the user intends to join zar tokens into the Vat contract.

amount
required
string

The amount of ZAR to approve and join into Vat contract

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

exit ZAR token from Vat contract

exit ZAR token from Vat contract

Request Body schema: application/json
required

exit Zar token from Vat contract transaction request

user
required
string <address> 0x[a-fA-F0-9]{40}

Ethereum address of the user intends to exit zar tokens from the Vat contract and receive them..

amount
required
string

The amount of Zar token to exit from Vat contract

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "amount": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

exit Gem token (which can be used as collateral) from Vat contract

exit Gem token (which can be used as collateral) from Vat contract

Request Body schema: application/json
required

exit Zar token from Vat contract transaction request

user
required
string <address> 0x[a-fA-F0-9]{40}

Ethereum address of the user intends to exit gem tokens from the Vat contract and receive them..

amount
required
string

The amount of Gem token to exit from Vat contract

ilk
required
string

Name of the ILK

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "amount": "10000000000000000000",
  • "ilk": "ETHA"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

reset a auction

reset a auction

Request Body schema: application/json
required

Reset a Auction transaction request

user
required
string <address> 0x[a-fA-F0-9]{40}

Ethereum address of the user resetting the auction and receiving incentives.

auctionId
required
integer

The ID of the auction

ilk
required
string

Name of the ILK

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "auctionId": 1,
  • "ilk": "ETHA"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

take a auction

take a auction

Request Body schema: application/json
required

Take a Auction transaction request

user
required
string <address> 0x[a-fA-F0-9]{40}

Ethereum address of the user taking the auction.

auctionId
required
integer

The ID of the auction

ilk
required
string

Name of the ILK

collateralAmountUpperLimit
required
string

upper limit on the amount of collateral to buy [wad]

maxAcceptablePrice
required
string

Maximum acceptable price (ZAR / collateral) [ray]

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "auctionId": 1,
  • "ilk": "ETHA",
  • "collateralAmountUpperLimit": "10000000000000000000",
  • "maxAcceptablePrice": "10000000000000000000"
}

Response samples

Content type
application/json
{
  • "stepNumber": 0,
  • "numberOfSteps": 0,
  • "steps": [
    ]
}

Get all Ilks

Retrieve a list of all available ilks.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Ilk by name

Retrieve an Ilk by providing its name.

path Parameters
name
required
string

Name of the ILK

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "symbol": "USD",
  • "minimumCollateralizationRatio": "string",
  • "maximumLoanToValue": "string",
  • "liquidationPenalty": "string",
  • "debtCeiling": {
    },
  • "debt": {
    },
  • "annualStabilityFee": "string",
  • "dustLimit": {
    },
  • "price": {
    },
  • "nextPrice": {
    },
  • "join": "string",
  • "median": "string",
  • "gem": "string",
  • "clipper": "string",
  • "pip": "string",
  • "hole": {
    },
  • "dirt": {
    },
  • "availableToBorrow": {
    }
}

Get collector data

Get collector data

Responses

Response samples

Content type
application/json
{
  • "stablecoinSystem": {
    },
  • "lendingpool": {
    }
}

Get a vault by ID

path Parameters
id
required
integer

Vault ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "owner": "0x1234567890123456789012345678901234567890",
  • "urn": "0x1234567890123456789012345678901234567890",
  • "liquidationPrice": {
    },
  • "collateralLocked": {
    },
  • "collateralizationRatio": "1.5",
  • "loanToValue": "0.5",
  • "debt": {
    },
  • "availableToWithdraw": {
    },
  • "availableToMint": {
    },
  • "ilk": {
    }
}

Get vault events by ID

path Parameters
id
required
integer

Vault ID

query Parameters
type
string
Enum: "repay" "deposit" "withdraw" "mint"

Event type

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get vaults by owner query

query Parameters
owner
string

Ethereum address of the owner

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Ilks

Get all Ilks

Retrieve a list of all available ilks.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Ilk by name

Retrieve an Ilk by providing its name.

path Parameters
name
required
string

Name of the ILK

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "symbol": "USD",
  • "minimumCollateralizationRatio": "string",
  • "maximumLoanToValue": "string",
  • "liquidationPenalty": "string",
  • "debtCeiling": {
    },
  • "debt": {
    },
  • "annualStabilityFee": "string",
  • "dustLimit": {
    },
  • "price": {
    },
  • "nextPrice": {
    },
  • "join": "string",
  • "median": "string",
  • "gem": "string",
  • "clipper": "string",
  • "pip": "string",
  • "hole": {
    },
  • "dirt": {
    },
  • "availableToBorrow": {
    }
}

Collector

Get collector data

Get collector data

Responses

Response samples

Content type
application/json
{
  • "stablecoinSystem": {
    },
  • "lendingpool": {
    }
}

Deposits

Get user deposits of Lendingpool

Get user deposits of Lendingpool

query Parameters
user
string0x[a-fA-F0-9]{40}

Ethereum address of the user

reserve
string0x[a-fA-F0-9]{40}

Ethereum address of the reserve

cursor
integer

Cursor for pagination

limit
integer
Default: 50

Limit the number of deposits returned (default is 50)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Borrows

Get user borrows of lendingpool

Get user borrows of lendingpool

query Parameters
user
string0x[a-fA-F0-9]{40}

Ethereum address of the user

reserve
string0x[a-fA-F0-9]{40}

Ethereum address of the reserve

cursor
integer

Cursor for pagination

limit
integer
Default: 50

Limit the number of deposits returned (default is 50)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Logs

Get raw and decoded logs by transaction hash

Get raw and decoded logs by transaction hash

path Parameters
txHash
required
string0x[a-fA-F0-9]{64}

Transaction hash

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Prices

List prices based on query parameters

Retrieve a list of price details based on specified query parameters

query Parameters
symbol
string

Symbol of the price

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Vaults

Get a vault by ID

path Parameters
id
required
integer

Vault ID

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "owner": "0x1234567890123456789012345678901234567890",
  • "urn": "0x1234567890123456789012345678901234567890",
  • "liquidationPrice": {
    },
  • "collateralLocked": {
    },
  • "collateralizationRatio": "1.5",
  • "loanToValue": "0.5",
  • "debt": {
    },
  • "availableToWithdraw": {
    },
  • "availableToMint": {
    },
  • "ilk": {
    }
}

Get vault events by ID

path Parameters
id
required
integer

Vault ID

query Parameters
type
string
Enum: "repay" "deposit" "withdraw" "mint"

Event type

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get vaults by owner query

query Parameters
owner
string

Ethereum address of the owner

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Accounts

Get account by address

Get account by address

path Parameters
address
required
string <address>
Example: 0x1234567890123456789012345678901234567890

Ethereum address of the account

Responses

Response samples

Content type
application/json
{
  • "points": 100,
  • "address": "0x1234567890123456789012345678901234567890",
  • "walletBalance": {
    },
  • "netWorth": {
    },
  • "totalDebt": {
    },
  • "totalDeposits": {
    },
  • "lendingpoolSummary": {
    },
  • "stabelcoinSystemSummary": {
    },
  • "stakingSummary": {
    }
}

Points

Get scoreboard

Get scoreboard

Responses

Response samples

Content type
application/json
{
  • "items": [
    ]
}

Staking

Stake to staking contract

Stake to staking contract

Request Body schema: application/json
required

Stake transaction request, if amount is not provided, then the whole wallet balance will be used

user
required
string <address>

Ethereum address of the user

contractAddress
required
string <address>

Ethereum address of the staking contract

amount
string

The amount of asset to stake in native token units

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "contractAddress": "0x1234567890123456789012345678901234567890",
  • "amount": "1000000000000000000"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    }
}

Withdraw staked asset

Withdraw staked asset

Request Body schema: application/json
required

Withdraw transaction request, if amount is not provided, then the whole staked amount will be withdrawn

user
required
string <address>

Ethereum address of the user

contractAddress
required
string <address>

Ethereum address of the staking contract

amount
string

The amount of asset to withdraw in native token units

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "contractAddress": "0x1234567890123456789012345678901234567890",
  • "amount": "1000000000000000000"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    }
}

Collect staking reward

Collect staking reward

Request Body schema: application/json
required

Collect reward transaction request

user
required
string <address>

Ethereum address of the user

contractAddress
required
string <address>

Ethereum address of the staking contract

Responses

Request samples

Content type
application/json
{
  • "user": "0x1234567890123456789012345678901234567890",
  • "contractAddress": "0x1234567890123456789012345678901234567890"
}

Response samples

Content type
application/json
{
  • "chainActivity": {
    }
}

Get user staking stats

Get user staking stats

query Parameters
user
string0x[a-fA-F0-9]{40}

Ethereum address of the user

address
string0x[a-fA-F0-9]{40}

Ethereum address of the staking contract

active
boolean

Filter by active stakes

cursor
integer

Cursor for pagination

limit
integer
Default: 50

Limit the number of stakes returned (default is 50)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get staking plans

Get staking plans

Responses

Response samples

Content type
application/json
[
  • {
    }
]