For Developers
Smart Contract API
Polygon Liquid Staking API

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 (opens in a new tab)

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 (opens in a new tab)

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.