> For the complete documentation index, see [llms.txt](https://docs.artinals.com/artinals-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artinals.com/artinals-protocol/integration-and-workflows/example-scripts-and-transactions.md).

# Example Scripts and Transactions

1. **Full Lifecycle**:
   * **Create and Mint**: Deploy ART20 and mint 500 NFTs of a new collection.
   * **Initial Sale**: List 100 NFTs at a fixed price using SALE, introduce them to initial collectors.
   * **Liquidity Pool Creation**: Once the initial sale creates interest, set up a TRADE pool with some of the remaining NFTs, providing tokens to offer dynamic pricing and instant swaps.
   * **User Actions**:
     * A user buys one NFT from the SALE listing and later sells it into the TRADE pool if the pool price is higher.
     * Another user becomes a liquidity provider by adding more NFTs and tokens to the pool, hoping to earn fees from future trades.
2. **Price Discovery and Arbitrage**:
   * If the SALE’s fixed price is lower than what the TRADE pool’s AMM would suggest, arbitrageurs can buy from SALE and sell into TRADE for a profit.
   * This activity aligns SALE prices with TRADE pool prices over time, supporting healthy price discovery.

**Transaction Sequence Example**:

1. **Creator**: `mint_art20(...)` -> `create_nft_sale(...)`
2. **User A**: `purchase_nfts(...)` from SALE -> Now holds newly minted NFT.
3. **User B**: `create_pool(...)` on TRADE with some NFTs and tokens.
4. **User A**: `swap_nfts_for_tokens_with_slippage(...)` on TRADE to sell the NFT they bought, potentially at a higher price.
5. **Creator**: `withdraw_currency(...)` on SALE to claim proceeds from the initial sale.

***
