Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
26760dc
MERC6933-GMCI EA
Subarna-Singh Jun 19, 2025
8d5f2a8
GMCI EA
Subarna-Singh Jun 23, 2025
9f4b9f2
Merge branch 'main' of github.com:smartcontractkit/external-adapters-…
Subarna-Singh Jun 25, 2025
59231d6
Handle Response
Subarna-Singh Jun 25, 2025
c06fdd5
Changeset added
Subarna-Singh Jun 25, 2025
3c6f4b5
Add Readme file; modify tsconfig
Subarna-Singh Jun 25, 2025
60a33d5
GMCI EA - parsing price and rebalance messages and producing a result…
Subarna-Singh Jul 9, 2025
17a621f
upgrade version of dependency packages
Subarna-Singh Jul 11, 2025
d98103a
remove override functionality
Subarna-Singh Jul 11, 2025
7c0c771
Add new changeset
Subarna-Singh Jul 11, 2025
4fe40f2
Review work: fix data types and hard coded values
Subarna-Singh Jul 13, 2025
000a15e
Integration testing added
Subarna-Singh Jul 13, 2025
ff19d55
Remove failure test
Subarna-Singh Jul 13, 2025
2e4d6fd
Correction to pass: Compile test for changed packages workflow
Subarna-Singh Jul 13, 2025
4f55e23
Remove hardcoded values: adapter name
Subarna-Singh Jul 13, 2025
f4431aa
Add gmci to tsconfig files
Subarna-Singh Jul 13, 2025
e8c8c2b
Merge branch 'main' into MERC6933-GMCI-EA-Data_Link_Feed
Subarna-Singh Jul 13, 2025
66174dc
Testing: add unit tests; add more integration tests
Subarna-Singh Jul 15, 2025
9a5e303
Remove: commented import
Subarna-Singh Jul 15, 2025
c5659a7
Merge branch 'MERC6933-GMCI-EA-Data_Link_Feed' of github.com:smartcon…
Subarna-Singh Jul 15, 2025
0b8a763
Alternate implementation for price transport
Subarna-Singh Jul 15, 2025
da09e6c
Refactor: add async method processMessage to pull data from local cache
Subarna-Singh Jul 16, 2025
a80b239
Rework: Price transport
Subarna-Singh Jul 16, 2025
c727a96
Remove: old price transport
Subarna-Singh Jul 16, 2025
50d4d42
Modify: unit test to reflect new price transport
Subarna-Singh Jul 16, 2025
437bfb0
Fix: uppercase to camelcase
Subarna-Singh Jul 16, 2025
b9247df
Refactor: make processMessage part of wstransport; move message handl…
Subarna-Singh Jul 16, 2025
f80198a
Unit test: for price transport
Subarna-Singh Jul 16, 2025
0912899
Delete .changeset/itchy-pianos-wave.md
Subarna-Singh Jul 16, 2025
30b8375
Remove: support for rebalance_status message; merging of price and re…
Subarna-Singh Jul 17, 2025
6edb102
Merge branch 'MERC6933-GMCI-EA-Data_Link_Feed' of github.com:smartcon…
Subarna-Singh Jul 17, 2025
e126611
Remove: default API endpoint; Modify: WsResponse to include Price and…
Subarna-Singh Jul 17, 2025
bf6b59d
Add unit test for message handler
Subarna-Singh Jul 17, 2025
418ed2f
Change: index to symbol; make WS_API_ENDPOINT required
Subarna-Singh Jul 17, 2025
d4d4720
Change: tests to reflect symbol instead of index
Subarna-Singh Jul 17, 2025
871b36d
Change: test payload
Subarna-Singh Jul 18, 2025
dd06ecd
Merge branch 'main' into MERC6933-GMCI-EA-Data_Link_Feed
Subarna-Singh Jul 18, 2025
9916d51
Fix: Failing workflow - missing argument in transport
Subarna-Singh Jul 18, 2025
2292dcd
Merge branch 'MERC6933-GMCI-EA-Data_Link_Feed' of github.com:smartcon…
Subarna-Singh Jul 18, 2025
90ae121
Fix mockContext
Subarna-Singh Jul 18, 2025
e28958d
Add: message response type
Subarna-Singh Jul 18, 2025
3833941
Add: unit test for rebalance message
Subarna-Singh Jul 18, 2025
81abf28
update readme
Subarna-Singh Jul 18, 2025
dd6ef64
Merge branch 'main' into MERC6933-GMCI-EA-Data_Link_Feed
Subarna-Singh Jul 28, 2025
bfbd60e
MERC-6932 Wintermute
Subarna-Singh Jul 28, 2025
04d54c0
Changeset
Subarna-Singh Jul 28, 2025
c2b50e8
Resolve conflict
Subarna-Singh Jul 28, 2025
6f170e3
Add endpoints: gmci and wintermute; Segregate shared components
Subarna-Singh Jul 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/silent-eels-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chainlink/gmci-adapter': major
---

Wintermute EA
17 changes: 15 additions & 2 deletions packages/sources/gmci/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import { AdapterConfig } from '@chainlink/external-adapter-framework/config'

export const config = new AdapterConfig({
API_KEY: {
GMCI_API_KEY: {
description: 'An API key for Data Provider',
type: 'string',
required: true,
sensitive: true,
},
WS_API_ENDPOINT: {
GMCI_WS_API_ENDPOINT: {
description: 'WS endpoint for GMCI Data Provider',
type: 'string',
required: false,
default: 'wss://api.gmci.co/private',
},
WINTERMUTE_API_KEY: {
description: 'An API key for Data Provider',
type: 'string',
required: true,
sensitive: true,
},
WINTERMUTE_WS_API_ENDPOINT: {
description: 'WS endpoint for GMCI Data Provider',
type: 'string',
required: false,
default: 'wss://generic-alb-ty.api.wintermute-rfq.xyz:15494/private',
},
})
10 changes: 10 additions & 0 deletions packages/sources/gmci/src/endpoint/gmci.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter'
import { gmciTransport } from '../transport/gmci'
import { inputParameters } from './shared'

export const endpoint = new AdapterEndpoint({
name: 'gmci',
aliases: [],
transport: gmciTransport,
inputParameters,
})
3 changes: 2 additions & 1 deletion packages/sources/gmci/src/endpoint/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { endpoint as price } from './price'
export { endpoint as gmci } from './gmci'
export { endpoint as wintermute } from './wintermute'
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter'
import { InputParameters } from '@chainlink/external-adapter-framework/validation'
import { config } from '../config'
import { transport } from '../transport/price'

export const inputParameters = new InputParameters(
{
Expand Down Expand Up @@ -31,10 +29,3 @@ export type BaseEndpointTypes = {
Response: GMCIResultResponse
Settings: typeof config.settings
}

export const endpoint = new AdapterEndpoint({
name: 'price',
aliases: [],
transport: transport,
inputParameters,
})
10 changes: 10 additions & 0 deletions packages/sources/gmci/src/endpoint/wintermute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { AdapterEndpoint } from '@chainlink/external-adapter-framework/adapter'
import { wintermuteTransport } from '../transport/wintermute'
import { inputParameters } from './shared'

export const endpoint = new AdapterEndpoint({
name: 'wintermute',
aliases: [],
transport: wintermuteTransport,
inputParameters,
})
6 changes: 3 additions & 3 deletions packages/sources/gmci/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { expose, ServerInstance } from '@chainlink/external-adapter-framework'
import { Adapter } from '@chainlink/external-adapter-framework/adapter'
import { config } from './config'
import { price } from './endpoint'
import { gmci, wintermute } from './endpoint'

export const adapter = new Adapter({
defaultEndpoint: price.name,
defaultEndpoint: gmci.name,
name: 'GMCI',
config,
endpoints: [price],
endpoints: [gmci, wintermute],
})

export const server = (): Promise<ServerInstance | undefined> => expose(adapter)
18 changes: 18 additions & 0 deletions packages/sources/gmci/src/transport/gmci.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { EndpointContext } from '@chainlink/external-adapter-framework/adapter'
import {
WebSocketTransport,
WebSocketTransportConfig,
} from '@chainlink/external-adapter-framework/transports'
import { baseOptions, WsTransportTypes } from './shared'

export const options: WebSocketTransportConfig<WsTransportTypes> = {
...baseOptions,
url: (context: EndpointContext<WsTransportTypes>) => context.adapterSettings.GMCI_WS_API_ENDPOINT,
options: async (context: EndpointContext<WsTransportTypes>) => ({
headers: {
'X-GMCI-API-KEY': context.adapterSettings.GMCI_API_KEY,
},
}),
}

export const gmciTransport = new WebSocketTransport(options)
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { EndpointContext } from '@chainlink/external-adapter-framework/adapter'
import {
WebSocketTransport,
WebSocketTransportConfig,
} from '@chainlink/external-adapter-framework/transports'
// import { WebSocketTransportConfig } from '@chainlink/external-adapter-framework/transports'
import { makeLogger } from '@chainlink/external-adapter-framework/util'
import { BaseEndpointTypes } from '../endpoint/price'
import { TypeFromDefinition } from '@chainlink/external-adapter-framework/validation/input-params'
import { BaseEndpointTypes } from '../endpoint/shared'
import { convertTimetoUnixMs } from './util'

export interface PriceMessage {
Expand Down Expand Up @@ -42,14 +39,7 @@ export type WsTransportTypes = BaseEndpointTypes & {

const logger = makeLogger('GmciTransport')

export const options: WebSocketTransportConfig<WsTransportTypes> = {
url: (context: EndpointContext<WsTransportTypes>) => context.adapterSettings.WS_API_ENDPOINT,
options: async (context: EndpointContext<WsTransportTypes>) => ({
headers: {
'X-GMCI-API-KEY': context.adapterSettings.API_KEY,
},
}),

export const baseOptions = {
handlers: {
message(message: WsResponse) {
if (message.success === false) {
Expand Down Expand Up @@ -81,20 +71,18 @@ export const options: WebSocketTransportConfig<WsTransportTypes> = {
},

builders: {
subscribeMessage: (params) => {
subscribeMessage: (params: TypeFromDefinition<BaseEndpointTypes['Parameters']>) => {
return {
op: 'subscribe',
args: [`price.${params.symbol}`.toLowerCase()],
}
},

unsubscribeMessage: (params) => {
unsubscribeMessage: (params: TypeFromDefinition<BaseEndpointTypes['Parameters']>) => {
return {
op: 'unsubscribe',
args: [`price.${params.symbol}`.toLowerCase()],
}
},
},
}

export const transport = new WebSocketTransport(options)
19 changes: 19 additions & 0 deletions packages/sources/gmci/src/transport/wintermute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { EndpointContext } from '@chainlink/external-adapter-framework/adapter'
import {
WebSocketTransport,
WebSocketTransportConfig,
} from '@chainlink/external-adapter-framework/transports'
import { baseOptions, WsTransportTypes } from './shared'

export const options: WebSocketTransportConfig<WsTransportTypes> = {
...baseOptions,
url: (context: EndpointContext<WsTransportTypes>) =>
context.adapterSettings.WINTERMUTE_WS_API_ENDPOINT,
options: async (context: EndpointContext<WsTransportTypes>) => ({
headers: {
'X-GMCI-API-KEY': context.adapterSettings.WINTERMUTE_API_KEY,
},
}),
}

export const wintermuteTransport = new WebSocketTransport(options)
Loading