Sifchain / sifnode

SifNode - The future of Defi
Other
108 stars 117 forks source link

Get User Liquidity Providers #1827

Open timlind opened 3 years ago

timlind commented 3 years ago

Is your proposal related to a problem?

The way FE is getting a user's pools is currently inefficient, with a call to /clp/getAssets?address=${useraddress} and then /getLiquidityProvider?symbol=${denom}&address=${useraddress}

Describe the solution you'd like

Create one endpoint that FE can use to get the pool data for a user.

Describe alternatives you've considered

(Write your answer here.)

Technical Considerations

Use pagination.

Additional context

timlind commented 3 years ago

  rpc GetLiquidityByProvider(LiquidityByProviderRequest)
      returns (LiquidityByProviderResponse) {
    option (google.api.http).get = "/sifchain/clp/v1/liquiditybyprovider/{lp_address}";
  }

message LiquidityByProviderRequest {
   string lp_address = 1;
}

message LiquidityByProviderResponse {
   sifnode.clp.v1.LiquidityProvider lp_address;
   repeated LiquidityProvision results ;
   int64 height;
}

message LiquidityProvision {
    string symbol;
    string native_asset_balance;
    string external_asset_balance;
    sifnode.clp.v1.LiquidityProvider lp_address;
}
marshsif commented 3 years ago

@iverc @timlind what is the status of this issue? Is it complete, deployed to testnet, and is there a PR for it?

timlind commented 3 years ago

@iverc merged in the PR #1853 for this.

@iverc has it been tested on the network?

@ajoslin Have you updated FE to use this endpoint?

iverc commented 3 years ago

https://github.com/Sifchain/sifnode/pull/1853

marshsif commented 3 years ago

Hey @iverc, what remains for this issue? The testing team needs to test this on TestNet.

marshsif commented 2 years ago

@iverc what is the status of this issue?

iverc commented 2 years ago

@marshsif doing additional tests on the current state of the code to make sure that it works as expected