MCPcopy Create free account
hub / github.com/ccxt/ccxt / setLeverage

Method setLeverage

js/src/pacifica.js:2537–2555  ·  view source on GitHub ↗

* @method * @name pacifica#setLeverage * @description set the level of leverage for a market * @see https://docs.pacifica.fi/api-documentation/api/rest-api/account/update-leverage * @param {float} leverage the rate of leverage * @param {string} symbol unified market symbol

(leverage, symbol = undefined, params = {})

Source from the content-addressed store, hash-verified

2535 * @returns {object} response from the exchange
2536 */
2537 async setLeverage(leverage, symbol = undefined, params = {}) {
2538 const operationType = 'update_leverage';
2539 if (symbol === undefined) {
2540 throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
2541 }
2542 await this.loadMarkets();
2543 const market = this.market(symbol);
2544 const sigPayload = {
2545 'symbol': market['id'],
2546 'leverage': leverage,
2547 };
2548 const request = this.postActionRequest(operationType, sigPayload, params);
2549 params = this.omit(params, ['expiryWindow']);
2550 const response = await this.privatePostAccountLeverage(request);
2551 // {
2552 // "success": true
2553 // }
2554 return response;
2555 }
2556 /**
2557 * @method
2558 * @name pacifica#withdraw

Callers

nothing calls this directly

Calls 5

postActionRequestMethod · 0.95
loadMarketsMethod · 0.45
marketMethod · 0.45
omitMethod · 0.45

Tested by

no test coverage detected