> For the complete documentation index, see [llms.txt](https://docs.coinfactory.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coinfactory.app/launchpad/integration/trading-methods.md).

# Trading Methods

Current CoinFactory bonds use WETH as the reserve asset. End-user applications can use the native ETH methods to automatically wrap or unwrap ETH during a trade.

### Buy with an ERC-20 Reserve Token

Purchases an exact number of tokens using the bond’s configured ERC-20 reserve asset.

```solidity

/**
* @dev Mint new tokens by depositing reserve tokens.
* @param token The address of the token to mint.
* @param tokensToMint The amount of tokens to mint.
* @param maxReserveAmount The maximum reserve amount allowed for the minting operation.
* @param receiver The address to receive the minted tokens.
*/
function mint(
    address token,
    uint256 tokensToMint,
    uint256 maxReserveAmount,
    address receiver
) external returns (uint256 reserveAmount);

```

### Buy with ETH

Purchases tokens using native ETH for a WETH-backed bond. The launchpad automatically wraps ETH into WETH as part of the transaction.

```solidity

/**
 * @dev Mint new tokens by depositing native ETH.
 * The required ETH amount is wrapped into WETH, and any excess ETH is refunded to the sender.
 * Only bonds using WETH as the reserve token are supported.
 * @param token The address of the token to mint.
 * @param tokensToMint The amount of tokens to mint.
 * @param receiver The address to receive the minted tokens.
 * @return The actual ETH amount used for the minting operation.
*/
function mintWithETH(
    address token,
    uint256 tokensToMint,
    address receiver
) external payable returns (uint256 reserveAmount);

```

### Sell for an ERC-20 Reserve Token

Sells tokens back to the bonding curve and receives the configured ERC-20 reserve asset.

```solidity

/**
 * @dev Burns a specified amount of tokens and refunds the user with reserve tokens.
 * @param token The address of the token to burn.
 * @param tokensToBurn The amount of tokens to burn.
 * @param minRefund The minimum refund amount required.
 * @param receiver The address to receive the refund.
*/
function burn(
    address token,
    uint256 tokensToBurn,
    uint256 minRefund,
    address receiver
) external returns (uint256 refundAmount);

```

### Sell for ETH

Sells tokens from a WETH-backed bond and automatically unwraps the resulting WETH into native ETH.

<pre class="language-solidity"><code class="lang-solidity">
/**
 * @dev Burns a specified amount of tokens and refunds the receiver with native ETH.
 * The WETH refund is unwrapped into ETH before being transferred to the receiver.
 * Only bonds using WETH as the reserve token are supported.
 * @param token The address of the token to burn.
 * @param tokensToBurn The amount of tokens to burn.
 * @param minRefund The minimum ETH refund amount required.
 * @param receiver The address to receive the ETH refund.
 * @return The actual ETH refund amount.
*/
function burnForETH( 
<strong>    address token, 
</strong>    uint256 tokensToBurn, 
    uint256 minRefund, 
    address receiver 
) external returns (uint256 refundAmount);

</code></pre>
