Market Maker Pool

Direct swap with Market Maker

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);

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

Last updated