Smart Contract Integration

Overview

This guide is intended for developers integrating with aPriori’s liquid staking protocol.

aprMON - Reward Bearing LST

aprMON is a reward-bearing liquid staking token. This means that it does not automatically adjust the number of tokens in circulation. Instead, the token’s value increases as rewards are generated. When you hold a reward-bearing token, you maintain the same number of tokens in your wallet, but the value of those tokens increases over time as the staking rewards accumulate.

Smart Contract Integration

Contract Addresses

Mainnet

aprMON: 0x0c65A0BC65a5D819235B71F554D210D3F80E0852

ABIs

aprMON vault contract:

Functions

1. Fetch Exchange Rate

To fetch the current aprMON/MON exchange rate you need to invoke the convertToAssets function(i.e. how many MON you get back for certain amount of aprMON):

To fetch the current MON/aprMON exchange rate you need to invoke the convertToShares function(i.e. how many aprMON you get back for certain amount of MON):

To fetch the current MON/aprMON exchange rate you need to invoke the convertToShares function(i.e. how many aprMON you get back for certain amount of MON):

Note that exchange rate will be 1e18 for now on testnet before Monad staking module is ready. So MON-aprMON will be a 1-to-1 pair.

2. Fetch Balance

To fetch the aprMON balance of a user use the balanceOf function:

3. Stake

To deposit Monad into aPriori and mint aprMON you need to invoke the deposit function:

Deposits immediately mint aprMON tokens with the current exchange rate.

4. Unstake

To request a withdrawal you need to call the requestRedeem function:

Withdrawals requests take a few staking module epochs to be claimable. Each staking module epoch is roughly 5.5 to 6 hours, thus the expected wait time for a withdrawal request is usually around 12-18 hours. Once the withdrawal request has unlocked you can call the function redeem(uint256[] calldata requestIDs, address receiver) function to receive the Monad tokens.

5. Withdrawal Information

Once a withdrawal has been requested, you can see more information about it with viewRedeemRequest function:

The unlockEpoch field indicates at which epoch the withdrawal request will be ready to claim, usually within the first 10 minutes of the epoch.

You can also see information for all the withdrawal requests for a given address by paginating through the getUserRequestData function:

where each item in the requestData array is in the same format as an individual item being returned by viewRedeemRequest

Last updated