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
- Mainnet POL — 0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0 (opens in a new tab)
- Testnet POL — 0x499d11e0b6eac7c0593d8fb292dcbbf815fb29ae (opens in a new tab)
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
- Mainnet PolygonPool Proxy — 0xCfD4B4Bc15C8bF0Fd820B0D4558c725727B3ce89 (opens in a new tab)
- Testnet PolygonPool Proxy — 0xAf2FdE2a233bc2E7B0B8Fa6066aD2df980B6fa67 (opens in a new tab)
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
- Mainnet PolygonPool Proxy — 0xCfD4B4Bc15C8bF0Fd820B0D4558c725727B3ce89 (opens in a new tab)
- Testnet PolygonPool Proxy — 0xAf2FdE2a233bc2E7B0B8Fa6066aD2df980B6fa67 (opens in a new tab)
unstakeCerts(uint256 shares, uint256 fee, uint256 useBeforeBlock, bytes signature)
Lets the PolygonPool
to exchange ankrPOL for POL.
Parameters
payableValue
(ETH, required) – amount received queryingethUnstakeFee()
.shares
(uint256, required) — amount ankrPOL to be unstake.fee
(uint256, required) — legacy param, should be set to0
.useBeforeBlock
(uint256, required) — legacy param, should be set to0
.signature
(bytes, required) — legacy param, should be0x0
.
Smart contract
- Mainnet PolygonPool Proxy — 0xCfD4B4Bc15C8bF0Fd820B0D4558c725727B3ce89 (opens in a new tab)
- Testnet PolygonPool Proxy — 0xAf2FdE2a233bc2E7B0B8Fa6066aD2df980B6fa67 (opens in a new tab)
Example
Get staking metrics
To integrate Ankr Staking metrics into your dashboards or use metrics like APY in your products, read Liquid Staking Metrics.