Fermi DEX- Docs
  • ๐Ÿ‘‹Intro to Fermi
  • Overview
    • ๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธVision
    • ๐Ÿ’กWhat we do
    • โœจFermi DEX: Features
    • ๐Ÿˆโ€โฌ›Background
  • Fermi DEX Usage Guide
    • Fermi DEX: How it works
      • ๐Ÿ“ชPosting a Limit Order
      • โœ…Finalizing Orders
      • ๐Ÿ”„Withdrawing Funds
    • ๐Ÿ› ๏ธGetting set up
      • ๐Ÿ“Getting tokens
      • ๐Ÿ”ซTrobleshooting
    • ๐ŸชTransfer Hooks Redefined
    • Custom settlement periods
  • Technical Overview
    • Overview v0.2 (DEPRECATED)
    • Technical Overview v1
      • Market Addresses (Devnet)
      • Key Structs
      • Instructions
      • Events
      • SDK
    • ๐ŸšงArchitecture
      • ๐Ÿ‘ฝJust In Time Liquidity
      • ๐ŸคMatching Logic
      • ๐Ÿ›ธLiquidity Abstraction
      • ๐ŸŒŠLiquidity Management Programs
    • ๐ŸงชTesting Locally
    • ๐Ÿ•น๏ธDemo - Fermi v0.2
    • ๐Ÿ“ฝ๏ธDemo - Fermi v1
    • ๐Ÿ“‡Github, Devnet Programs and PDAs
    • ๐Ÿ‘ฉโ€๐ŸŽคActors and Incentives
  • Use cases & Benefits
    • ๐Ÿ–‡๏ธLower Slippage than traditional DEXes
    • โ›๏ธPortfolio Margining Strategies
    • ๐ŸMarket Making on Fermi DEX
  • About us
    • ๐Ÿ‘‹Meet the Team
    • ๐Ÿ›ฃ๏ธRoadmap
    • ๐Ÿš“Next Steps
Powered by GitBook
On this page
  1. Fermi DEX Usage Guide
  2. Getting set up

Getting tokens

Specific devnet SPL tokens are required to test fermi

First, create and initialise your associated token account, and your openorders account:

const authorityPCTokenAccount = await spl.getAssociatedTokenAddress(  
      new anchor.web3.PublicKey(pcMint),
        connectedPublicKey,
        false,
      );
    
      console.log(authorityPCTokenAccount.toString());
      let openOrdersPda;
      let openOrdersPdaBump;
      [openOrdersPda, openOrdersPdaBump] =
      await anchor.web3.PublicKey.findProgramAddress(
        [
          Buffer.from('open-orders', 'utf-8'),
          new anchor.web3.PublicKey(marketPda).toBuffer(),
          connectedPublicKey.toBuffer(),
        ],
        program.programId,
      );

Next, ask the admin to mint some spl tokens to your accounts. Alternatively, if you're testing on your own deployment, you can use the adapted code in branch 'wallet-admin' to give yourself airdrops of SPL tokens


const custom = new anchor.web3.PublicKey("42Dg1Y97EQuwAfj4ovzD76myhRE5ZJkCySuTzHoRcxxH");

const custom_ata_coin = new anchor.web3.PublicKey("H2cZK8LEgqEBUL52Px6fkTWMVAHrhVPi5VWwztRmRw6u");

const custom_ata_pc = new anchor.web3.PublicKey("54EjXUWQitej4UZYYbb4QNJLN1nAFmwW7AkuC19UGQoV");
    

    console.log("sent to");
    console.log(custom_ata_pc.toString());

    await createAssociatedTokenAccount(
      provider,
      pcMint,
      custom_ata_pc,
      custom,
    );

    await mintTo(
      provider,
      pcMint,
      custom_ata_coin,
      BigInt('10000000000'),
    );
    
      await createAssociatedTokenAccount(
      provider,
      pcMint,
      custom_ata_pc,
      custom,
    );
    
    await mintTo(
      provider,
      coinMint,
      customCoinTokenAccount,
      BigInt('100000000000'),
    ); 
    console.log("airdrop done");
PreviousGetting set upNextTrobleshooting

Last updated 1 year ago

That's it! You're all set up. Head on over to the Fermi DEX UI at and start trading!

๐Ÿ› ๏ธ
๐Ÿ“
https://www.fermilabs.xyz/