Download OpenAPI specification:
API for the PacaSwap Metagraph Layer 0 node handling swaps, liquidity pools, voting and governance
Get a quote for swapping one token for another, including rate, price impact, and estimated amounts
Swap quote parameters
fromTokenId required | string Source token currency ID |
toTokenId required | string Destination token currency ID |
amount required | integer Amount of fromToken to swap |
slippagePercent | number [ 0 .. 100 ] Maximum acceptable slippage as a percentage |
{- "fromTokenId": "string",
- "toTokenId": "string",
- "amount": 0,
- "slippagePercent": 100
}
{- "fromTokenId": "string",
- "toTokenId": "string",
- "amount": 0,
- "rate": 0,
- "slippagePercent": 0,
- "priceImpactPercent": 0,
- "estimatedReceived": 0,
- "minimumReceived": 0
}
Get a quote for swapping one token for another, including rate, price impact, and estimated amounts. This endpoint requires the desired output and then we calculate the required input
Swap quote parameters
fromTokenId required | string Source token currency ID |
toTokenId required | string Destination token currency ID |
amount required | integer Amount of fromToken to swap |
slippagePercent | number [ 0 .. 100 ] Maximum acceptable slippage as a percentage |
{- "fromTokenId": "string",
- "toTokenId": "string",
- "amount": 0,
- "slippagePercent": 100
}
{- "fromTokenId": "string",
- "toTokenId": "string",
- "desiredOutputAmount": 0,
- "rate": 0,
- "slippagePercent": 0,
- "priceImpactPercent": 0,
- "requiredInputAmount": 0,
- "maxInputRequired": 0
}
Retrieve swap information by swap hash.
swapHash required | string Hash of the swap data update |
{- "data": {
- "sourceAddress": "DAGaa99YgUGKQef92D34FGRBGnAiKUBoEmjNoIrL",
- "swapFromPair": "string",
- "swapToPair": "string",
- "amountIn": 0,
- "amountOutGross": 0,
- "amountOutNet": 0,
- "amountOutMinimum": 0,
- "amountOutMaximum": 0,
- "state": "PendingAllowSpends"
}
}
List all liquidity pools
limit | integer [ 1 .. 100 ] Default: 10 Maximum number of items to return |
offset | integer >= 0 Default: 0 Number of items to skip |
address | string Example: address=DAGaa99YgUGKQef92D34FGRBGnAiKUBoEmjNoIrL Address with pool shares |
tokenId | string Examples:
Pools with tokenId |
{- "data": [
- {
- "poolId": "string",
- "tokenA": {
- "id": "string",
- "amount": 0,
- "price": 0
}, - "tokenB": {
- "id": "string",
- "amount": 0,
- "price": 0
}, - "owner": "string",
- "k": 0,
- "totalShares": 0,
- "poolFees": {
- "total": 0,
- "providers": 0,
- "operators": 0
}
}
], - "meta": {
- "total": 0,
- "limit": 0,
- "offset": 0,
- "hasMore": true
}
}
Show liquidity pool by pool ID
poolId required | string Unique identifier of the liquidity pool |
{- "data": {
- "poolId": "string",
- "tokenA": {
- "id": "string",
- "amount": 0,
- "price": 0
}, - "tokenB": {
- "id": "string",
- "amount": 0,
- "price": 0
}, - "owner": "string",
- "k": 0,
- "totalShares": 0,
- "poolFees": {
- "total": 0,
- "providers": 0,
- "operators": 0
}
}
}
Retrieve liquidity pool update information by lp hash.
lpHash required | string Hash of the lp data update |
{- "data": {
- "owner": "DAGaa99YgUGKQef92D34FGRBGnAiKUBoEmjNoIrL",
- "tokenAId": "string",
- "tokenBId": "string",
- "tokenAAmount": 0,
- "tokenBAmount": 0,
- "poolFees": {
- "total": 0,
- "providers": 0,
- "operators": 0
}, - "state": "PendingAllowSpends"
}
}
Retrieve voting information for a specific address including credits and allocations
address required | string Address to query |
{- "data": {
- "credits": 0,
- "parent": {
- "ordinal": 0,
- "hash": "string"
}, - "monthlyReference": {
- "expireGlobalEpochProgress": 0,
- "monthReference": 0
}, - "allocations": [
- {
- "id": "string",
- "category": "string",
- "percentage": 33.33
}
]
}
}
Retrieve staking update information by staking hash.
stakingHash required | string Hash of the staking data update |
{- "data": {
- "sourceAddress": "DAGaa99YgUGKQef92D34FGRBGnAiKUBoEmjNoIrL",
- "tokenAId": "string",
- "tokenBId": "string",
- "tokenAAmount": 0,
- "tokenBAmount": 0,
- "state": "PendingAllowSpends"
}
}
Retrieve withdrawal update information by withdrawal hash.
withdrawalHash required | string Hash of the withdrawal data update |
{- "data": {
- "sourceAddress": "DAGaa99YgUGKQef92D34FGRBGnAiKUBoEmjNoIrL",
- "tokenAId": "string",
- "tokenBId": "string",
- "shareToWithdraw": 0,
- "minAmountAOut": 0,
- "minAmountBOut": 0,
- "maxAmountAOut": 0,
- "maxAmountBOut": 0,
- "state": "PendingAllowSpends"
}
}