Skip to content

Market Maker Pool

Contract info

Contract name: MM Pool BSC

Contract address: 0xfEACb05b373f1A08E68235bA7FC92636b92ced01

View on BscScan

ETH

Contract address: 0x9Ca2A439810524250E543BA8fB6E88578aF242BC

View on Etherscan

Example of Swapping

EIP 712 Signature

const domain = {
  name: "PCS MM Pool",
  version: "1",
  chainId: // 1 or 56,
  verifyingContract: // please refer to the address above,
};
 
const quoteType = {
  Quote: [
    { name: "nonce", type: "uint256" },
    { name: "user", type: "address" },
    { name: "baseToken", type: "address" },
    { name: "quoteToken", type: "address" },
    { name: "baseTokenAmount", type: "uint256" },
    { name: "quoteTokenAmount", type: "uint256" },
    { name: "expiryTimestamp", type: "uint256" },
  ],
};
 
const quoteValue = {
    nonce,
    user,
    baseToken,
    quoteToken,
    baseTokenAmount,
    quoteTokenAmount,
    expiryTimestamp,
};
 
// EIP 712 Signature
const signature = await mm._signTypedData(domain, quoteType, quoteValue);
NameTypeDescription
nonceuint256The user nonce can be called from getUserNonce in the contract
useraddressuser address
baseTokenaddressThe token address that the user is sending to the market maker
quoteTokenaddressThe token address that the user is receiving from the market maker
baseTokenAmountuint256The amount of base token in the swap
quoteTokenAmountuint256The amount of quote token in the swap
expiryTimestampuint256The expiry time of the signature in unix

swap

struct Quote {
    uint256 nonce;
    address user;
    address baseToken;
    address quoteToken;
    uint256 baseTokenAmount;
    uint256 quoteTokenAmount;
    uint256 expiryTimestamp;
}
 
function swap(
        address _mmSigner,
        Quote calldata _quote,
        bytes calldata _signature
    ) external payable
NameTypeDescription
_mmSigneraddressThe market maker address
_quoteQuoteThe Quote struct
_signaturebytesThe signature generated from above