Piteas
  • πŸ”†Overview
  • Piteas Protocol
    • 🎯Dex Aggregator
    • 🧩Protocols
    • πŸ’ŽFeatures
  • πŸ›£οΈRoadmap
  • πŸ’ΈRevenue Model & Fees
  • πŸ“„Contracts
  • πŸ›‘οΈAudit
  • πŸ–ΌοΈWidget API
  • ⛓️Piteas SDK/API
  • Piteas Token
    • πŸ’ Overview
    • πŸͺ™Tokenomics
    • πŸ‡Token Utility
    • πŸŒ•Sacrifice Details
    • CoinGecko
    • CoinMarketCap
  • Support
    • πŸŒ‰Branding Sources
    • 🀝Business Enquiries
    • πŸ›Bug Bounty
  • Policies
    • Terms of Service
    • Privacy Policy
  • Reference
    • Website
    • Piteas App
    • Twitter
    • Telegram
    • Github
Powered by GitBook
On this page
  • Piteas Public API - SDK Beta Release
  • The first release of the Piteas API/SDK Monorepo is live! πŸš€
  • Request Example and API parameters
  • Swap Quote Parameters

Piteas SDK/API

PreviousWidget APINextOverview

Last updated 11 days ago

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.

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.

API Limits

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.


The first release of the Piteas API/SDK Monorepo is live! πŸš€

Developers can now easily explore and integrate the Piteas API to create innovative productsβ€”freely and effortlessly!

The Piteas API/SDK Monorepo provides a comprehensive development environment to interact with the Piteas API. It offers two modes of operation: Basic and Advanced, designed to cater to developers of varying needs and expertise.


Request Example and API parameters

Swap Quote Parameters

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

Get swap quote on Piteas SDK on Pulsechain

Query Parameters

Name
Type
Description

tokenInAddress*

string

Example: 0x2A06a971fE6ffa002fd242d437E3db2b5cC5B433 Use PLS for native token

tokenOutAddress*

string

Example: 0x2A06a971fE6ffa002fd242d437E3db2b5cC5B433 Use PLS for native token

amount*

integer

Amount with decimals

allowedSlippage*

float

Default: 0.5

account

string

Receiver address. Not required and default account is msg.sender.

{
  "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": [
      {...},
      {...},
      {...}
    ]
  }
}

Please note that you cannot send more than 10 requests within 1 minute. If you exceed this limit and encounter a 429 error, you will be blocked by the SDK manager for one hour.

If the pathfinder encounters issues resolving some routes, and this error persists multiple times, it means that quotes cannot be provided for the selected route.

IP address may be blacklisted due to requests made for malicious purposes. If access issues are occurring due to this error, please contact our development team immediately.

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,
});

To execute the swap process, sending the calldata on methodParameters from the response data to the 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.

Explore now:

Example URL for 1,000,000 PLS to DAI https://sdk.piteas.io/quote?tokenInAddress=PLS&tokenOutAddress=0xefD766cCb38EaF1dfd701853BFCe31359239F305&amount=1000000000000000000000000&allowedSlippage=0.50

⛓️
πŸ”½
PiteasRouter
https://github.com/piteasio/piteas-api-monorepo
GitHub - piteasio/piteas-api-monorepo: A starter model has been prepared for developers who want to use the Piteas API.GitHub
Logo