Skip to content

Latest commit

 

History

History
78 lines (65 loc) · 6.29 KB

rmm-sdk.md

File metadata and controls

78 lines (65 loc) · 6.29 KB

Home > @primitivefi/rmm-sdk

rmm-sdk package

Classes

Class Description
Calibration (BETA) Calibration base class implements ICalibration
Engine (BETA) Engine base class implementation of IEngine
Floating (BETA) Floating point Decimal numbers are used to calculate values for RMM pools.
PeripheryManager (BETA) Abstract class with static methods to build Manager function calldatas.
Pool (BETA) Pool base class implements IPool.
SelfPermit Abstract class with static methods to encode permit related function calldata.
SwapManager (BETA) Abstract class which implements static methods to encode calldata for swaps.
Swaps Static functions to compute swap in/out amounts and marginal prices.

Enumerations

Enumeration Description
PoolSides (BETA) Enum for each side of the pool, inclusive of liquidity token.

Functions

Function Description
computeEngineAddress(factory, risky, stable, contractBytecode) (BETA) Statically computes an Engine address.
computePoolId(engine, strike, sigma, maturity, gamma) (BETA) Computes deterministic poolIds from hashing engine address and calibration parameters.
getTokenPairSaltHash(token0, token1) (BETA) Get hash of the token pair addresses is used as the salt in PrimitiveFactory create2 calls.
isValidGamma(gamma) Checks gamma is within the valid smart contract range.
isValidMaturity(maturity) Checks maturity is within the valid smart contract range.
isValidSigma(sigma) (BETA) Checks sigma is within the valid smart contract range.
isValidStrike(strike) Checks strike is within the valid smart contract range.
normalize(wad, decimals) (BETA) Truncates wad to appropriate decimals then converts to a floating point number.
parseCalibration(factory, risky, stable, cal, chainId) (BETA) Constructs a Calibration entity from on-chain data.
validateAndParseAddress(address) (BETA) Validates an address and returns the parsed (checksummed) version of that address.
validateDecimals(amount, token) (BETA) Checks if amount.decimals is equal to token.decimals.
weiToWei(wei, decimals) (BETA) Gets a Wei class from a wei string value.

Interfaces

Interface Description
AllocateOptions Provide liquidity argument details.
AllowedPermitArguments https://eips.ethereum.org/EIPS/eip-2612
BatchTransferOptions Batch Transfer ERC-1155 liquidity token argument details.
CalibrationStruct (BETA) Data structure of the Primitive Engine Calibration struct, which is used for Pool curves.
Deadline Timestamp which will revert the transaction if not yet mined.
DefaultOptions Default arguments in swaps.
ExactInResult
ExactOutResult
ICalibration Calibration Struct; Class representation of each Curve's parameters.
IEngine (BETA) Abstraction of PrimitiveEngine.sol smart contract.
IPool (BETA) Abstraction of a Primitive RMM Pool
LiquidityOptions Token amounts to use for allocating liquidity.
MarginOptions Token amounts to use for depositing or withdrawing into a margin account.
MethodParameters Generated method parameters for executing a call.
NativeOptions Flag to use a native currency in a transaction.
PermitTokens Permit details on either risky or stable tokens.
PoolInterface (BETA) Data structure of PrimitiveManager ERC-1155 Uniform Resource Identifier ("URI").
RecipientOptions Recipient address of any tokens which are output from transactions.
RemoveOptions Remove liquidity argument details.
ReserveStruct (BETA) Data structure of the Primitive Engine Reserve struct, which is used tracking tokens in Pool.
RSV Valid secp256k1 signature components
SafeTransferOptions Transfer ERC-1155 liquidity token argument details.
StandardPermitArguments https://eips.ethereum.org/EIPS/eip-2612
SwapOptions Swap arguments.
SwapResult Post-swap invariant and implied price after a swap.

Type Aliases

Type Alias Description
PermitOptions Either AllowedPermitArguments or StandardPermitArguments