Skip to main content

Contract Info

PropertyValue
AddressRead from MemeFactory.bondingCurve() (see Addresses for MemeFactory address)
NetworkKasplex (see Addresses for chain details)
All calculation functions are pure — they don’t read or modify state. You can call them off-chain for gas-free price quotes.

Functions

calculateBuyReturnWithParams

Calculate how many tokens you get for a given KAS amount.
ParameterTypeDescription
kasInuint256KAS amount to spend (wei)
tokenReservesuint256Current token reserves from getTokenInfo()
kasReservesuint256Current KAS reserves from getTokenInfo()
vTokenuint256Virtual token from getTokenParamVersion()
vKasuint256Virtual KAS from getTokenParamVersion()

calculateSellReturnWithParams

Calculate how much KAS you get for selling tokens.
ParameterTypeDescription
tokensInuint256Token amount to sell (wei)
tokenReservesuint256Current token reserves from getTokenInfo()
kasReservesuint256Current KAS reserves from getTokenInfo()
vTokenuint256Virtual token from getTokenParamVersion()
vKasuint256Virtual KAS from getTokenParamVersion()

calculateBuyCostWithParams

Calculate how much KAS you need to get a desired amount of tokens.
ParameterTypeDescription
tokensOutuint256Desired token amount (wei)
tokenReservesuint256Current token reserves from getTokenInfo()
kasReservesuint256Current KAS reserves from getTokenInfo()
vTokenuint256Virtual token from getTokenParamVersion()
vKasuint256Virtual KAS from getTokenParamVersion()

getCurrentPrice

Get the current spot price.

virtualToken / virtualKas

Default virtual reserves configured in the BondingCurve contract. Note: individual tokens may use different values via getTokenParamVersion().

curveType

Returns the curve type identifier.

Full ABI (JSON)