Reading a token
The calls that answer where a token is, what it is worth, and who is owed what. All of them are views.
Where a token is
function curves(address token) external view returns (
address creator,
uint128 realEth, // reserves paid in, in wei
uint128 soldTokens, // sold off the curve so far
uint256 threshold, // reserves needed to graduate
uint16 feeBps, // 100, meaning 1%
State state // 0 NONE, 1 CURVE_ACTIVE, 2 GRADUATED
)threshold and feeBps are fixed when the token launches. Read them per token rather than assuming the current defaults: a token launched last month keeps the threshold it was launched with, whatever the parameter says today.
After graduation
function poolFor(address token) external view returns (address)
function isGraduable(address token) external view returns (bool)poolFor is zero until a token graduates, and the pool's address afterwards. isGraduable is true only for a curve that has filled and not yet migrated, which normally means something went wrong: graduation happens inside the buy that fills the curve, so the usual answer is false.
What somebody is owed
// Curve fees, per token, in MNT
function accrued(address claimant, address token) external view returns (uint256)
// Pool fees, per currency, on the locker
function claimable(address claimant, address currency) external view returns (uint256)Curve fees are keyed by token because that is how they accrue. Pool fees are keyed by currency, because a pool pays in wrapped MNT or in the token itself depending on which way a swap went.
The locked position
function positions(address token) external view returns (
address pool, address otherToken,
int24 tickLower, int24 tickUpper,
uint128 liquidity, address creator, bool locked
)locked is true from graduation onwards and there is no code path that sets it false. The position is full range, ticks -887200 to 887200 at a spacing of 200, which is the widest the 1% fee tier allows.
Listing tokens
function allTokens(uint256 index) external view returns (address)
function tokenCount() external view returns (uint256)Enough to enumerate every token from the chain alone. For anything ordered or filtered you will want the Launched events instead, since sorting a thousand tokens through single index reads is a request per token.