Skip to content

Commit

Permalink
update sdk, record all swap
Browse files Browse the repository at this point in the history
  • Loading branch information
zfy0701 committed Dec 6, 2023
1 parent 91a86e3 commit 4da3f1e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"type": "module",
"dependencies": {
"@sentio/sdk": "^2.28.2",
"@sentio/sdk": "^2.28.4-rc.1",
"node-fetch": "^3.3.1"
},
"resolutions": {
Expand Down
7 changes: 3 additions & 4 deletions projects/liquidswap-cl/src/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const volOptions: MetricOptions = {
// }
}

export const totalValue = Gauge.register("total_value", commonOptions)
export const tvlAll = Gauge.register("tvl_all", commonOptions)
export const tvlByPool = Gauge.register("tvl_by_pool", commonOptions)
export const tvlByPoolNew = Gauge.register("tvl_by_pool_new", commonOptions)
Expand Down Expand Up @@ -43,7 +42,7 @@ const fetchConfig: MoveFetchConfig = {
// }
}

pool.bind()
pool.bind({ startVersion: 638615642 })
.onEventPoolCreatedEvent(async (evt, ctx) => {
const coinx = toTypeString(evt.data_decoded.x)
const coiny = toTypeString(evt.data_decoded.y)
Expand Down Expand Up @@ -95,7 +94,7 @@ pool.bind()
sum(evt.data_decoded.y_in) + sum(evt.data_decoded.y_out),
{})

if (value.isGreaterThan(0)) {
// if (value.isGreaterThan(0)) {
ctx.eventLogger.emit("Swap", {
distinctId: ctx.transaction.sender,
value: value,
Expand All @@ -105,7 +104,7 @@ pool.bind()
fee: sum(evt.data_decoded.fees),
protocolFee: sum(evt.data_decoded.protocol_fees)
})
}
// }
}, fetchConfig)
.onEventFlashloanEvent(async (evt, ctx) => {
const pool = getPool(ctx.transaction)
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1298,24 +1298,24 @@
truffle-privatekey-provider "^1.5.0"
web3 "^1.3.0"

"@sentio/protos@2.28.2":
version "2.28.2"
resolved "https://registry.yarnpkg.com/@sentio/protos/-/protos-2.28.2.tgz#59382d9d0ac8ace9ae6b45be1ba2ffca74c7813b"
integrity sha512-TOSSh5lgz9ptb+PeG0t8bIAk6ySd4wgxSmx9Wma8I8JQDS6HyDa7KqnryUh8FbF2i0IHQUQTOkPDk54OsoszBA==
"@sentio/protos@2.28.4-rc.1":
version "2.28.4-rc.1"
resolved "https://registry.yarnpkg.com/@sentio/protos/-/protos-2.28.4-rc.1.tgz#8ccd1b00bc08c68dbc0de880ab6874d53fbc54a0"
integrity sha512-5nZt24m7b+FcLriH0hGT8ZdDDfEzYmSQuDlQIxL5lV69ZJDvvAiWxDaLtnlO5nRmga2EcaTHnCYsjVA7WloANA==
dependencies:
google-protobuf "^3.21.2"
long "^5.2.3"
nice-grpc "^2.1.5"
nice-grpc-common "^2.0.2"
protobufjs "^7.2.5"

"@sentio/runtime@^2.28.2":
version "2.28.2"
resolved "https://registry.yarnpkg.com/@sentio/runtime/-/runtime-2.28.2.tgz#a5428c0766bdf0887c5e34f34ec3bc4d6001bcea"
integrity sha512-Dj0wzNdjOToFvUjukkdKTsT+pJ5WANJpWCrrleVNePRMvyGNvcl4KrIdeW5umQ8yI/mJn7tkYzGFdYpyerKfPg==
"@sentio/runtime@^2.28.4-rc.1":
version "2.28.4-rc.1"
resolved "https://registry.yarnpkg.com/@sentio/runtime/-/runtime-2.28.4-rc.1.tgz#dea5e00b4d767e8cb596a1311155c7bbfd1075b4"
integrity sha512-GYPssPq4y7n/CMnnv4VnaiG03uUf8V5Mln1pW1JEFcWdlcmGj95BB74vFcezE5Bo8wpOkyA1jIhNnrGmpw4gpw==
dependencies:
"@grpc/grpc-js" "^1.8.14"
"@sentio/protos" "2.28.2"
"@sentio/protos" "2.28.4-rc.1"
command-line-args "^5.2.1"
command-line-usage "^7.0.1"
fs-extra "^11.0.0"
Expand All @@ -1331,19 +1331,19 @@
utility-types "^3.10.0"
winston "^3.10.0"

"@sentio/sdk@^2.28.2":
version "2.28.2"
resolved "https://registry.yarnpkg.com/@sentio/sdk/-/sdk-2.28.2.tgz#f30326c1344bffb1cdaa6b8a5d616d57e702d55b"
integrity sha512-Xh2HI3SlCxJR0Rv3vdYnY1XMJI9X/VL8pdkqPEg2zS9kv+BtHjinl6dKxv2Pnft1one893mr+M3Bp5VTImmEig==
"@sentio/sdk@^2.28.4-rc.1":
version "2.28.4-rc.1"
resolved "https://registry.yarnpkg.com/@sentio/sdk/-/sdk-2.28.4-rc.1.tgz#60c7b143bf1b88c1853db57f19d47eb3eb278952"
integrity sha512-n3pSdHgNay2QT44FQMRxCBhl2zFbksdwgG/T9iNXeOdxqYGFrMKp+k2iGdu/W00+cV+HIFCt2FYVH9xqICgucw==
dependencies:
"@coral-xyz/borsh" "^0.29.0"
"@mysten/sui.js" "~0.46.1"
"@project-serum/anchor" "^0.26.0"
"@sentio/bigdecimal" "^9.1.1-patch.3"
"@sentio/chain" "^1.0.4"
"@sentio/ethers-v6" "^1.0.28"
"@sentio/protos" "2.28.2"
"@sentio/runtime" "^2.28.2"
"@sentio/protos" "2.28.4-rc.1"
"@sentio/runtime" "^2.28.4-rc.1"
"@solana/web3.js" "^1.78.3"
"@typemove/aptos" "~1.2.8"
"@typemove/move" "~1.2.8"
Expand Down

0 comments on commit 4da3f1e

Please sign in to comment.