Skip to content

Commit

Permalink
Support New Business Products (#132)
Browse files Browse the repository at this point in the history
* merge master

* increment version

* add updated specs
  • Loading branch information
aitzkovitz committed Oct 25, 2023
1 parent 1dc4358 commit e154916
Show file tree
Hide file tree
Showing 10 changed files with 5,242 additions and 5,011 deletions.
841 changes: 338 additions & 503 deletions .polygon/rest.json

Large diffs are not rendered by default.

9,017 changes: 4,675 additions & 4,342 deletions .polygon/websocket.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/kotlin/io/polygon/kotlin/sdk/Version.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.polygon.kotlin.sdk

object Version {
const val name = "v4.4.0"
const val name = "v4.6.0"
const val userAgent = "Polygon.io JVM Client/$name"
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ data class CryptoTickerSnapshotDTO(
val day: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO(),
val lastTrade: CryptoTickDTO = CryptoTickDTO(),
val min: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO(),
val prevDay: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO()
val prevDay: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO(),
val fmv: Double? = null
)

@Serializable
Expand All @@ -122,4 +123,4 @@ data class CryptoSnapshotAggregateDTO(
data class CryptoBidOrAskDTO(
@SerialName("p") val price: Double? = null,
@SerialName("x") val exchangeToSizeMap: Map<String, Double> = emptyMap()
)
)
5 changes: 3 additions & 2 deletions src/main/kotlin/io/polygon/kotlin/sdk/rest/forex/Snapshots.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ data class SnapshotForexTickerDTO(
val day: SnapshotAggregateDTO = SnapshotAggregateDTO(),
val min: SnapshotAggregateDTO = SnapshotAggregateDTO(),
val prevDay: SnapshotAggregateDTO = SnapshotAggregateDTO(),
val lastQuote: SnapshotForexQuoteDTO = SnapshotForexQuoteDTO()
val lastQuote: SnapshotForexQuoteDTO = SnapshotForexQuoteDTO(),
val fmv: Double? = null
)

@Serializable
Expand All @@ -54,4 +55,4 @@ data class SnapshotForexQuoteDTO(
@SerialName("b") val bid: Double? = null,
@SerialName("x") val exchange: Long? = null,
@SerialName("t") val timestamp: Long? = null
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ data class Snapshot(
@SerialName("last_quote") val lastQuote: SnapshotLastQuote? = null,
@SerialName("open_interest") val openInterest: Double? = null,
@SerialName("underlying_asset") val underlyingAsset: SnapshotUnderlyingAssetInfo? = null,
@SerialName("fmv") val fairMarketValue: Double? = null,
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ data class SnapshotTickerDTO(
val lastTrade: SnapshotLastTradeDTO = SnapshotLastTradeDTO(),
val lastQuote: SnapshotLastQuoteDTO = SnapshotLastQuoteDTO(),
val min: SnapshotAggregateDTO = SnapshotAggregateDTO(),
val prevDay: SnapshotAggregateDTO = SnapshotAggregateDTO()
val prevDay: SnapshotAggregateDTO = SnapshotAggregateDTO(),
val fmv: Double? = null
)

@Serializable
Expand Down Expand Up @@ -93,4 +94,4 @@ data class SnapshotLastTradeDTO(
@SerialName("c3") val cond3: Long? = null,
@SerialName("c4") val cond4: Long? = null,
@SerialName("t") val timestamp: Long? = null
)
)
360 changes: 202 additions & 158 deletions src/main/kotlin/io/polygon/kotlin/sdk/websocket/PolygonWebSocketClient.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,15 @@ sealed class PolygonWebSocketMessage {
) : LaunchpadMessage()

}
}

sealed class BusinessMessage : PolygonWebSocketMessage() {

@Serializable
data class FairMarketValue(
@SerialName("ev") val eventType: String? = null,
@SerialName("fmv") val value: Double? = null,
@SerialName("sym") val symbol: String? = null,
@SerialName("t") val timestampMillis: Long? = null
) : BusinessMessage()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ sealed class PolygonWebSocketChannel(val prefix: String) {
object Value : Indices("V")
}

sealed class Business(channelPrefix: String) : PolygonWebSocketChannel(channelPrefix) {
object FairMarketValue : Business("FMV")
}

/**
* Use this if there's a new channel that this SDK doesn't fully support yet
*/
Expand Down

0 comments on commit e154916

Please sign in to comment.