Skip to content

1kilolukEt/PulseLimitOrder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

hello

LP Limit Orders Website

A lightweight web interface for managing limit orders on 9mm Pro LP positions on PulseChain.

Features

  • πŸ”Œ Connect Wallet - MetaMask integration for PulseChain
  • πŸ“Š View Positions - See all your LP positions with current prices and ranges
  • 🎯 Create Limit Orders - Set automated limit orders for your positions
  • πŸ“ˆ Monitor Orders - Track active orders and their progress
  • ❌ Cancel Orders - Cancel orders and get your deposit back
  • πŸ”„ Auto-refresh - Data updates every 30 seconds

Technology Stack

  • Pure HTML/CSS/JavaScript - No build tools required
  • Web3.js - Ethereum/PulseChain interaction
  • MetaMask - Wallet connection
  • Static hosting ready - Deploy anywhere (GitHub Pages, Netlify, Vercel, etc.)

Setup

Option 1: Local Development

  1. Simple HTTP Server (Python)

    cd website
    python3 -m http.server 8000

    Then open: http://localhost:8000

  2. Simple HTTP Server (Node.js)

    cd website
    npx http-server -p 8000

    Then open: http://localhost:8000

  3. PHP Built-in Server

    cd website
    php -S localhost:8000

    Then open: http://localhost:8000

Option 2: Deploy to Static Hosting

GitHub Pages

  1. Create a new repository
  2. Push the website folder contents
  3. Enable GitHub Pages in repository settings
  4. Access at: https://yourusername.github.io/repo-name

Netlify

  1. Create account at netlify.com
  2. Drag and drop the website folder
  3. Site will be live instantly
  4. Custom domain optional

Vercel

  1. Create account at vercel.com
  2. Import repository or drag/drop folder
  3. Deploy with one click
  4. Custom domain optional

File Structure

website/
β”œβ”€β”€ index.html          # Main HTML page
β”œβ”€β”€ css/
β”‚   └── style.css      # Styling
β”œβ”€β”€ js/
β”‚   β”œβ”€β”€ config.js      # Configuration and constants
β”‚   β”œβ”€β”€ contract.js    # Smart contract interactions
β”‚   β”œβ”€β”€ wallet.js      # Wallet connection management
β”‚   β”œβ”€β”€ positions.js   # LP positions functionality
β”‚   β”œβ”€β”€ orders.js      # Orders functionality
β”‚   └── app.js         # Main application logic
└── README.md          # This file

Configuration

Edit js/config.js to update:

  • Contract addresses
  • Network settings
  • UI preferences
  • Gas payment amounts

Usage

  1. Connect Wallet

    • Click "Connect Wallet"
    • Approve MetaMask connection
    • Switch to PulseChain if needed
  2. View Your Positions

    • See all LP positions
    • Check current prices and ranges
    • View position details
  3. Create Limit Order

    • Click "Create Limit Order" on a position
    • Set target price
    • Choose direction (above/below)
    • Set slippage tolerance
    • Approve NFT (one-time per position)
    • Confirm order creation (costs 3,000 PLS deposit)
  4. Monitor Orders

    • Switch to "Active Orders" tab
    • See order status and progress
    • Cancel orders if needed (refunds deposit)

Smart Contract Functions

The website interacts with these contract functions:

View Functions

  • orders(tokenId) - Get order details
  • positions(tokenId) - Get LP position info

State-Changing Functions

  • createOrder() - Create a new limit order (costs 3,000 PLS)
  • cancelOrder() - Cancel an order (refunds deposit)
  • approve() - Approve NFT to contract (one-time)

Security Notes

  • βœ… All transactions require user approval in MetaMask
  • βœ… No private keys are stored or transmitted
  • βœ… Contract addresses are hardcoded and verified
  • βœ… All data is read directly from blockchain
  • ⚠️ Always verify contract addresses before approving
  • ⚠️ Test with small amounts first

Browser Compatibility

  • βœ… Chrome/Brave (Recommended)
  • βœ… Firefox
  • βœ… Edge
  • βœ… Safari (with MetaMask extension)
  • ❌ Mobile browsers (MetaMask app browser only)

Troubleshooting

"Please install MetaMask"

  • Install MetaMask browser extension
  • Refresh the page

"Wrong Network"

  • Click "Switch Network" when prompted
  • Or manually switch to PulseChain in MetaMask

"Transaction Failed"

  • Check you have enough PLS for gas
  • Verify order creation requires 3,000 PLS deposit
  • Check slippage tolerance if market is volatile

"Position Not Found"

  • Ensure you have LP positions on 9mm DEX
  • Refresh the page
  • Check you're connected with correct wallet

Development

Adding New Features

  1. Add UI - Update index.html and css/style.css
  2. Add Logic - Create/update JavaScript files
  3. Test - Test locally before deploying

Modifying Contract Integration

Edit js/contract.js to:

  • Add new contract functions
  • Update ABIs
  • Add new contract interactions

Customizing Appearance

Edit css/style.css:

  • Change colors in :root variables
  • Modify component styles
  • Update responsive breakpoints

Maintenance

This site requires minimal maintenance:

  • βœ… No database - All data from blockchain
  • βœ… No backend - Pure frontend static site
  • βœ… No build process - Direct HTML/CSS/JS
  • βœ… No dependencies - CDN for Web3.js only
  • βœ… Auto-updates - Reads current blockchain state

The only maintenance needed is updating contract addresses if you deploy new versions.

Resources

License

MIT License - Feel free to modify and use as needed.

Support

For issues or questions:

  • Check browser console for errors
  • Verify MetaMask is connected
  • Ensure you're on PulseChain network
  • Check contract addresses are correct

About

PulseLimitOrder website using https://dex.9mm.pro/ Liquidity Pools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors