java.lang.Object
markets.alpaca.client.openapi.broker.model.Asset
All Implemented Interfaces:
Serializable

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class Asset extends Object implements Serializable
Assets are sorted by asset class, exchange and symbol. Some assets are not tradable with Alpaca. These assets will be marked with the flag tradable=false
See Also:
  • Field Details

  • Constructor Details

    • Asset

      public Asset()
  • Method Details

    • attributes

      public Asset attributes(@Nullable List<Asset.AttributesEnum> attributes)
    • addAttributesItem

      public Asset addAttributesItem(Asset.AttributesEnum attributesItem)
    • getAttributes

      @Nullable public List<Asset.AttributesEnum> getAttributes()
      Unique characteristics of the asset. Supported values: - `ptp_no_exception`: Asset is a Publicly Traded Partnership (PTP) without a qualified notice; non-U.S. customers may incur 10% withholding on gross proceeds as per IRS guidance, and are blocked from being purchased by default. - `ptp_with_exception`: Users can open positions in these PTPs without general restrictions. - `ipo`: Accepting limit orders only before the stock begins trading on the secondary market. - `has_options`: The underlying equity has listed options available on the platform. Note: if the equity had inactive/expired contracts in the past, this will still show up. - `options_late_close`: Indicates the underlying asset's options contracts close at 4:15pm ET instead of the standard 4:00pm ET. - `fractional_eh_enabled`: Indicates the asset accepts fractional orders during extended hours sessions (pre-market, post-market, and overnight if enabled). - `overnight_tradable`: Asset is eligible for overnight (24x5) trading in supported venues on the platform. - `overnight_halted`: Asset is eligible for overnight trading but is currently halted/blocked for overnight sessions due to risk, corporate action, compliance, or venue constraints.
      Returns:
      attributes
    • setAttributes

      public void setAttributes(@Nullable List<Asset.AttributesEnum> attributes)
    • borrowStatus

      public Asset borrowStatus(@Nullable Asset.BorrowStatusEnum borrowStatus)
    • getBorrowStatus

      @Nullable public Asset.BorrowStatusEnum getBorrowStatus()
      Borrow status for US equity assets. This field is omitted for non-US-equity assets.
      Returns:
      borrowStatus
    • setBorrowStatus

      public void setBorrowStatus(@Nullable Asset.BorrowStatusEnum borrowStatus)
    • propertyClass

      public Asset propertyClass(@Nonnull AssetClass propertyClass)
    • getPropertyClass

      @Nonnull public AssetClass getPropertyClass()
      Get propertyClass
      Returns:
      propertyClass
    • setPropertyClass

      public void setPropertyClass(@Nonnull AssetClass propertyClass)
    • easyToBorrow

      @Deprecated public Asset easyToBorrow(@Nonnull Boolean easyToBorrow)
      Deprecated.
    • getEasyToBorrow

      @Deprecated @Nonnull public Boolean getEasyToBorrow()
      Deprecated.
      **deprecated**: Please use borrow_status instead. Asset is easy-to-borrow or not (filtering for easy_to_borrow = True is the best way to check whether the name is currently available to short at Alpaca).
      Returns:
      easyToBorrow
    • setEasyToBorrow

      @Deprecated public void setEasyToBorrow(@Nonnull Boolean easyToBorrow)
      Deprecated.
    • exchange

      public Asset exchange(@Nonnull Exchange exchange)
    • getExchange

      @Nonnull public Exchange getExchange()
      Get exchange
      Returns:
      exchange
    • setExchange

      public void setExchange(@Nonnull Exchange exchange)
    • fractionable

      public Asset fractionable(@Nonnull Boolean fractionable)
    • getFractionable

      @Nonnull public Boolean getFractionable()
      Asset is fractionable or not
      Returns:
      fractionable
    • setFractionable

      public void setFractionable(@Nonnull Boolean fractionable)
    • id

      public Asset id(@Nonnull UUID id)
    • getId

      @Nonnull public UUID getId()
      Asset ID
      Returns:
      id
    • setId

      public void setId(@Nonnull UUID id)
    • maintenanceMarginRequirement

      @Deprecated public Asset maintenanceMarginRequirement(@Nonnull BigDecimal maintenanceMarginRequirement)
      Deprecated.
    • getMaintenanceMarginRequirement

      @Deprecated @Nonnull public BigDecimal getMaintenanceMarginRequirement()
      Deprecated.
      **deprecated**: Please use margin_requirement_long or margin_requirement_short instead. Note that these fields are of type string. Shows the margin requirement percentage for the asset (equities only).
      Returns:
      maintenanceMarginRequirement
    • setMaintenanceMarginRequirement

      @Deprecated public void setMaintenanceMarginRequirement(@Nonnull BigDecimal maintenanceMarginRequirement)
      Deprecated.
    • marginRequirementLong

      public Asset marginRequirementLong(@Nonnull String marginRequirementLong)
    • getMarginRequirementLong

      @Nonnull public String getMarginRequirementLong()
      The margin requirement percentage for the asset's long positions (equities only).
      Returns:
      marginRequirementLong
    • setMarginRequirementLong

      public void setMarginRequirementLong(@Nonnull String marginRequirementLong)
    • marginRequirementShort

      public Asset marginRequirementShort(@Nonnull String marginRequirementShort)
    • getMarginRequirementShort

      @Nonnull public String getMarginRequirementShort()
      The margin requirement percentage for the asset's short positions (equities only).
      Returns:
      marginRequirementShort
    • setMarginRequirementShort

      public void setMarginRequirementShort(@Nonnull String marginRequirementShort)
    • marginable

      public Asset marginable(@Nonnull Boolean marginable)
    • getMarginable

      @Nonnull public Boolean getMarginable()
      Asset is marginable or not
      Returns:
      marginable
    • setMarginable

      public void setMarginable(@Nonnull Boolean marginable)
    • minOrderSize

      public Asset minOrderSize(@Nullable String minOrderSize)
    • getMinOrderSize

      @Nullable public String getMinOrderSize()
      Minimum order size. Field available for crypto only.
      Returns:
      minOrderSize
    • setMinOrderSize

      public void setMinOrderSize(@Nullable String minOrderSize)
    • minTradeIncrement

      public Asset minTradeIncrement(@Nullable String minTradeIncrement)
    • getMinTradeIncrement

      @Nullable public String getMinTradeIncrement()
      Amount a trade quantity can be incremented by. Field available for crypto only.
      Returns:
      minTradeIncrement
    • setMinTradeIncrement

      public void setMinTradeIncrement(@Nullable String minTradeIncrement)
    • name

      public Asset name(@Nonnull String name)
    • getName

      @Nonnull public String getName()
      The official name of the asset
      Returns:
      name
    • setName

      public void setName(@Nonnull String name)
    • priceIncrement

      public Asset priceIncrement(@Nullable String priceIncrement)
    • getPriceIncrement

      @Nullable public String getPriceIncrement()
      Amount the price can be incremented by. Field available for crypto only.
      Returns:
      priceIncrement
    • setPriceIncrement

      public void setPriceIncrement(@Nullable String priceIncrement)
    • shortable

      public Asset shortable(@Nonnull Boolean shortable)
    • getShortable

      @Nonnull public Boolean getShortable()
      Asset is shortable or not
      Returns:
      shortable
    • setShortable

      public void setShortable(@Nonnull Boolean shortable)
    • status

      public Asset status(@Nonnull Asset.StatusEnum status)
    • getStatus

      @Nonnull public Asset.StatusEnum getStatus()
      active or inactive
      Returns:
      status
    • setStatus

      public void setStatus(@Nonnull Asset.StatusEnum status)
    • symbol

      public Asset symbol(@Nonnull String symbol)
    • getSymbol

      @Nonnull public String getSymbol()
      The symbol of the asset
      Returns:
      symbol
    • setSymbol

      public void setSymbol(@Nonnull String symbol)
    • tradable

      public Asset tradable(@Nonnull Boolean tradable)
    • getTradable

      @Nonnull public Boolean getTradable()
      Asset is tradable on Alpaca or not
      Returns:
      tradable
    • setTradable

      public void setTradable(@Nonnull Boolean tradable)
    • putAdditionalProperty

      public Asset putAdditionalProperty(String key, Object value)
      Set the additional (undeclared) property with the specified name and value. If the property does not already exist, create it otherwise replace it.
      Parameters:
      key - name of the property
      value - value of the property
      Returns:
      the Asset instance itself
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
      Return the additional (undeclared) property.
      Returns:
      a map of objects
    • getAdditionalProperty

      public Object getAdditionalProperty(String key)
      Return the additional (undeclared) property with the specified name.
      Parameters:
      key - name of the property
      Returns:
      an object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to Asset
    • fromJson

      public static Asset fromJson(String jsonString) throws IOException
      Create an instance of Asset given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of Asset
      Throws:
      IOException - if the JSON string is invalid with respect to Asset
    • toJson

      public String toJson()
      Convert an instance of Asset to an JSON string
      Returns:
      JSON string