Skip to main content

API Endpoints

Base URL: https://api.ibnk.xyz


Health Check

Check API server status.

GET /health

Authentication: Not required

Response:

{
"status": "ok",
"timestamp": "2025-11-25T10:30:00.000Z",
"uptime": 3600.123
}

Pools

Get All Pools

Retrieve all available liquidity pools.

GET /api/v1/pools

Query Parameters:

ParameterTypeDefaultDescription
chainIdnumber84532Blockchain network ID

Response:

{
"success": true,
"data": {
"pools": [
{
"address": "0xEd1FAF5Ed63dA5b47CBc44f7696E701cb613bB57",
"name": "AUDM/USDC",
"chainId": 84532,
"token0": {
"address": "0xb5dC8d3fcFd2277f2C6ae87e766732c00A7EfbF3",
"symbol": "AUDM",
"decimals": 6
},
"token1": {
"address": "0xB209B4f21a233751EEd1C11747b1f06850fE6ca2",
"symbol": "USDC",
"decimals": 6
},
"reserves": {
"token0": "1000000.000000",
"token1": "650000.000000"
},
"totalSupply": "800000.000000000000000000"
}
],
"pagination": {
"page": 1,
"limit": 3,
"total": 3
}
}
}

Example:

curl -H "X-API-Key: your_api_key" \
"https://api.ibnk.xyz/api/v1/pools?chainId=84532"

Get Pool Info

Retrieve detailed information for a specific pool.

GET /api/v1/pools/:poolAddress

Query Parameters:

ParameterTypeDefaultDescription
chainIdnumber84532Blockchain network ID

Example:

curl -H "X-API-Key: your_api_key" \
"https://api.ibnk.xyz/api/v1/pools/0xEd1FAF5Ed63dA5b47CBc44f7696E701cb613bB57?chainId=84532"

Convert

Preview Convert

Get expected output amount and exchange rate before executing a conversion.

POST /api/v1/convert/preview

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
poolAddressstringYesPool contract address
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesAmount to convert (human-readable)

Example Request:

{
"chainId": 84532,
"poolAddress": "0xEd1FAF5Ed63dA5b47CBc44f7696E701cb613bB57",
"tokenIn": "0xB209B4f21a233751EEd1C11747b1f06850fE6ca2",
"tokenOut": "0xb5dC8d3fcFd2277f2C6ae87e766732c00A7EfbF3",
"amountIn": "100"
}

Response:

{
"success": true,
"data": {
"amountIn": "100",
"amountOut": "154.752590",
"tokenIn": {
"address": "0xB209B4f21a233751EEd1C11747b1f06850fE6ca2",
"symbol": "USDC",
"decimals": 6
},
"tokenOut": {
"address": "0xb5dC8d3fcFd2277f2C6ae87e766732c00A7EfbF3",
"symbol": "AUDM",
"decimals": 6
},
"exchangeRate": "1.547526",
"inverseRate": "0.646193",
"fee": "0.05%",
"recommendedMinAmountOut": "154.675212"
}
}

Response Fields:

FieldDescription
amountOutExpected output amount
exchangeRateRate of tokenIn to tokenOut
inverseRateRate of tokenOut to tokenIn
feePool fee (0.05% for stablecoins)
recommendedMinAmountOutMinimum output with 0.05% tolerance (use for minAmountOut)

Oracle

Get Oracle Prices

Retrieve real-time prices from Chainlink Oracles.

GET /api/v1/oracle/prices/:chainId?

Path Parameters:

ParameterTypeDefaultDescription
chainIdnumber84532Blockchain network ID

Response:

{
"success": true,
"data": {
"chainId": 84532,
"chainName": "Base Sepolia",
"prices": {
"AUDM": {
"usd": "0.64590000",
"oracle": "0x650C8A8Bbf129f60B2C5d956078943b306bE95FF",
"lastUpdate": "2025-11-25T10:30:00.000Z"
},
"EURC": {
"usd": "1.15300000",
"oracle": "0x5f8D58C41f90487eA440F73c46FD5F55e4F2CFF6",
"lastUpdate": "2025-11-25T10:30:00.000Z"
},
"USDC": {
"usd": "1.0",
"oracle": null,
"lastUpdate": "2025-11-25T10:30:00.000Z"
}
},
"timestamp": "2025-11-25T10:30:00.000Z"
}
}

Example:

curl -H "X-API-Key: your_api_key" \
"https://api.ibnk.xyz/api/v1/oracle/prices/84532"

Approval

Before converting tokens, users must approve the Router contract to spend their tokens.

Check Approval

Check if approval is needed for a specific amount.

POST /api/v1/approval/check

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
tokenAddressstringYesToken to approve
ownerAddressstringYesUser's wallet address
spenderAddressstringYesRouter contract address
requiredAmountstringYesAmount needed (human-readable)

Response:

{
"success": true,
"data": {
"needsApproval": true,
"currentAllowance": "0",
"requiredAmount": "100"
}
}

Build Approval Transaction

Build an unsigned approval transaction.

POST /api/v1/approval/build

Request Body:

FieldTypeRequiredDefaultDescription
chainIdnumberNo84532Network ID
tokenAddressstringYes-Token to approve
spenderAddressstringYes-Router contract address
amountstringYes-Amount to approve
isUnlimitedbooleanNofalseApprove unlimited amount

Response:

{
"success": true,
"data": {
"transaction": {
"to": "0xB209B4f21a233751EEd1C11747b1f06850fE6ca2",
"data": "0x095ea7b3...",
"value": "0",
"chainId": 84532,
"gasLimit": "60000"
},
"recommendation": {
"type": "limited",
"reason": "Recommended for security"
}
}
}

Revoke Approval

Build a transaction to revoke token approval.

POST /api/v1/approval/revoke

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
tokenAddressstringYesToken address
spenderAddressstringYesSpender to revoke

Transaction

Build Convert Transaction

Build an unsigned convert (swap) transaction.

POST /api/v1/transaction/build/convert

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
userAddressstringYesUser's wallet address
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesAmount to convert (human-readable)
minAmountOutstringYesMinimum output (use recommendedMinAmountOut from preview)
deadlinenumberNoUnix timestamp (default: now + 5 minutes)

Response:

{
"success": true,
"data": {
"to": "0x9647B25aFf27F1c36f77dFec2560a8696B59dbdE",
"data": "0x...",
"value": "0",
"chainId": 84532,
"gasLimit": "254664",
"maxFeePerGas": "1500000000",
"maxPriorityFeePerGas": "1000000000"
}
}

Broadcast Transaction (Generic)

Broadcast any signed transaction.

POST /api/v1/transaction/broadcast

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
signedTransactionstringYesSigned transaction hex

Response:

{
"success": true,
"data": {
"transactionHash": "0x...",
"status": "success",
"blockNumber": 12345678,
"gasUsed": "212220"
}
}

Broadcast Convert Transaction (with Slippage Analysis)

Broadcast a convert transaction and receive detailed slippage analysis based on Oracle prices.

POST /api/v1/transaction/broadcast/convert

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
signedTransactionstringYesSigned transaction hex
expectedAmountOutstringYesExpected output from preview
amountInstringYesInput amount
tokenInstringYesInput token address
tokenOutstringYesOutput token address

Response:

{
"success": true,
"data": {
"transactionHash": "0x04e4413725593915b8afcfe657df675e76b046b6e0500e164b9cc810b76d7681",
"status": "success",
"blockNumber": 12345678,
"gasUsed": "212220",
"convert": {
"amountIn": "10",
"expectedAmountOut": "15.475259",
"actualAmountOut": "15.475646",
"oracleAmountOut": "15.483000",
"fee": {
"rate": "0.05%",
"amount": "0.007742"
},
"slippage": "-0.0025%",
"executedRate": "1.547565",
"oracleRate": "1.548300"
}
}
}

Response Fields:

FieldDescription
oracleAmountOutTheoretical output based on Chainlink Oracle price (before fee)
actualAmountOutActual tokens received
fee.ratePool fee rate (fixed 0.05%)
fee.amountFee amount in output token
slippagePure market slippage (excludes fee). Negative = better than Oracle
executedRateActual exchange rate received
oracleRateCurrent Oracle exchange rate

Slippage Calculation:

Oracle Theoretical (after fee) = oracleAmountOut × (1 - 0.0005)
Slippage = (Oracle Theoretical after fee - actualAmountOut) / Oracle Theoretical after fee × 100%
  • Positive slippage = loss (received less than Oracle rate)
  • Negative slippage = gain (received better than Oracle rate)

Get Transaction Status

Check the status of a transaction.

POST /api/v1/transaction/status

Request Body:

FieldTypeRequiredDescription
chainIdnumberNoNetwork ID (default: 84532)
transactionHashstringYesTransaction hash

Response:

{
"success": true,
"data": {
"status": "success",
"blockNumber": 12345678,
"confirmations": 5,
"gasUsed": "212220"
}
}

Get Nonce

Get the current nonce for an address.

GET /api/v1/transaction/nonce/:address

Query Parameters:

ParameterTypeDefaultDescription
chainIdnumber84532Network ID