API Documentation
This documentation provides the necessary information to integrate with our API and start building
By visiting the API endpoint in your browser, you can explore all available queries, mutations, and types directly.
We will focus here on the core concepts and integration basics.
The API provides two environments: Mainnet for production use and Preview for testing.
Mainnet
https://v2.api.liqwid.finance/graphql
Preview
https://v2.api.preview.liqwid.dev/graphql
Request Headers
When making requests to the API, please include the following header to help us identify your application:
X-App-Source: <app-name>
Get Basic Markets
query GetBasicMarket($input: MarketsInput) {
liqwid {
data {
markets(input: $input) {
page
pagesCount
perPage
totalCount
results {
id
displayName
supplyAPY
borrowAPY
lqSupplyAPY
batching
private
delisting
exchangeRate
receiptAsset {
currencySymbol
}
asset {
price
logo
decimals
currencySymbol
hexName
}
}
}
}
}
}
perPage defaults to 20. If you need more items per request, set a higher perPage, or iterate pages .
Prettified market name as displayed in Liqwid. E.g: USDC → wanUSDC.
supplyAPY / borrowAPY / lqSupplyAPY
Annual percentage yield values in decimal form. Multiply by 100 to get the percentage.
Indicates whether batching is currently happening. If true, you cannot interact with the market.
If true, the market is private and you cannot interact with it.
If true, the market is being removed. You cannot supply, only repay or withdraw.
Used to convert qTokens to the underlying asset. Multiply this value by the number of qTokens a user holds to get the equivalent in the base asset.
receiptAsset.currencySymbol
PolicyId of the qToken associated with this market.
Price of the asset in USD.
URL to the asset’s logo image.
Number of decimal places for the asset
Asset name in hexadecimal format
Build a Supply Transaction
Input field
Type
Description
The market identifier. Equals markets.results[X].id.
Amount in base units (no decimals). If you’re pretty-printing amounts, convert back with amountBase = amount * 10 ** markets.results.asset.decimals.
Address that will receive the change for this tx (usually the same main address). Bech32 addr1….
All your addresses (Bech32 addr1…, getUsedAddresses,
getUnusedAddresses).
Returns the UTXOs of your wallet as returned by walletApi.getUtxos().
What you receive & how to submit
The resolver returns a CBOR transaction body (cbor) ready to be signed and submitted.
Option A — Submit via your wallet (CIP-30)
Option B — Submit via our API
signature — the result of signTx()
transaction — the unsigned transaction CBOR you received from our supply query
Build a Withdraw Transaction
All other input fields follow exactly the same rules as for supply:
marketId, address, changeAddress, otherAddresses, and utxos.
amount for withdraw
The user holds qTokens, but withdraw.amount expects the asset amount in base units (no decimals).
If your UI works in qTokens, convert to asset units with the market’s exchangeRate, then to base units using decimals.
If you need to add a specific fee for a transaction or integration, please create a support ticket in our Discord.
Issues & Complex Integrations
If you encounter any issues or require help with a more complex integration, please create a support ticket in our Discord.
Last updated