// Get references to the pop-up container and close button // Function to calculate the difference in days between two timestamps // Function to show or hide the popup based on visit history and closing action // Check if the popup has been closed before const popupClosed = localStorage.getItem('popupClosed'); // Boolean value stored as string // If the popup hasn't been closed, show it immediately popupContainer.style.display = 'flex'; // Show the pop-up sliderAdvertisement.style.display = 'none'; // Hide the slider while the pop-up is shown }, 5000); // Show after 5 seconds // Now apply the timing logic after the user has closed the popup // Calculate the days since the popup was last shown let showPopup = false; // Flag to track whether we should show the popup // Determine if the popup should be shown: // - First time visit (no lastShown value) // - Shown once per day for 3 days // - After 3 days, show every 3 days popupData.lastShown === null || // First time visitor (popupData.timesShown < 3 && daysSinceLastShown >= 1) || // Show once a day for first 3 days (popupData.timesShown >= 3 && daysSinceLastShown >= 3) // Show once every 3 days afterward showPopup = true; // The popup should be shown // Show the popup after 5 seconds popupContainer.style.display = 'flex'; // Show the pop-up sliderAdvertisement.style.display = 'none'; // Hide the slider while the pop-up is shown // Update popupData and store it // Show the slider if the popup is not shown // Ensure elements exist before using them // Call the function to handle popup display logic // Add click event listener to the close button popupContainer.style.display = 'none'; // Hide the pop-up sliderAdvertisement.style.display = 'flex'; // Show the slider advertisement when pop-up is closed localStorage.setItem('popupClosed', true); // Set popup as closed in localStorage // Reset timing logic after the popup is closed timesShown: 0 // Reset counter for daily/3-day logic

Crowdswap API

We are looking for motivated candidate to join us. 

Welcome to CrowdSwap’s API 

Unleash the full potential of decentralized finance by tapping into our powerful API (Application Programming Interface). Our API empowers developers and businesses to access a comprehensive array of features seamlessly, facilitating easy cross-chain asset swapping and liquidity management.

No matter your purpose – whether that be creating a DeFi application, trading platform, or simply expanding crypto-related services – our API offers a secure path into decentralized finance. We have designed it to be user-friendly and allow easy implementation and interaction; additionally, our detailed documentation will assist in making requests, understanding response data, and handling potential errors.

Features

If this is your question then we have a some reasons for you

Fast connect fast response

CrowdSwap’s API ensures seamless connectivity for developers, ensuring fast and efficient communication. Our API was designed to establish fast connections, reducing latency and facilitating real-time data exchange; 

Control and customize your own api

We believe in giving developers flexibility and control. This gives you complete freedom to design a unique user experience and provide functionalities that resonate with your target audience.

Secure and modern

CrowdSwap takes security very seriously and our API was designed with cutting-edge security measures to safeguard your assets and transactions.

What you will get

If this is your question then we have a some reasons for you

Swap APIs

finds a list of dexes which can swap selected pair of tokens.

Crosschain APIs

This endpoint returns the estimation of all existing dexes based on profit

Opportunities APIs

This endpoint returns the estimation of all existing dexes based on profit

Project that are using Crowdswap API

Think to use Crowdswap API. let's start