Skip to content

Commit

Permalink
speed up withdrawLiquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoch05 committed Oct 15, 2024
1 parent 9707396 commit e8e0321
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 57 deletions.
9 changes: 0 additions & 9 deletions apollo/src/lnv3/lnv3.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export class Lnv3Service implements OnModuleInit {
private fetchCache = new Array(this.transferService.transfers.length).fill('').map((_) => ({
latestRelayerInfoNonce: -1,
isSyncingHistory: false,
waitingWithdrawInterval: 0,
waitingWithdrawRecords: [],
fetchProviderInfoInterval: 0,
syncingStage: SyncStage.SyncRecord,
Expand All @@ -75,7 +74,6 @@ export class Lnv3Service implements OnModuleInit {

async onModuleInit() {
this.transferService.transfers.forEach((item, index) => {
this.fetchCache[index].waitingWithdrawInterval = index * 3;
this.fetchCache[index].fetchProviderInfoInterval = index;
this.taskService.addInterval(
`${item.chainConfig.code}-lnv3-fetch_history_data`,
Expand Down Expand Up @@ -494,13 +492,6 @@ export class Lnv3Service implements OnModuleInit {
}

async fetchWithdrawCacheStatus(transfer: PartnerT2, index: number) {
const cache = this.fetchCache[index];
cache.waitingWithdrawInterval += 1;
if (cache.waitingWithdrawInterval < 6) {
return;
}
cache.waitingWithdrawInterval = 0;

const records = await this.aggregationService
.queryHistoryRecords({
skip: this.skipForWithdrawLiquidity[index],
Expand Down
96 changes: 48 additions & 48 deletions apollo/src/lnv3/transfer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ export class TransferService extends BaseTransferServiceT2 {
formalChainTransfers: PartnerT2[] = [
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.polygonEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
Expand All @@ -44,130 +40,130 @@ export class TransferService extends BaseTransferServiceT2 {
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.thegraph,
url: this.polygonEndpoint,
},
],
chainConfig: HelixChain.polygon,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.arbitrumEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.arbitrumEndpoint,
},
],
chainConfig: HelixChain.arbitrum,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.bscEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.thegraph,
url: this.bscEndpoint,
},
],
chainConfig: HelixChain.bsc,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.lineaEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.lineaEndpoint,
},
],
chainConfig: HelixChain.linea,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.opEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.opEndpoint,
},
],
chainConfig: HelixChain.op,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.gnosisEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.gnosisEndpoint,
},
],
chainConfig: HelixChain.gnosis,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.mantleEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.mantleEndpoint,
},
],
chainConfig: HelixChain.mantle,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.scrollEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.scrollEndpoint,
},
],
chainConfig: HelixChain.scroll,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.darwiniaEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
Expand All @@ -176,6 +172,10 @@ export class TransferService extends BaseTransferServiceT2 {
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.thegraph,
url: this.darwiniaEndpoint,
},
],
chainConfig: HelixChain.darwiniaDvm,
},
Expand All @@ -200,16 +200,16 @@ export class TransferService extends BaseTransferServiceT2 {
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.moonbeamEndpoint,
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
indexerType: Level0IndexerType.thegraph,
url: this.moonbeamEndpoint,
},
],
chainConfig: HelixChain.moonbeam,
Expand All @@ -225,10 +225,6 @@ export class TransferService extends BaseTransferServiceT2 {
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.baseEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
Expand All @@ -237,19 +233,23 @@ export class TransferService extends BaseTransferServiceT2 {
indexerType: Level0IndexerType.envio,
url: this.dnvioEndpoint,
},
{
indexerType: Level0IndexerType.thegraph,
url: this.baseEndpoint,
},
],
chainConfig: HelixChain.base,
},
{
level0Indexers: [
{
indexerType: Level0IndexerType.thegraph,
url: this.zircuitEndpoint,
},
{
indexerType: Level0IndexerType.superindex,
url: this.superindexEndpoint,
},
{
indexerType: Level0IndexerType.thegraph,
url: this.zircuitEndpoint,
},
],
chainConfig: HelixChain.zircuit,
},
Expand Down

0 comments on commit e8e0321

Please sign in to comment.