Skip to main content

Starting time auctions

The field pool_config_starting_time of the auction_pool designates the time when the auction of an asset starts. Hence, any date greater than now represents up coming acution assets.
Where clause
const where: Asset_Bool_Exp = {
  auction_pool: {
    pool_config_starting_time: {
      _gt: Date.now()
    }
  }
}

Complete example

Find below the field pool_config_starting_time in action. Also, find complete examples on our repository REPOSITORY.

Complete query
import { GraphQLClient, gql } from 'graphql-request';
import {
  Order_By,
  type Asset,
  type Asset_Bool_Exp,
  type Asset_Order_By,
} from '@longdotxyz/shared';

const client = new GraphQLClient(
  endpoint,
  {
    headers: {
      'X-API-KEY': `YOUR_API_KEY`,
    }
  }
);

const QUERY = gql`
  query Assets($where: Asset_bool_exp) {
    assets: Asset(where: $where) {
      auction_pool {
        id
        base_token {
          token_name
          token_address
        }
      }
    }
  }
`

const where: Asset_Bool_Exp = {
  auction_pool: {
    pool_config_starting_time: {
      _gt: Date.now(),
    },
  },
};

const { assets } = await client.request<{ assets: Asset[] }>(
  QUERY,
  { where }
)