⛓️Piteas SDK/API

Piteas has an offchain model for its dex aggregator. Unlike traditional aggregator models, it doesn't create routes through API calls; the entire process is managed offchain by pathfinder, which then provides the call data response to the UI.

At this stage, Piteas API is not publicly accessible*. (Modified) It is open for access to Piteas' main app, widget app, and some partner protocols. We don't have our own RPC service; quote/request data is fetched entirely through native Pulsechain RPC using our algorithms. Therefore, the number of quote requests needs to be limited. So, if you're looking to run an arbitrage bot, Piteas API is not suitable for you at this stage. However, if you have a project or product and require API access, please provide us with the following information for consideration:

  • Brief information about your product.

  • Estimated number of API requests covering daily, hourly, and minute intervals.

  • If it involves integration for a portal, the number of users.

You can send this request form via Telegram/Twitter to initiate the integration/negotiation process.


Piteas Public API - SDK Beta Release

Piteas SDK beta release has been published. Please note that this version may contain errors and is in the development stage. Ensure you consider request limits.

To execute the swap process, sending the calldata on methodParameters from the response data to the PiteasRouter is sufficient. Adjust the necessary value data and gas estimate settings according to your conditions. Please also take a look at the router contract because the arguments in the response are defined for the conditions in the contract.

The SDK version is in the beta stage, so please avoid sending more than 10 requests per minute. Exceeding this limit may result in your blockage and cause access issues for one hour. Limits will be adjusted after the beta version.

Request Example and API parameters

Swap Quote Parameters

GET https://sdk.piteas.io/quote

Get swap quote on Piteas SDK on Pulsechain

Query Parameters

{
  "srcToken": {
    "address": "0xA1077a294dDE1B09bB078844df40758a5D0f9a27",
    "symbol": "WPLS",
    "decimals": 18,
    "chainId": 369
  },
  "destToken": {
    "address": "0xefD766cCb38EaF1dfd701853BFCe31359239F305",
    "symbol": "DAI",
    "decimals": 18,
    "chainId": 369
  },
  "srcAmount": "0xd3c21bcecceda1000000",
  "destAmount": "0x2e33260eb8b008f09",
  "gasUseEstimate": 4025000,
  "gasUseEstimateUSD": 0.033025699048724835,
  "methodParameters": {
    "calldata": "...",
    "value": "0xd3c21bcecceda1000000"
  },
  "route": {
    "paths": [
      [...],
      [...],
      [...]
    ],
    "swaps": [
      {...},
      {...},
      {...}
    ]
  }
}

A standard code use with ether.js to send a transaction to PiteasRouter:

const tx = await signer.sendTransaction({
    to: '0x6BF228eb7F8ad948d37deD07E595EfddfaAF88A6',
    value: quote.methodParameters.value,
    data: quote.methodParameters.calldata,
});

Last updated