For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

POL Liquid Staking API

To integrate with POL Liquid Staking, use the smart contract functions and examples below.

Stake POL and claim ankrPOL​

approve(spender, value)​

Lets the PolygonPool smart contract transfer user's POL tokens.

Parameters​
  • spender (address, required) — address of the PolygonPool contract.
  • value (uint256, required) — amount of POL to be staked.
Smart contract​
Example​

Testnet live transaction example

stakeAndClaimCerts(amount)​

Stakes POL and claims ankrPOL for the staked POL.

Parameters​

amount (uint256, required) — amount of POL to be staked.

Smart contract​
Example​

Testnet live transaction example

Unstake ankrPOL and claim POL​

ethUnstakeFee()​

Get the current unstake fee in ETH.

Smart contract​

unstakeCerts(uint256 shares, uint256 fee, uint256 useBeforeBlock, bytes signature)​

Lets the PolygonPool to exchange ankrPOL for POL.

Parameters​
  • payableValue (ETH, required) – amount received querying ethUnstakeFee().
  • shares (uint256, required) — amount ankrPOL to be unstake.
  • fee (uint256, required) — legacy param, should be set to 0.
  • useBeforeBlock (uint256, required) — legacy param, should be set to 0.
  • signature (bytes, required) — legacy param, should be 0x0.
Smart contract​
Example​

Get staking metrics​

To integrate Ankr Staking metrics into your dashboards or use metrics like APY in your products, read Liquid Staking Metrics.